Check These Out
The uuencode utility will encode your file so that it can be sent as an attachment to an email. It is part of the sharutils package in RHEL/CentOS/Fedora.
works best in a shell script run at startup. It will ping localhost once and output to null, after it does that, acpi is called for temperature in fahrenheit and piped through to another loop that feeds notify-send for a tooltip. After waiting five minutes, it will start over.
On command mode in Vim you can save parts of the current buffer in another file.
* The 'n' value represents the first line of the new file.
* The 'm' value represents the last line of the new file.
* newfile.txt is the newfile.
The results are similar to this command in perl:
$ perl -ne 'print if n..m' in.sql > out.sql
Don't track in history commands starting with whitespace.
Moreover ignore duplicates from history.
To be set in .bashrc
ex.
$ export HISTCONTROL=ignoreboth
$ echo antani
$ history|grep -c antani
0
Rather than chain a string of greps together and pipe them to awk, use awk to do all the work. In the above example, a string would be output to stdout if it matched pattern1 AND pattern2, but NOT pattern3.
tars the current directory (and its children) in an archive of the same name (plus ".tar" :)) in the parent directory without the absolute path, so that when the archive is extracted, only the current directory name is created for the path. Assumes bash/zsh.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Ever need to know why Apache is bogging down *right now*? Hate scanning Apache's Extended server-status for the longest running requests? Me, too. That's why I use this one liner to quickly find suspect web scripts that might need review.
Assuming the Extended server-status is reachable at the target URL desired, this one-liner parses the output through elinks (rendering the HTML) and shows a list of active requests sorted by longest running request at the bottom of the list. I include the following fields (as noted in the header line):
Seconds: How long the request is alive
PID: Process ID of the request handler
State: State of the request, limited to what I think are the relevant ones (GCRK_.)
IP: Remote Host IP making the request
Domain: Virtual Host target (HTTP/1.1 Host: header). Important for Virtual Hosting servers
TYPE: HTTP verb
URL: requested URL being served.
Putting this in a script that runs when triggered by high load average can be quite revealing. Can also capture "forgotten" scripts being exploited such as "formmail.pl", etc.
This will extract all of the urls from a firefox session (including urls in a tab's history). The sessionstore.js file is in ~/.mozilla/firefox/{firefox profile}
Shorter and faster...