Wednesday, March 22, 2017

FTP multiple parallel connections to download large file fast.

Some ISP's limit the download speed of a single file. This can lead to slower downloads of large files even though the speed you are paying for is much higher. For example my internet connection is advertised at 50 Mb/s download. When I try to download a large file from an ftp I get speeds around 600 KB/s or to put it in the same units as the ISP rate, 4.8 Mb/s. In order to get around that limitation I have to download the file using multiple connections.

 LFTP is an application for linux that has an option for multiple parallel download connections. It can be used on windows through the cygwin application (https://www.cygwin.com/).

Command to run lftp:

lftp <username>@<server>:<port>

Then to download a file using multiple connections:

pget -n <number of connections> <filename>

This will use up bandwidth on the server so be careful to not use too many connections if the server has limited bandwidth.

Thursday, March 9, 2017

Lineage OS Random Info

Download location of updates: /data/data/org.lineageos.updater/app_updates

Tuesday, March 7, 2017

TAR useful commands

Compress current directory into archive.tgz (verbose)

tar -czvf archive.tgz *

Compress xfiles directory into archive.tgz (verbose)

tar -czvf archive.tgz xfiles/

Extract archive.tgz into current directory

tar -xzvf archive.tgz

Extract archive.tgz into xfiles directory

tar -xzvf archive.tgz -C /xfiles/

Slightly modified from this blog post

Monday, March 6, 2017

GDB hints

Backtrace all threads:

thread apply all backtrace

GDB Cheat Sheet from DarkDust.net

Grub saving default OS Centos/RHL

Here is an example grub configuration file which saves the default OS based on the last picked OS.
/boot/grub/grub.conf

Don't use the full file. The OS arguments will probably not work on your system directly. There are two important pieces so this will work.

default=saved

which lets grub know it should save the default and use that instead of a hard coded default.

savedefault

which needs to be in the configuration for each OS that you want to save over the current default when it is selected.

Full example:

default=saved
timeout=5
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu

rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M rd_LVM_LV=vg_rhent529/lv_swap rd_LVM_LV=vg_rhent529/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet nouveau.modeset=0 rdblacklist=nouveau
initrd /initramfs-2.6.32-504.12.2.el6.x86_64.img
savedefault

title Windows 7
rootnoverify (hd1,0)
chainloader +1
savedefault