The Cranky Sysadmin A world of technology, fun, and ignorant rants.

December 8, 2017

Rust for Microcontrollers

Filed under: Arduino,Programming — Cranky Sysadmin @ 2:06 pm

When I started looking at Rust, I liked the fact that it claims to be a memory safe language with no garbage collector. I thought this would be great for microcontrollers. Sadly, at that time there weren’t any microcontroller targets easily available. Things seem to have changed a lot. I’m aware of 3 microcontroller targets available for rust:

  • AVR-Rust which is a functional but early port of rust for Atmel AVR controllers. I’ve been working on some basic examples similar to the basic arduino demos.
  • Rust for Arm Cortex-M microcontrollers. The most polished process is documented here.
  • There is also a crate and some language support for MSP430. There is an issue to track problems with the port.

I’m neither a rust expert, not a microcontroller expert, so I’ve spent a lot of time catching up. Most of my effort has been put toward understanding the AVR-Rust system. It has been fun but I haven’t produced anything noteworthy yet.

October 19, 2015

What is this nodejs Thing You Speak of?

Filed under: Programming — Cranky Sysadmin @ 7:19 am

A very long time ago, I was interested in exposing javascript via apache in much the same way as mod_perl does. I got a working demo running based on (now dead) mod_snake code and the mozilla spidermonkey javascript engine. I abandoned the project due to other interests, but I still like the idea of serverside javascript. Now there is nodejs, which is a javascript engine based on the v8 engine. It has a reasonably complete standard library, and a nice package manager called npm. There is even a (old outdated) mod_node if you really want to hook it into apache. Node looks like it’s architected well and has good performance. If I were to judge a book by its cover I’d say node is worth learning and using.

April 24, 2015

Xubuntu 15.04 Emacs and Python Data Science Setup in Virtualenv

Filed under: Programming,System Administration — Cranky Sysadmin @ 1:20 pm

If you understand the title and want to see the instructions, see after the fold.

emacs and ipython and virtualenv oh my!

January 26, 2015

Rust and Project Euler

Filed under: Programming — Cranky Sysadmin @ 8:54 pm

I stumbled across a neat language called Rust recently.  What makes it interesting to me is that it’s billed as a replacement for C that is type safe and memory safe without a garbage collector. Rust has been ported to Arm Cortex M4 and the lack of mandatory garbage collector means that it should run well on constrained systems. Apparently it also has a good concurrency model, but I don’t know much about that yet. I also recently discovered Project Euler, which is a bunch of curated math problems. Well, now I’ve started solving the Project Euler problems in rust. If you’re interested, you can find the few problems that I’ve solved so far on github. They’re probably not ideal solutions since I’m not an expert at math, rust, or efficient algorithms, but one has to start somewhere.

June 20, 2014

Typing Faster

Filed under: Life,Programming — Cranky Sysadmin @ 7:13 pm

One of my side goals is to increase my typing speed. I do touch type, but I have some bad habits, and I was only typing at about 25 to 30 words a minute. I’ve tried many typing programs both online and installed locally. I’ve narrowed down to my two favorites; GNU Typist (gtypist) and Amphetype. Both of these are command line programs which work well on linux. They also run on windows according to the descriptions. gtypist includes full lessons all the way from home row beginner to speed drills with a fair amount of mixed text. Amphetype (which is becoming my favorite) is all speed drills using text you import. I imported the text to The Hobbit and I’ve been having a blast. Gtypist is very polished, but once you’ve been through the speed drills a couple of times, it starts getting repetitive. Because I can import a whole novel into Amphetype, it doesn’t get boring for me. I’m now up to about 45 words per minute, which was my goal, but I think I can push that goal up to 55 WPM now.

update 2014-07-12: I’ve managed to average 55 wpm, but I struggle to get consistently faster than that. It might be time to move on to other minor obsessions.

June 10, 2014

Learning Algorithms

Filed under: Programming — Cranky Sysadmin @ 6:35 pm

Some day, I would like to be a real programmer. One of the steps that seems necessary is to get a deeper understanding of algorithms. I’ve settled on two books that I’d like to get through on the way to that goal.

  • The first is The Algorithm Design Manual by Steve S. Skiena. It uses pseudo-code and C (or C++) to describe the algorithms. Some higher math is needed, or at least the ability to decipher summations in Sigma notation. I’ve read up to chapter 3, and I like the book a lot even though it makes my head hurt.
  • The second book is Python Algorithms by Magnus Lie Hetland. As the title suggests, the algorithms are described in Python. I’ve gotten through chapter 2. This book is dense too.

If I don’t understand something in one book, I try to find a similar example in the other book. The explanations are different enough that I can usually (so far) understand one or the other.

May 2, 2014

When XFCE and emacs colide

Filed under: Programming,System Administration — Cranky Sysadmin @ 7:49 pm

Xubuntu 14.04 has decided to abscond with a couple of keys that I use for emacs, and I want them back! The first key is C-space, which emacs uses for setting a mark. I use this all the time and I’m not willing to do without it. It turns out that there is this feature called IBus which steals the key and uses it to switch input methods (for entering foreign characters I’ve read). To change this behavior, right-click on the ibus panel applet, and select preferences. You’ll see “Next input method” and it’s bound to C-space by default. you can use the intuitive “…” button to change this. I changed it to FN-space (called “Launc6” on my keyboard). Next up is the capslock key, which I rarely use except in shell scripts. I’d like to bind it to the ctl key. Since I haven’t decided whether I want to do this permanently, I wrote a script to give me some options.


case "$1" in
	CMDNAME=`basename $0`
	echo "Usage:"
	echo "$CMDNAME [caps|nocaps|swapcaps]"
	echo "----------------------"
	echo "$CMDNAME will adjust the mapping of your left ctl and capslock keys."
	echo "an argument 'swapcaps' swaps the two keys"
	echo "'nocaps' changes the capslock to a ctl and leaves the left ctl as-is"
	echo "'caps' returns the keys to the original settings"
	exit 1

/usr/bin/setxkbmap -option '' -option "ctrl:$1"

Run it with no arguments to get some help. I currently prefer nocaps.

April 26, 2014

my .emacs for rails development

Filed under: Programming — Cranky Sysadmin @ 8:12 pm

My .emacs is below the fold. I use emacs a lot, but I’ve not done much customization until I needed to work with rails.

(update 2014-05-02)
dotemacs linked now since I update it frequently.

(update 2014-05-20)
I’ve finally gotten on the github train. Find my emacs init file there.

April 25, 2014

rails development with emacs

Filed under: Programming — Cranky Sysadmin @ 7:07 pm

Just some quick links. I want to use emacs for my rails development and these sites are helping:

I’ve settled on a projectile-rails, flymake-ruby, robe based setup. The  second link at is closest to my current setup.

September 15, 2013

Learn by Doing

Filed under: Programming — Cranky Sysadmin @ 10:12 am

I’ve always been a fan of learn by doing. I think that’s what homework is supposed to be for. There are two problems with homework though. First, the exercises always seemed like pointless repetition to me. The second problem (which may actually be the whole problem) is that the feedback loop is really slow. You take the lesson, do the homework overnight, hand it in and get feedback the day after that. Maybe the reason it seemed like pointless repetition to me was that it was hard to connect the lesson to the results of my homework. There are other problems with the education. One problem is how concepts are explained, but I’ll let Kalid at rail about those. Read below the fold for more on fast feedback courses.
rage against slow feedback!

Older Posts »

Powered by WordPress