Git Checker Script

I often have the problem that I forget to commit changes I do in my git repositories. Further, working on more than one PC, I have the much bigger issue that I forget to push my commits to my remote. To solve this problem, I wrote a script which looks into my local git repositories and tells me if there is some modified file or some unpushed commit.

A configuration file stored in my home directory lists all the git repositories and the relevant branches I want to monitor. The script performs three checks:
1) With a git ls-files -m the modified files are located
2) With a git ls-files --others --exclude-standard the untracked files are detected
3) Finally, a git log origin/branch..branch checks if there is an unpushed commit

The source code can be found here.

I'm planning on adding a simple icon in the statusbar to indicate the status of the git projects. I'll keep you updated.

Filed under: git

Im currently developing a circuit using KiCad. I'm trying to prepare my PCB for production and I'm facing the classic problem of library management of PCB design tools. Should I have a general component and add the Manufacturers Part Name and Footprint afterwards for every component? Or have a component for every value and footprint in my library? I opted for the second one. It might seem a little tedious but I guess the initial work will pay off.

I could add a component manually every time I need a new one or generate the whole library with a script, guess what I've decided...
The basic idea is to have a template resistor and add it to the library with its properties: Value, Manufacturer Part Name, footprint and Description.
I'm not yet 100% sure what the value of the resistor should be: r_0603_1k? 1k_0603? I will see what the best option is after using it for a while, the cool thing of having a script it that it can be easily changed later 😉

Library Format

How does the KiCad library look like? Details can be found here. I'm not going to read the description, I opened a  normally created library containing two resistors to see what repeats.

Manufacturer Part Name Format

For my standard resistors I decided to use the D11/CRCW0603 E24 series from Vishay. The Manufacturer Part Name format is as follows:
MODEL+VALUE+TOLERANCE+TCR+PACKAGING =
CRCW0603+VALUE+FKEA.

The VALUE is has 4 positions, allowing the following multiplier: R (x1), K (x1'000) and M (x1'000'000).
A 1K Ohm resistor has the VALUE 1K00, the unused values are padded with zeros.

Script

I then wrote a script to generate the Manufacturer Part Name based on the E24 resistors between 1 Ohm and 10 MegaOhm.

The code can be found here. Some settings like your preferred footprint and output location have to be adapted in generateResistorLibrary.py to optimally work for you. Afterwards you can execute the script and smile

$\LaTeX$ plots from CSV files with pgfplots

$\LaTeX$ plots from CSV files with pgfplots">

First of all we need a CSV file. I have one in which the third column (beginning to count at 0) contains time values and the fourth one contains some time dependent data. Then we need to make sure that the packages pgfplotstable and pgfplots are installed. The former is needed to read CSV files and the latter to generate the nice plots.

At some point in our code we can then insert the following code:

Charging capacitor curve fitting in matlab

How to get the time constant and the amplitude of a charging capacitor?

In this example I'll show you how to estimate the two parameters in matlab.

We know that the curve follows an exponential function:

The first thing we do, is to generate a data set:

we add some noise to the signal in order to make it more realistic. Usually you would get the data from your scope in a csv file format an import it.

The second thing we do, is to call the fitting function. As parameter we give the curve function.

We see that matlab fitted our function very nicely. In fit1.a amd fit1.b we can see the fitted values, which correspond to our given amplitude and charging constant.

But what if our recording does not start with an empty capacitor? We simply shift our time values  with an additional parameter c:

ZHAW add a printer on Ubuntu

1. Log in to smb://panther.zhaw.ch via nautilus (ctrl + L) and save your credentials forever (I think this is needed in order to be able to access to the printer, set the Domain to ZHAW)
2. In System Settings -> Printers add a new printer
3. From "Network Printer" select "Windows Printer via SAMBA"
4. Add the URL of your printer smb://zhaw/panther/pr-bw-XXYYY-Z and do not set the authentication
5. Click "Forward" and select "Provide PPD file" if you have the PPD file or select a printer from the database if it is available

Tested under Ubuntu 14.04 64bit

Blaue Cumulus Bons selber ausdrucken

Verlorene Cumulus Bons selber ausdrucken:

1. Sich auf der Cumulus Plattform einloggen
2. Unter "Blaue Cumulus-Bons" die Nummer des Bons kopieren
3. Auf dieser Webseite die Nummer des Bons ins "Data" Feld einfügen
4. Bei Barcode den Typ "Code-2of-5 Interleaved" auswählen
5. DPI auf 300 erhöhen (sicherheitshalber)
6. Barcode generieren lassen und herunterladen
7. Ausdrucken auf zirka 4 cm Länge

Pomodoro Timer PCB

Yey!
the PCB has arrived
I wrote a little timer software and it seems to work. It's a little bit a messy code, I think I'll rewrite someday when I'll have some spare time (using my little MSP430 OS I've written some time ago).

I noticed that with my choice of LED + Resistors, the emitted light is a little bit too dark to be noticed when being focused on something else (maybe that's a feature my subconscious made me implement ^^).
The software + hardware are stored on my github github.
The code needs some file from my repository msp-lib.