Check These Out
Lots of scripts show you how to use socat to send an email to an SMTP server; this command actually emulates an SMTP server!
It assumes the client is only sending to one recipient, and it's not at all smart, but it'll capture the email into a log file and the client will stop retrying.
I used this to diagnose what emails were being sent by cron and subsequently discarded, but you can use it for all sorts of things.
say, someone has aliased ls to 'ls --color=always' and you want to temporarily override the alias (it does not override functions)
i sorta stole this from
http://www.shell-fu.org/lister.php?id=878#MTC_form
but it didn't work, so here it is, fixed.
---
updated to work with jpegs, and to use a fancy positive look behind assertion.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
For instance, if people have signed your key, this will fetch the signers' keys.
Shows a file without comments (at least those starting by #)
- removes empty lines
- removes lines starting by # or "some spaces/tabs then #'"
Useful when you want to quickly see what you have to customize on a freshly installed application without reading the comments that sometimes are a full 1000 lines documentation :)
While posting, I saw this http://www.commandlinefu.com/commands/view/1041/display-contents-of-a-file-wo-any-comments-or-blank-lines
But it's dirty and incomplete, to my mind
My original goal was to remove lines like "\t*#" but I can't figure out how to do a egrep '\t' on a command-line. Two workarounds if needed:
$egrep -v 'press control + V then TAB then #' /your/file
or
$egrep -v -f some_file /your/file #where some_file contains what you want to exclude, example a really inserted TAB
Cycles continuously through a string printing each character with a random delay less than 1 second. First parameter is min, 2nd is max. Example: 1 3 means sleep random .1 to .3. Experiment with different values. The 3rd parameter is the string. The sleep will help with battery life/power consumption.
$ cycle 1 3 $(openssl rand 100 | xxd -p)
Fans of "The Shining" might get a kick out of this:
$ cycle 1 4 ' All work and no play makes Jack a dull boy.'
Useful to identify the field number in big CSV files with large number of fields. The index is the reference to use in processing with commands like 'cut' or 'awk' involved.
Remove the '-maxdepth 1' option if you want to count in directories as well
This command will first add an alias known only to git, which will allow you to pull a remote and first-forward the current branch. However, if the remote/branch and your branch have diverged, it will stop before actually trying to merge the two, so you can back out the changes.
http://www.kernel.org/pub/software/scm/git/docs/git-pull.html
Tested on git 1.5.6.1, msysgit (Windows port)
Actually this is not really the way I want it. I want it to attempt a fast-foward, but not attempt to merge or change my working copy. Unfortunately git pull doesn't have that functionality (yet?).