Check These Out
Simple but useful; list files in the current directory in mtime order. Useful if you've been working on something and then take a day or two off.
Shows all block devices in a tree with descruptions of what they are.
Create a progress dialog with custom title and text using zenity.
I'm annoyed by the boilerplate "don't login unless you are supposed messages in our environment" - this shuts them up.
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token.
This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use:
`awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'`
You must adapt the command line to include:
* $MFA_IDis ARN of the virtual MFA or serial number of the physical one
* TTL for the credentials
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
Set a bookmark as normal shell variable
$ p=/cumbersome/path/to/project
To go there
$ to p
This saves one "$" and is faster to type ;-) The variable is still useful as such:
$ vim $p/
will expand the variable (at least in bash) and show a list of files to edit.
If setting the bookmarks is too much typing you could add another function
$ bm() { eval $1=$(pwd); }
then bookmark the current directory with
$ bm p
This command will use the fdisk utility to find all block devices on your system, and overwrite them with data from the /dev/urandom non-blocking random number generator.
CAUTION: This will irrevocably erase EVERY SINGLE physical block storage device visible to the fdisk utility, including plugged USB devices, RAID sets, LVM, etc.