tweenux
RSS Feed Email Feed

Archive for 'Tips & tricks'

Redirect hostname.com/stuff to www.hostname.com/stuff

Okay,
The lazy days are over and I figured out it was time to create a more useful redirection of a hostname in my apache2 configuration files. The past few years I have been using this redirection method, but not been happy with it:

RedirectMatch ^/$ http://www.hostname.com

This is ok, but if the user is trying to reach [...]

Charging Acid batteries

Garden/Lawn Tractor batteries can be recharged by using a 12V automotive charger.
A typical 12V Tractor battery has a capacity of about 10Ah.
Be sure to set the charging time accordingly to the Ah output of the charger.
It is a good practice to charge the battery before storing the Tractor for the winter.
Store the battery in a [...]

extract pages from a pdf file

I came across a nice little command to extract pages from a pdf file.

:~$ gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \
-dFirstPage=3 -dLastPage=4 \
-sOutputFile=OUTFILE_p3-p4.pdf SOURCEFILE.pdf

Putting (splicing) multiple pdfs together:

:~$ gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -sOutputFile=OUTFILE.pdf SOURCE_FILE_1.pdf SOURCE_FILE_2.pdf

Source: http://www.linuxjournal.com/content/tech-tip-extract-pages-pdf

ffmpeg tips and tricks

I wanted to create a time-lapse video with a few CCTV cameras and a video capturing card.
To record images at 10 sec interval I used motion.
This analog video recording left me with lots a couple of mpg files that I wanted to crop in order to remove black lines on the sides. ffmpeg turned out [...]

Useful bash commands

It’s not always easy to remember the commands used for a special task if performed once a year.
Below I have gathered a few such commands that may be of interest in the future too.
1. Sending mail with/without attachment.

:~$ echo "message body" | mail -s "my subject" user@mail

:~$ echo "message body" | mutt -s "my subject" [...]

ext2/ext3 on Mac OS X

Install MacFUSE and fuse-ext2 to be able to read and possibly write to ext2/ext3 file systems connected to OS X.

rm -r the wrong place

If you read this, it is probably already too late, but remember this command.
It is very important not to write anything to the disk. Do not even close a program before you have re-mounted the system.
This re-mounts /home as read-only:

:~$ sudo mount -o remount,ro /home

If you have X running, now is the time to kill [...]

  Recent Entries »