More powershell fun

February 3rd, 2012

A little poweshell script for finding the largest files on a drive, fire it off from the root. It’ll list the top 5 files, but can be easily changed by changing the 4 highlighted in the for loop.

$files = @();
$files = Get-ChildItem . -rec | Sort-Object Length -descending; for($i =0; $i -le 4;$i++) { echo $files[$i].Fullname; echo ("{0:N2} GB" -f ($files[$i].Length / 1GB)); }

FFMpeg tricks

January 8th, 2012

Lets start off the topic by explaining some easy ways to getting media converted. I’ve been using ffmpeg to convert some WMV, FLV and AVI files into the same format (different containers and codecs means I had to use different players).

Now there are many end results here, so tweaking this the way you want. Start off by getting ffmpeg if you haven’t got it install already, it can be downloaded from http://ffmpeg.org/ (Windows and *nix). Ubuntu users can get it from “apt-get install ffmpeg”.

I’ve chosen MP4 as my default format, it works well with all the players I’m using, but this might different from person to person. To convert a file into MP4 simply do:

ffmpeg -i inputfile.ext -sameq outputfile.mp4

The trick here is ffmpeg figures out what codec you want based on the output file’s extension.

For converting multiple files at the same time, here’s little linux snippet:

for i in *.flv; do ffmpeg -i “$i” -sameq “$i.mp4”; done

And the windows version:

for %i in (*.flv); do ffmpeg -i “%i” -sameq “%i.mp4”

This will sadly result in the files ending up being named inputfilename.flv.mp4, but we can fix that!

Linux:  rename ‘s/\.flv//’ *.flv.mp4
Windows: gci *.flv.mp4|%{rename-item $_.fullname -newnam
e $_.fullname.Replace(“.flv.mp4”, “.mp4”)}
(Yes, that’s a Poweshell version,  DOS prompt suggestions are welcome in the comments :)).

Procat posting?

February 9th, 2006

Don’t believe it everything you read…

I’ve updated WP to version 2, not sure if it makes much of a difference as far as I can see, lots of work done to the posting part thou, should be easier to make posts….

Speaking about updating….

January 2nd, 2006

First of all, Happy new year everyone!
I’ve started my new (temporary, for the time being) job today, it went well, lot’s of new stuff to read up on.

Spam

October 9th, 2005

It’s seems the new installation of WordPress is more resistance to spam then the old one, that or spammers simple have stop targetting the domain….

Purging

September 26th, 2005

I’ve nuked just about everything on the procat.dk domain, it was about time, the purge included this little blog too. I had different reasons for killing everything, some was leftover from my last school projects, others were temporary projects that had long ago been abanonded, this blog was filled with bugs (I use to update it from night builds).

Anyhow it was due for a new fresh start, who knows, maybe now I’ll update it more often again 🙂