Check These Out
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Deletes lines to of a file. You must put the end line first in the range for the curly brace expansion, otherwise it will not work properly.
Only the number of calls nothing else.
Useful if you don't have at hand the ability to automatically create a booklet, but still want to.
F is the number of pages to print. It *must* be a multiple of 4; append extra blank pages if needed.
In evince, these are the steps to print it, adapted from https://help.gnome.org/users/evince/stable/duplex-npage.html.en :
1) Click File ▸ Print.
2) Choose the General tab.
Under Range, choose Pages.
Type the numbers of the pages in this order (this is what this one-liner does for you):
n, 1, 2, n-1, n-2, 3, 4, n-3, n-4, 5, 6, n-5, n-6, 7, 8, n-7, n-8, 9, 10, n-9, n-10, 11, 12, n-11...
...until you have typed n-number of pages.
3) Choose the Page Setup tab.
- Assuming a duplex printer:
Under Layout, in the Two-side menu, select Short Edge (Flip).
- If you can only print on one side, you have to print twice, one for the odd pages and one for the even pages.
In the Pages per side option, select 2.
In the Page ordering menu, select Left to right.
4) Click Print.
Of course, you can adjust "Maildir" to your config...
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video).
$ cat /proc/acpi/video/VGA/LCD/brightness
to discover the possible values for your display.
This command clone the first partition of the primary master IDE drive to the second partition
of the primary slave IDE drive (!!! back up all data before trying anything like this !!!)
Repeat command after every 2 secs
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.