Check These Out
Sometimes when copying files from one place to another, the timestamps get lost. Maybe you forgot to add a flag to preserve timestamps in your copy command. You're sure the files are exactly the same in both locations, but the timestamps of the files in the new home are wrong and you need them to match the source.
Using this command, you will get a shell script (/tmp/retime.sh) than you can move to the new location and just execute - it will change the timestamps on all the files and directories to their previous values. Make sure you're in the right directory when you launch it, otherwise all the touch commands will create new zero-length files with those names. Since find's output includes "." it will also change the timestamp of the current directory.
Ideally rsync would be the way to handle this - since it only sends changes by default, there would be relatively little network traffic resulting. But rsync has to read the entire file contents on both sides to be sure no bytes have changed, potentially causing a huge amount of local disk I/O on each side. This could be a problem if your files are large. My approach avoids all the comparison I/O. I've seen comments that rsync with the "--size-only" and "--times" options should do this also, but it didn't seem to do what I wanted in my test. With my approach you can review/edit the output commands before running them, so you can tell exactly what will happen.
The "tee" command both displays the output on the screen for your review, AND saves it to the file /tmp/retime.sh.
Credit: got this idea from Stone's answer at http://serverfault.com/questions/344731/rsync-copying-over-timestamps-only?rq=1, and combined it into one line.
Better tool for exporting git's repository is Git itself!
Installs pip packages defining a proxy
There once was a day I needed this info.
Mutes the speakers after an hour, in case you fall asleep watching a video...
List the files a process is using.
Should work on all systems that use dpkg and APT package management.
Prerequisites: module Pod::Webserver installed. You can install it typing:
$ sudo perl -MCPAN -e 'install Pod::Webserver'
You can replace elinks with your fav browser. For FF:
$podwebserver& sleep 2; firefox -remote 'openurl( http://127.0.0.1:8020/, new-tab )'
If you have Firefox open, this will pop-up the index web in a new tab.
Since Bash doesn't support two-dimensional arrays, you can limit your columns length by some big enough constant value ( in this example 100 ) and then index the array with i and j, or maybe write your own get() and set() methods to index the array properly like I implemented for example ( see Sample output ).
For example for i=0 and j=0...99 you'll pick up one of 100 elements in the range [0,99] in the one-dimensional array.
For i=1 and j=0...99 you'll pick up one of 100 elements in the range [100,199].
And so on.
Be careful when using this, and remember that in fact you are always using one-dimensional array.