Computing HowTo Windows

How to find your mac address / How to get your mac address into a variable using a batch file or the command line in Windows XP

In a batch file :

for /f “tokens=3 delims=,” %%a in (‘”getmac /v /fo csv | findstr Local”‘) do set mac=%%a

Value of mac address is now accessible in %mac%

From the normal command line:

for /f “tokens=3 delims=,” %a in (‘”getmac /v /fo csv | findstr Local”‘) do set mac=%a

Value of mac address is now accessible in %mac%

Note the single ‘%’ when used from the command line instead of double ‘%’ when used in a batch file as above. the getmac utility ships with windows XP so the above script should be good to go. I’ve tried and can confirm this works on XP SP3.

The above scripts are modified from here.

Computing HowTo Linux Ubuntu

How to convert .MTS files to .AVI in Ubuntu using ffmpeg

Just a quick post. If you want to bulk convert .MTS files (from JVC or Sony HD camcorders) then you can use the below script:

You’ll need csh and ffmpeg installed:

sudo apt-get install csh ffmpeg

Make a new file called convert (I use joe but you can use nano or whatever you prefer)

joe convert

Copy and paste the below:

# For NTSC change -fps 50 tp -fps 60000/1001 below
foreach f ($*)
ffmpeg -i $f -threads 4 -deinterlace -f avi  -r 25 -vcodec libxvid -vtag XVID  -s 1920×1080  -aspect 16:9 -maxrate 1800k -b 1500k -qmin 3 -qmax 5 -bufsize 4096 -mbd 2 -bf 2 -flags +4mv -trellis -aic -cmp 2 -subcmp 2 -g 300 -acodec libmp3lame -ar 48000 -ab 128k -ac 2 -o ${f:r}.avi
Make the file executable:
chmod +x convert
Convert your .MTS files:
./convert *.MTS
CAP Work


I’m in the throws of writing a little two part application for work that allows users to see what computers are avaiable for work and allows us, the administrators to see who is and more importantly who was logged on when and where.

The technical details of proposed implementation can be found here.

The client will be written in Java and the server (display) in php.