Page 13 of 15

Re: Post your Command line tricks

Posted: Sun May 03, 2015 9:02 pm
by machinebacon
because it's a builtin, yup :)

Re: Post your Command line tricks

Posted: Sun May 10, 2015 1:58 pm
by stark

Re: Post your Command line tricks

Posted: Sun May 10, 2015 3:54 pm
by wuxmedia
now that looks nice, need to get my vim on now :)
Thanks stark !

Re: Post your Command line tricks

Posted: Thu Jun 11, 2015 11:42 am
by wuxmedia
one I learnt today:

Code: Select all

update-rc.d -f <service> remove
To prevent boot up of certain things.

Re: Post your Command line tricks

Posted: Thu Jun 11, 2015 12:02 pm
by dkeg
nice, I didn't know that. I used chkconfig for that. I'm using openrc now, where you can perform similar actions

Code: Select all

rc-update [add|remove] <service> [runlevel]

Re: Post your Command line tricks

Posted: Wed Jun 17, 2015 2:50 pm
by machinebacon

Code: Select all

dpkg-query -W --showformat='${Installed-Size;10}\t${Package}\n' | sort -k1,1n
show the list of installed packages sorted by size

Re: Post your Command line tricks

Posted: Wed Jun 17, 2015 6:04 pm
by Dr_Chroot
^ This is fantastic. Set as a bash alias :)

Re: Post your Command line tricks

Posted: Wed Jun 17, 2015 7:49 pm
by elixir
^^ Thanks for the share, Sir Bacon. I, too, have this as an alias now :)

Re: Post your Command line tricks

Posted: Wed Jun 17, 2015 10:46 pm
by Dr_Chroot

Re: Post your Command line tricks

Posted: Thu Jun 18, 2015 5:22 pm
by simgin
Julius, you are the BASH script king :)
cheers
simon

Re: Post your Command line tricks

Posted: Sat Jul 11, 2015 4:15 pm
by stark
So after a bit of a struggle I cleaned up my ~/.bashrc :D

Thanks to dkeg for suggesting me previously to use the absolute path ( i.e. /home/stark/ ) which also flawlessly works.

Code: Select all

profile="$HOME/.profile"
shell_aliases="$HOME/etc/shell/bash/aliases.bash"
shell_functions="$HOME/etc/shell/bash/functions.bash"

files="$profile $shell_aliases $shell_functions"

for setup_file in $files; do
        test -f "$setup_file" && . $setup_file
done

Re: Post your Command line tricks

Posted: Sun Jul 12, 2015 1:14 pm
by rhowaldt

Code: Select all

sudo iwlist wlan0 scan | grep Frequency | sort | uniq -c | sort -n
will show you a list of wifi-channels in use and how many different computers are using that channel. useful for finding the emptiest (and thus, theoretically, fastest) channel.
to see which channels your modem supports, use

Code: Select all

iwlist wlan0 channel

Re: Post your Command line tricks

Posted: Sun Jul 12, 2015 5:23 pm
by Dr_Chroot
^ Sweet! Thanks rho.

Re: Post your Command line tricks

Posted: Tue Jul 21, 2015 1:10 am
by rhowaldt
from here: http://stackoverflow.com/questions/1323 ... ng-process

1. find process

Code: Select all

┌┤rhowaldt@lalala [~]
└──┤$ ps aux | grep nicotine
rhowaldt 19459  0.0  0.1   4552  2104 pts/2    S+   04:09   0:00 grep --color=auto nicotine
rhowaldt 29892  4.4  3.5 160016 72628 ?        Sl   Jul20  12:34 /usr/bin/python /usr/bin/nicotine
2. find connections of process:

Code: Select all

┌┤rhowaldt@lalala [~]
└──┤$ ls -l /proc/29892/fd
total 0
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 0 -> pipe:[1484919]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 1 -> /dev/tty1
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 10 -> /home/rhowaldt/.nicotine/config.wordindex.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 11 -> /home/rhowaldt/.nicotine/config.buddywordindex.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 12 -> /home/rhowaldt/.nicotine/config.fileindex.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 13 -> /home/rhowaldt/.nicotine/config.buddyfileindex.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 14 -> /home/rhowaldt/.nicotine/config.mtimes.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 15 -> /home/rhowaldt/.nicotine/config.buddymtimes.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 16 -> socket:[1484517]
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 17 -> anon_inode:inotify
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 18 -> anon_inode:[eventfd]
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 19 -> /proc/29892/mounts
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 2 -> /dev/tty1
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 20 -> pipe:[1485295]
l-wx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 21 -> pipe:[1485295]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 22 -> socket:[1485974]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 23 -> socket:[9280199]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 24 -> socket:[9280208]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 25 -> socket:[9280706]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 26 -> socket:[9281548]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 27 -> socket:[9281549]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 28 -> /home/rhowaldt/.nicotine/incompletefiles/INCOMPLETE38fad79680e0bf38dbb5cd7be4022a9bKing Oliver - One More Time 15-4-1931.MP3
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 29 -> /home/rhowaldt/.nicotine/incompletefiles/INCOMPLETE1fb6be07cfcf2da2df038bddcd02f32209 Sensation Rag.mp3
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 3 -> /home/rhowaldt/.nicotine/config.files.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 30 -> socket:[9283829]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 31 -> socket:[9075282]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 32 -> /home/rhowaldt/.nicotine/incompletefiles/INCOMPLETEa2f94f84cf9d500e95908b9710d0e7727 - Memphis Blues (Or, Mister Crump).m4a
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:10 33 -> /home/rhowaldt/.nicotine/incompletefiles/INCOMPLETE3cc0b04af822b47fadd65eb60437e30fwilli mae 'big mama' thornton - the big change.mp3
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 4 -> socket:[1484509]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 5 -> anon_inode:[eventfd]
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 6 -> /home/rhowaldt/.nicotine/config.buddyfiles.db
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 7 -> /home/rhowaldt/.nicotine/config.streams.db
lr-x------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 8 -> /dev/urandom
lrwx------ 1 rhowaldt rhowaldt 64 Jul 21 04:03 9 -> /home/rhowaldt/.nicotine/config.buddystreams.db

Re: Post your Command line tricks

Posted: Fri Jan 29, 2016 3:31 pm
by wuxmedia
What's my public IP? maybe I need it in a script and don't want to fuck around with a browser and whatsmyip.com?

Code: Select all

wget http://ipinfo.io/ip -qO -
or for the esoteric who happen to be behind a port 80 blocked FW:

Code: Select all

dig +short myip.opendns.com @resolver1.opendns.com
requries dig (dnstools pkg)
Thanks to Rusty.

Re: Post your Command line tricks

Posted: Fri Jan 29, 2016 3:56 pm
by rust collector
Nope, thanks to WüX
You knew how, I did not...

Re: Post your Command line tricks

Posted: Fri Jan 29, 2016 5:50 pm
by ivanovnegro
Very cool Wux.

Re: Post your Command line tricks

Posted: Fri Jan 29, 2016 6:01 pm
by wuxmedia
TBH bacon posted something like this - maybe not in this topic.

Re: Post your Command line tricks

Posted: Sat Jan 30, 2016 9:50 am
by Snap
Thanks, wux.

Re: Post your Command line tricks

Posted: Tue Feb 02, 2016 12:00 am
by Dr_Chroot
Oh ho ho, this is valuable. Thanks!