Gl.ib.ly

(glibly); Just another techie blog.

Encoding audio and removing file extensions from files

Posted by Tariq • Friday, July 24. 2009 • Category: One liners, Tidbits
Earlier today I got a massive SCORM object that contained lots of mp3 files. They were all high quality files, so I wanted to cut them down in size for web use. For this purpose I am using ffmpeg which you can easily get for Windows, Linux or Mac. I tried the following on a Mac, but it should also work on Linux (paths permitting) and on Windows if you are using something like cygwin.

I highly recommend you get familiar with ffmpeg as it is amazingly useful. Just check out the man pages; swf to avi, avi to something that works on ipods, all a breeze!

Continue reading "Encoding audio and removing file extensions from files"

Defined tags for this entry: , , , , , , , ,

Searching compressed Apache logs

Posted by Tariq • Tuesday, June 23. 2009 • Category: One liners, Tidbits
From time to time things tend to go wrong and systems tend to go crazy. Sometimes these errors are more of nuisance than anything else, an intermittent annoyance you'd prefer not to investigate -- trawling through logs is a pain in the backside. Now you need to take a peak at those compressed Apache error log files, ugh! Well before you look for suitable places to hang some rope try running some expressions across a certain number of files. Normally you'd only want to look at logs for the last 7 days, so lets give that a go.

Continue reading "Searching compressed Apache logs"

Defined tags for this entry: , , , , , , , , ,

The command prompt has been disabled by your administrator?

Posted by Tariq • Thursday, February 5. 2009 • Category: One liners, Security
I came across an old enough post on Didier's blog about Group policies that have disabled cmd.exe from running. Didier mentions a few ways to get cmd.exe to run. The suggestion I like the most is to find the DisableCMD string in cmd.exe and change it to DisableAMD using a hex editor. Thankfully there is a tool which will allow us to patch cmd.exe in one tiny line.

Continue reading "The command prompt has been disabled by your administrator?"

Defined tags for this entry: , , , , , , , ,

Deleting specific emails from the postfix mail queue

Posted by Tariq • Thursday, January 8. 2009 • Category: Computers, One liners
A week ago a development database server lost power, which is usually no big deal only that I have some reporting scripts that run every 5 minutes for each database. When these databases became unavailable they (the scripts) like to send me a quick mail telling me what went wrong. The network switch also was out of action so there was no route to the outside world from this small development network. The server lost power for three days and a massive amount of mail built up in the mail queue. When power was restored the SPAM started pouring in.

Continue reading "Deleting specific emails from the postfix mail queue"

Defined tags for this entry: , , , , , , ,

All configuration variables in Moodle code?

Posted by Tariq • Monday, December 15. 2008 • Category: Moodle, One liners
Sometimes Moodle introduces some nice new configuration variables and I like to make sure that I know what they are and where they are. So to begin my investigation without heading off to the web I use the following command to get me a sorted list of the $CFG variables.

Continue reading "All configuration variables in Moodle code?"

Defined tags for this entry: , , , , , , ,

Creating an HTML file with white space traces

Posted by Tariq • Tuesday, December 9. 2008 • Category: One liners
Once upon a time I was comparing some Java files. Now one way to find plagiarism among students who share program code is to look at the white space traces in a file. Students typically try and edit the source code: changing variable names and function names; however, they usually fail to conceal the original author's white space patterns. White space consists of characters which don't appear on screen such as spaces, tabs, and new line characters. Anyway you can catch lots of cheaters by looking at the white space patterns in files ... maybe that's another blog entry, so back to this one.


Continue reading "Creating an HTML file with white space traces"

Defined tags for this entry: , , , ,

Getting logins per day in Moodle

Posted by Tariq • Tuesday, December 2. 2008 • Category: Moodle, One liners
Today I got the urge to see how many logins we had on some of our Apache servers in November. We host more than one moodle site on one server and so I wanted the total number of logins we handled. As usual this ended up becoming an awkward but useful one liner.

Continue reading "Getting logins per day in Moodle"

Defined tags for this entry: , , , , , , ,