Skip to content

Posts from the ‘Code’ Category

29
Mar

vNES for J2ME on your mobile

If you have ever wanted to play a NES game on your mobile, then you might have heard about vNES. There is a J2ME version which allows it to run on most mobiles available today.

There are however a few rough edges to this application as it requires assembling the necessary files together and running a windows batch file. From a Linux point of view, I have created a replacement shell script that does a better job. It requires unix2dos, rename, and bash.
Read moreRead more

30
Sep

Batch file and directory rename

I needed a quick way to go through a directory and rename some files and directories to remove a specific bit from the name. By using bash’s parameter expansion feature we can accomplish that in just a few lines.


#!/bin/bash
for i in *something* ; do
echo ${i/-*[something]}
mv $i ${i/-*[something]}
done

This takes all files and directories with something somewhere in their name, and strips it out.