Check These Out
Generates a random 8-character password that can be typed using only the left hand on a QWERTY keyboard. Useful to avoid taking your hand off of the mouse, especially if your username is left-handed. Change the 8 to your length of choice, add or remove characters from the list based on your preferences or kezboard layout, etc.
This lets you replace a file or directory and quickly revert if something goes wrong. For example, the current version of a website's files are in public_html. Put a new version of the site in public_html~ and execute the command. The names are swapped. If anything goes wrong, execute it again (up arrow or !!).
Only filters the statement related to a specific table ('departments', in the example), from the output of mysqldump
i have a large video file, 500+ MB, so i cant upload it to flickr, so to reduce the size i split it into 2 files. the command shows the splitting for the first file, from 0-4 minutes. ss is start time and t is duration (how long you want the output file to be).
credit goes to philc: http://ubuntuforums.org/showthread.php?t=480343
NOTE: when i made the second half of the video, i got a *lot* of lines like this:
frame= 0 fps= 0 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbit
just be patient, it is working =)
No need to type out the full OR clause if you know which OS you're on, but this is easy cut-n-paste or alias to get top ten directories by singleton.
To avoid the error output from du -xSk you could always 2>/dev/null but you might miss relevant STDERR.
Display the code of a previously defined shell function.
If you enable multiuser, then you can permit others to share your screen session. The following conditions apply:
1. screen must be suid root;
2. "multiuser on" must be configured in ~/.screenrc;
3. control the others user(s) access with "aclchg":
# ----- from ~/.screenrc-users -----
aclchg someuser +rx "#?" #enable r/o access to "someuser"
aclchg someuser -x "#,at,aclchg,acladd,acldel,quit" # don't allow these
aclchg otheruser +rwx "#?" # enable r/w access to "otheruser"
aclchg otheruser -x "#,at,aclchg,acladd,acldel,quit" # don't allow them to use these commands
# -----
After doing this (once), you start your session with:
$ screen
Then, the other user can join your terminal session(s) with youruserid:
$ screen -r youruserid/
Note: the trailing "/" is required.
Multiple users can share the same screen simultaneously, each with independent access controlled precisely with "aclchg" in the ~/.screenrc file.
I use the following setup:
# ~/.screenrc-base
# default screenrc on any host
source $HOME/.screenrc-base
source $HOME/.screenrc-$HOST
source $HOME/.screenrc-users
# -----
Then, the base configurations are in ~/.screenrc-base; the host-specific configurations are in ~/.screenrc-$HOST, and the user configurations are in ~/.screenrc-users.
The host-specific .screenrc file might contain some host-specific screen commands; e.g.:
# ~/.screen-myhost
# -----
screen -t 'anywhere' /bin/tcsh
screen -t 'anywhere1' /bin/tcsh
# ----
The .screenrc-base contains:
# ~/.screenrc-base
## I find typing ^a (Control-a) awkward. So I set the escape key to CTRL-j instead of a.
escape ^Jj
termcapinfo xterm* ti@:te@:
autodetach on
zombie kr
verbose on
multiuser on