Check These Out
In general, this is actually not better than the "scrot -d4" command I'm listing it as an alternative to, so please don't vote it down for that. I'm adding this command because xwd (X window dumper) comes with X11, so it is already installed on your machine, whereas scrot probably is not. I've found xwd handy on boxen that I don't want to (or am not allowed to) install packages on.
NOTE: The dd junk for renaming the file is completely optional. I just did that for fun and because it's interesting that xwd embeds the window title in its metadata. I probably should have just parsed the output from file(1) instead of cutting it out with dd(1), but this was more fun and less error prone.
NOTE2: Many programs don't know what to do with an xwd format image file. You can convert it to something normal using NetPBM's xwdtopnm(1) or ImageMagick's convert(1). For example, this would work: "xwd | convert fd:0 foo.jpg". Of course, if you have ImageMagick already installed, you'd probably use import(1) instead of xwd.
NOTE3: Xwd files can be viewed using the X Window UnDumper: "xwud <foo.xwd". ImageMagick and The GIMP can also read .xwd files. Strangely, eog(1) cannot.
NOTE4: The sleep is not strictly necessary, I put it in there so that one has time to raise the window above any others before clicking on it.
The `-q' arg forces tail to not output the name of the current file
For situations where you keep JSON in a VCS and you want your diffs to be sane, such as within a Chef configuration repo.
This depends on 'stripansi' and 'urlencode' commands, which exist on my system as these aliases:
$ alias stripansi='perl -ple "s/\033\[(?:\d*(?:;\d+)*)*m//g;"'
$ alias urlencode='perl -MURI::Escape -ne "\$/=\"\"; print uri_escape \$_"'
The `open` command handles URLs on a Mac. Substitute the equivalent for your system (perhaps gnome-open).
I don't use system `mail`, so I have this aliased as `mail` and use it this way:
$ git show head | mail
If you are behind a restrictive proxy/firewall that blocks port 22 connections but allows SSL on 443 (like most do) then you can still push changes to your github repository.
Your .ssh/config file should contain:
Host *
ForwardX11 no
TCPKeepAlive yes
ProtocolKeepAlives 30
ProxyCommand /usr/local/bin/proxytunnel -v -p -d %h:443
Host
User git
Hostname ssh.github.com
ChallengeResponseAuthentication yes
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
Basically proxytunnel "tunnels" your ssh connection through port 443.
You could also use corkscrew or some other tunneling program that is available in your distro's repository.
PS: I generally use "github.com" as the SSH-HOST so that urls of the kind git@github.com:USER/REPO.git work transparently :) You
when we add a new package to a aptitude (the debian package manager) we need to add the gpg, otherwise it will show warning / error for missing key
This command will format your alias or function to a single line, trimming duplicate white space and newlines and inserting delimiter semi-colons, so it continues to work on a single line.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
It looks for files that contains the given word as parameter.
* case insensitive
* matches files containing the given word.