utool for android: run a script once you insert a flash.

Looks like I’ve been kind of productive these days, making the third app this week. This time it’s a very weird one.
It is a small android app that allows you to run a custom script, once a device with a special markerfile in its root dir is mounted by the system.
That’s it. Too bad we don’t have anything similar to udev here, otherwise we’d only need to write one rule.
Create the script file with whatever you want to, place it somewhere in the device, create an .IOMARKER file in the root of the flash jump drive, or microsd (or change the filename in settings), fill in the path to the script, pick if you want to run as root.
Done.


(more…)

Another android app: FixNet

Okay. Android is not a perfect platform, but so far the best for me. Anyway, quite a few thingies are shitty. one is how dhcp hostname is handled. The default dhcp hostname is ‘android_’ + a huge device id. Not a big pain if you have a static mac address, and can therefore assign a readable hostname for the device on the home net.
However that was not the case for wired ethernet on my flytouch2 tablet that I’m turning into a standalone terminal. Due to teh fact that whoever made this was retarted enough the device was getting a random mac everytime it booted.
Just awesome. Just a nice anon’s tablet…
Anyway, I needed a way to fix that. The fast way was repack the ramdisk image and add some stuff to init.rc. I could fix the mac there, but still no way to fix the hostname, since it is set by java code after the init.rc.

(more…)

NetTTS 0.2 released!

Finally found a little bit of time, and here we go. NetTTS 0.2 release with most bugs I knew of fixed, maybe some new added.
For those who aren’t familiar – NetTTS is my app for android that allows you to use android’s TTS engines remotely with primitive tools like netcat or telnet around.
(more…)

lighttpd + mod_proxy trick on OpenWRT

Okay, looks like I’m somewhat back after a (very) nasty crash of an raid mirror. Looks like 1Tb WD + 1Tb seagate decided to die together at (nearly) the same time after roughly 19000 hours of operation (according to smart). Luckily smartd detected all those reallocates and ‘runtime bad blocks’ at the very time they appeared, giving me time to order the replacements. However, I decided to completely reconfig the server, so I got quite a few days of downtime. But hey, I’m not google, so who cares?. And 5-year old apache2 config with over 1k lines, that had a chance to work under FreeBSD, Debian, Agilia was just looking to ugly. Even I couldn’t make sense of some older parts of it.
Anyways, I also upgraded the router, now stuffed with OpenWRT+lighttpd to do the dirty work, and I want to quickly describe a small trick I used.
Basically I wanted luci to be avaliable on a subdomain, e.g. router.myhost.net, while all queries to hyhost.net, anythingelse.myhost.net would get forwarded to a http server behind the network.
To do so, you’ll need mod_proxy for your lighty, and something like that. In this fashion, everything not directed to wrt.myhost.net will get to a server behind the router.

$HTTP["host"] != "wrt.myhost.net" {
 proxy.server = ( "" =>
   (( 
   "host" => "192.168.0.7", #web server ip in the lan
   "port" => 80
   ))
 )  
}

xEMACS: A bunch of useful tricks.

Vi is somewhat cool, kate looks even better in places, but none of them had anything nearly as useful, as verilog-mode in emacs. Therefore, I decided to make the switch.
However, making yourself somewhat confortable in emacs requires a bit of effort, so here go my adjustments.
First, let’s get out emacs instances at different places in sync. Git is a very good tool for that. Therefore, I put my custom el scripts in ~/.emacs.d and made that a git repo with origin at my github account. Next step is to tune ~/.emacs to automagically load ~/.emacs.d/autoexec.el via adding

(load-file "~/emacs.d/autoexec.el")

Rest – under the cut.
(more…)

Accelerating eeschema symbol generation (code inside)

If you have ever used kicad, you’ve had a moment where there isn’t a ready-made symbol for your IC. It’s quick to make one with that  web tool but what what if the chip is over 100 pins?

I used to use a very dirty hack with bash and xdotool, but the amount of hackery here was a bit too big, so I decided to make a better solution. Lots of thanks fly out to the guys, who made xil2kc, a tool that creates eeschema symbols out of .pkg files that ISE can create. Unfortunately for me they picke python, my least favourite programming language. Anyway, the code was there, so I made a different util based on their library. I thought all the things over and came with a format that can be easily used.
(more…)

pktcdvd and backups

Some time ago an HDD I had quite a while died. The worst part is, that it contained the backups. It worked for about two years in a fashion where it gets powered once in a while via a mosfet, receives a payload of backups and then goes offline again. Analyzing the corpse it looks like it was the spindel motor. Well done, WD!
This made me thing of another way to store critical backups. Consider me paranoid, but I do not trust cloud services.  Then I saw an old cdrw disk wasting its remaining life as a stand for the coffee cup.

(more…)

Use a POST card from userspace

Okay. This time my small server got screwed up. Totally. segfaults at no apparent reason, lags, and finally the PC not starting at all. Since ssh was down, I had to debug using a UART and a POST card (No monitor in the closet where it stands usually). In the end I had to take the small thing out of its place to the table. A detailed analysis showed up that it was the RAM. Luckily I had a spare 2 GiB chip around and popped it in. However, while troubleshooting it, I hooked the POST card…
The last thing gave me an idea. Not sure if that was done before.
(more…)