Check These Out
Opposite:
Convert an one-liner to script:
$ foo() { ; }
...
$ typeset -f foo
...
$ unset -f foo
This command will copy a folder tree (keeping the parent folders) through ssh. It will:
- compress the data
- stream the compressed data through ssh
- decompress the data on the local folder
This command will take no additional space on the host machine (no need to create compressed tar files, transfer it and then delete it on the host).
There is some situations (like mirroring a remote machine) where you simply cant wait for a huge time taking scp command or cant compress the data to a tarball on the host because of file system space limitation, so this command can do the job quite well.
This command performs very well mainly when a lot of data is involved in the process. If you copying a low amount of data, use scp instead (easier to type)
So, I'm using a CentOS VM in VirtualBox, and created four new disks in the SCSI controller.
The VM created the folders:
/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd
Using a 'for loop' all disks are partitioned for LVM.
Not so much handy by itself, but very nice in shell scripts.
This makes you a handy ncurses based checklist. Much like terminal installers, just use the arrow keys and hit 'Space' to adjust the selections. Returns all selected tags as strings, with no newline at the end. So, your output will be something like:
"one" "two" "three" "four" "etc"
For those who prefer bash expansion over gratuitious typing:
$ whiptail --checklist "Simple checkbox menu" 12 35 3 $(echo {one,two,three,four}" '' 0"} )
Things to note:
The height must includes the outer border and padding: add 7 to however many items you want to show up at the same time.
If the status is 1, it will be selected by default. anything else, will be deselected.
Use `zless` to read the content of your *rss.gz file:
$ zless commandlinefu-contribs-backup-2009-08-10-07.40.39.rss.gz
This command will squeeze all consequent blank lines (including those with only space and tab charactes) to one. It will also empty the resulting line (remove the "|s/.*//" part if you don't need that).
Command binds a set of commands to the F12 key.
Feel free to alter the dashboard according to your own needs.
How to find the key codes?
Type
$ read
Then press the desired key (example: F5)
$ ^[[15~
Try
$ bind '"\e[15~"':"\"ssh su@ip-address\C-m"""
or
$ bind '"\e[16~"':"\"apachectl -k restart\C-m"""