14 May 2008 Matteo Mattei apache linux tricks
If you want to disable file and directory browsing on your Apache web server in order to prohibit that every users can view the content of a directory (if noindex.php/index.html is present) you need to modify the Apache configuration a little or add a new statement in .htaccess file.
I will show you how to do in both cases:
- Apache configuration: httpd.conf/virtual-hosts
Edit your virtualhost adding these rows:
Add in the .htaccess file this row:
In the first case you need to restart apache server.
05 May 2008 Matteo Mattei bash linux tricks
Using kate as similar text editors, temporary files that have been saved present an annoying trailing tilde that I personally consider useless. I am used to be careful when I edit a file, so I don’t need the backups. For this reason I developed this mini script in bash to remove temporary files from a folder.
rm `find $1 | grep "~$"`
I called the above file rmm and I put it in /usr/bin/ folder. To use it, just place in the folder you have files with trailing slashes and execute it:
Or directly passing the folder as the first argument:
This script is trivial and can be obviously improved. If you want to contribute I will be happy to add your improvements.
07 Apr 2008 Matteo Mattei linux multimedia mplayer streaming
I often see beautiful streaming videos in a variety kind of formats and some people that are trying to grab those videos without any concrete result. I want to share with you how to capture those streams and convert them in a more usable AVI format.
Well… the only thing to do is open a shell on Linux and check if you have installed mplayer, then run this simple command
$ mplayer "mms://url" -dumpstream -dumpfile video_out.avi
- mms://url is the URL of the video stream.
- video_out.avi is the output of the recorded video.
This trick is only available for streams play-ables with mplayer. For sites like Youtube or similar that encode video in flash format, you can’t do it.
Disclaimer: Some sites licenses cannot allow to grab any video. So, please read carefully sites licenses before record any streams.