thefekete.net

$> :(){ :|:& };:

Bash script to rename gEDA PCB gerber files to BatchPCB format

Just wrote a quick bash script to rename PCB gerber exported files to the BatchPCB naming rules.

It expects a list of files as arguments. PCB exports files with a ‘grb’ extension so the following should work just fine:

#!/bin/bash
$> gpcb2batchpcb *.grb

Read the rest of this entry »

Pseudo git diff with gEDA gschem in bash

Not really a diff, but you can switch between two (or more) schematics from different commits and see what changed. Here’s how…

The ingredients

First of all, you can open multiple files with gschem by listing them after the command:

#!/bin/bash
gschem FILE1 FILE2 ...

… and you can retrieve old versions of files with git-show:

#!/bin/bash
git show HEAD^:SOME_FILE
git show ab05831:SOME_FILE

For more info on how to specify a file, see the git-show man page.

Putting it together

Unfortunately, you can’t pipe schematics to gschem’s stdin (that I know of). Even if you could, we want to compare two schematics, so how would you pipe two files to stdin? It all seemed pretty tough to me until I found a post on stack overflow showing exactly how to handle it… Using process substitution, it becomes an easy problem:

#!/bin/bash
# See the last committed and current versions of a file
gschem <(git show HEAD:SOME_FILE) SOME_FILE
# See any two files in history
gschem <(git show OBJECT) <(git show OBJECT)

Two Simple Guitar Amps

Was messing around the last couple of days with my guitar, and got a little too close to the electronics bench…

I ended up with the following small amp circuits (I say small, but these things are louder than shit through a 1×12 cabinet):

Single LM386 1/2W Amp

Dual LM386 1W Amp

Here’s a pic of the bridged circuit on the breadboard:
Breadboarded Bridged LM386 Amp

Anyways, waiting for some JFETs in the mail so I can wire up some proper preamps.

These closely follow the the example circuits in the datasheet, but many thanks to runoffgroove.com for the great examples – particularly the little gem designs.

Transistor / MOSFET Cheat Sheet

Here’s a little cheat sheet to keep your Bases/Collectors/Emitters and Gates/Drains/Sources straight:

Transistor / MOSFET Cheat Sheet

Thanks to wikipedia’s transistor article for the graphics.

Arduino Library for LM75 Temp Sensor

I just put together a quick and dirty library for the LM75 I2C temp sensor. You can theck it out on my GitHub project page.