# from xfce session to avoid keyboard shortcut clashing # start xephyr in VGA1 monitor: Xephyr -keybd ephyr,,,xkbmodel=evdev,xkblayout=it -listen tcp -ac -reset -output VGA1 :5 # then start an xterm locally export DISPLAY=:5.0 xterm # and remote ssh (no X fw needed if local tcp with access disablesd (-tcp -ac) => UNSECURE!!! ssh remote-host export DISPLAY=notebook:5.0 xrdb -merge ~/.Xresources xterm -geometry 132x50-0+0 # start awesome dbus-launch $(which awesome) dex -a -e Awesome Show Sample Output
Alternative1 (grep support): pacman -Ss python | paste - - | grep --color=always -e '/python' | less -R Alternative2 (eye-candy, no grep): pacman --color=always -Ss "python" | paste - - | less -R in ~/.bashrc: pkg-grep() { pacman -Ss "$1" | paste - - | grep --color=always -e "${2:-$1}" | less -R ; } pkg-search() { pacman --color=always -Ss "python" | paste - - | less -R; } Show Sample Output
Transfer tar stream thru nc with pv montoiring taken from: http://www.catonmat.net/blog/unix-utilities-pipe-viewer/ Show Sample Output
Show TCP Listen ports sorted by number (bugs: IPV6 addresses not supported) Show Sample Output
grabbed from Andrew Aylett post: http://superuser.com/questions/133313/can-i-speed-up-cygwins-fork Show Sample Output
in Cygwin, start X server fullscreen ... For openGL, check here: http://www.cs.utoronto.ca/~wongam/d18_cygwin_opengl_setup/cygwin_opengl_setup.html
XDMCP ust be enabled (gdm,lightdm,xdm etc ) Show Sample Output
alternatives: xinit $(which gnome-awesome-session) with cat /usr/local/bin/gnome-awesome-session: #!/bin/bash exec gnome-session --session awesome "$@" following: http://awesome.naquadah.org/wiki/Quickly_Setting_up_Awesome_with_Gnome note: in ubuntu 12.10 a probable Xephyr recent bug rejects keybd option ... Show Sample Output
ssh compresion -C option ... on slow connection VNC performs better but in local LAN native secure X protocol is an option Show Sample Output
taken from http://www.unix.com/shell-programming-scripting/158311-how-tee-stderr.html " What does it mean? The redirection operator n>&m makes file descriptor n to be a copy of file descriptor m. So, whe are: - Opening a new file descriptor, 3, that is a copy of file descriptor 1, the standard output; - Making file descriptor 1 a copy of file descriptor 2, the standard error output; - Making file descriptor 2 to be a copy of file descriptor 3 (the "backup" of the standard output) in a short: we swapped the standard output and the standard error output. "
extract data in multiline blocks of data with perl pattern matching loop Show Sample Output
depends on date format locale ... Show Sample Output
useful to count events in logs @see: http://www.commandlinefu.com/commands/view/10327/report-summary-of-string-occurrence-by-time-period-hour#comment Show Sample Output
useful to count events in logs Show Sample Output
- excel date compatible with a separate hour field - added a fixed 1 for easier request counter aggregation - split URL in directory, filename, fileext, query - used with tomcat valve with response bytes replaced by elapsed time Show Sample Output
with a semicolon text file map, apply multiple replace to a single file Show Sample Output
from http://stackoverflow.com/questions/1030787/multiline-search-replace-with-perl added greedy trick in wildcard match (.*?) from http://www.troubleshooters.com/codecorn/littperl/perlreg.htm#Greedy Show Sample Output
shell loop to scan netstat output avoiding loolback aliases (local/remote swap for local connections) Show Sample Output
use imagemagik convert
rename file name with fixed length nomeric format pattern Show Sample Output
change keyboard layout in X
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: