6 private links
lsof -nPi tcp:80
sed '/test/{/error|critical|warning/d}' somefile
!:1-3
shopt -s autocd
lsmod | perl -e 'print "digraph \"lsmod\" {";<>;while(<>){@=split/\s+/; print "\"$[0]\" -> \"$\"\n" for split/,/,$[3]}print "}"' | dot -Tpng | display -
strace -e write=1,2 -p $PID 2>&1 | sed -un "/^ |/p" | sed -ue "s/^.{9}(.{50}).+/\1/g" -e 's/ //g' | xxd -r -p
strings /dev/mem|less
command !(regexp to remove from matching)
Note: This is a feature of bash, and it only works if you've enabled 'extglob' (Extended Pattern Matching):
shopt -s extglob
ifconfig | convert label:@- ip.png
ctrl-x e
Next time you are using your shell, try typing ctrl-x e (that is holding control key press x and then e). The shell will take what you've written on the command line thus far and paste it into the editor specified by $EDITOR. Then you can edit at leisure using all the powerful macros and commands of vi, emacs, nano, or whatever.
disown -a && exit
arecord -f cd | ssh -C user@host aplay -f cd
or the other way around
ssh -C user@host arecord -f cd | aplay -f cd
commandlinefu.com is the place to record those command-line gems that you return to again and again.
There are several ways to obtain access to a local shell with a remote connection. The most common of all is to open a known port with a tcp socket and bind its stdout/stderr/stdin to a newly forked shell. This way we can connect from our computer with a simple netcat command. However, this doesn’t work well most of the time: most of the public-facing servers out there have only a few number of ports open to the outside world (like http(s), ftp, smtp, etc) and the remaining inbound requests are usually filtered and dropped by iptables or firewalls.
The solution to this is to use a reverse bind for your local shell. A reverse bind is a simple operation that turns the client into a server and vice-versa. Originally, you’d have opened a port on the target and waited for inbound connections (from your attacking machine). Reverse this and you’ll have an open connection on your own machine waiting for the target machine to connect, this turns the attacker into the receiver waiting for some poor victim to fall into the trap.
tetris with sed
You can detach a process from terminal by adding &! at the end of a command !
Thank you brieuc !
echo "NICK pingbot" > pingbot.input # what nick
echo "USER pingbot +iw pingbot :$0" >> pingbot.input
echo "JOIN #tdobson.net" >> pingbot.input # what channel
tail -f pingbot.input | telnet irc.freenode.net 6667