I’ve decided to give Wakatime a second try. It’s a tool that tracks the time you spend programming on different projects by integrating into your IDE. This works well for typical development work where you open your IDE in the morning and type code in it, do commits with it, and everything else related to the project and Wakatime will track that.
I don’t work like that though, so I had two issues with it last time, both resulting in a lower reported time spent working:
- I spent most of the day working on different remote servers and it would be a hassle to set it up in the text editor on each of them and it would undoubtedly cause slowdown on the older servers
- I use the command line tools as my IDE, so the time recorded opening the text editor to make some changes is not representative of the time spent working
This time it’s different because nowadays I virtualise most of the services I work with, using Docker on my local machine, and I’m hoping that using the Wakatime Z Shell integration will give a better record of time spent working on a project.
Installing the Wakatime zsh plugin is as easy downloading the script and sourcing it in your
.zshrc file. The only issue is it depends on the Wakatime CLI, which is usually bundled with Wakatime integrations, just not this one. The README file instructs you to get the CLI with
sudo pip install wakatime but that leads to a system that’s difficult to maintain: Ideally you’d like to be able to install it from your distribution’s package manager but there’s no official ArchLinux Wakatime package and nobody has written a package script for it in the AUR yet. Luckily it turns out to be pretty easy to do.
The CLI is Python based and available for download on pypi (what pip does when you
pip install). There are clear instructions on the ArchLinux wiki on how to make a Python package with the distutils tool that comes with Python, and a prototype Python package script you can use as a starting point.
All I had to do was fill out the fields in the example package: The download URL, version number and md5 hash are found in the pipy page. The licence, website, description and everything else is on the GitHub page. The result looks like this:
# Maintainer: Siôn le Roux <firstname.lastname@example.org>
pkgdesc="Command line interface used by all WakaTime text editor plugins"
python setup.py install --root="$pkgdir/" --optimize=1
# vim:set ts=2 sw=2 et:
After installing the package built from this script, everything works as expected, so I’ve published it to AUR as
wakatime. If I’ve made any mistakes packaging this, please report them as issues on the package script’s GitHub repository or leave a comment on its AUR page.
The Hungarian coat of arms features an iconic cross with two horizontal beams. In Hungarian it’s called “Kettős Kereszt” which translates to “Double Cross”, usually called the Patriarchal cross in English. This cross is present on other emblems around the area of Central and Eastern Europe too and has been featured on the Hungarian coat of arms at least since the reign of King Saint Stephen of Hungary.
3D model of the patriarchal cross as shown on the Hungarian coat of arms
Seeing as it’s a Hungarian national holiday today, in memory of the heroes and martyrs of the Hungarian revolution of 1956, everyone has their Hungarian flags out. I decided to do something Hungarian too, while trying out some tools for preparing models for 3D printing. So far I’ve been using Blender, because I have some experience with it, but it’s for creating 3D scenes and although you can use it to design 3D models for printing, it’s not CAD software. This time I tried Autodesk’s web-based program Tinkercad, which although lacking many of the features you’d get in a full-blown CAD program, is plenty enough for me to design simple things like this. Not being a mechanical engineer, I probably wouldn’t even know what features I’m missing!
3D printed “Kettős Kereszt” painted in the colours of the Hungarian flag
The program is very intuitive to use. I put a few cubes on the workplane, stretched them out into intersecting rectangular boxes and exported an STL file for printing within minutes. You can see a screenshot of the result above. I also made a version with a hole cut out of the top so you could hang it on a key chain. That turned out to be as easy as putting a cylinder in one of the boxes, stretching it out of the top and bottom box faces and marking it as a “hole” in the model.
After scaling the model down to 30% so it fits on my print bed, the final print came out as shown in this photo. It took less than 10 minutes to print at 30% in-fill and seems pretty rigid. I’ve painted on the red, white and green of the Hungarian flag and will hang this up somewhere, who knows, maybe it’ll even be good for a Christmas decoration. If you’d like to print your own Hungarian cross you can download both of my STL files here:
In honour of the heroes! Tisztelet a hősöknek!
Samsung Galaxy Mini
My wife’s phone (Samsung Galaxy Mini
) doesn’t get system updates any more, so I need to manually move Google’s updates into ROM to make space for regular apps. You need root privileges to do this, so I was following these instructions on the XDA Forum
which almost work fine. You need to download and apply a file
but the problem is the update script inside doesn’t include S5570I in the list of phone models it checks for, so the script aborts.
All you need to do is edit
/META-INF/com/google/android/updater-script inside update.zip and include this phone model in the assertion list, for example, I duplicated lines 15 and 16 and just added an
I to the end:
getprop("ro.product.device") == "GT-S5570" ||
getprop("ro.build.product") == "GT-S5570" ||
getprop("ro.product.device") == "GT-S5570I" ||
getprop("ro.build.product") == "GT-S5570I" ||
Everything works completely fine after that. Obviously this is not a general solution when rooting, you can’t just blindly add your own phone model into any update.zip not knowing what’s in it, but since this was from a post for specifically this model and it already had several very similar models listed, I thought it was worth the risk and it turned out just fine. Woop! 😎
The sparkup plugin for vim lets you write HTML markup faster by Zen Coding, in which you write short code, resembling CSS selectors, which is then expanded to HTML by the editor. For example, writing
would give you:
This is obviously extremely useful, as it saves a lot of typing. However, I encountered a bit of trouble using this plugin on my laptop, which runs on Arch Linux. It’s easily solved though. Continue reading
A tip for any Debian user trying to get PGP to work in Icedove, Debian’s re-branded version of the Thunderbird Mail client: All the tutorials and forums on the internet telling you to install Enigmail from Thunderbird’s Add-on menu won’t work. It’s not there. Enigmail isn’t compatible with your version of Thunderbird, which is… Icedove. The solution is simple but not obvious; Enigmail needs to be installed from the package manager, a simple
aptitude install enigmail
should do the trick! 😉
Recently I did a friend a favour and installed Linux Mint on her laptop as she was a bit frustrated with Windows. Unfortunately I assumed she’d backed up everything before handing it over to me, so I re-partitioned the whole drive to ext4. She hadn’t.
On the bright side the computer was quite new and the only thing she wanted from the disk were some photos she’d taken. Well, that just made it my lucky day because there just happens to be a tool specifically for recovering photos (and a myriad of other filetypes) from disks that have been written over: TestDisk! Continue reading
Sometimes you want to change the name of a USB device, for example because it has no name or because it has a new purpose. I usually give my USB flash drives my own name so that if I lose them, people will know who to return them to.
Modern desktop environments make it easy to rename your device by simply clicking it and selecting ‘rename’ from the context menu. However, sometimes you might want to do this from the command line 8) perhaps because you have no desktop environment, or your desktop environment does not allow you to easily rename your device, or because you feel you could do it faster this way. Continue reading
I originally posted this as a Note in the Linux Namibia Facebook group when I still had a Facebook account but I’ve decided to cross-post it here because not everyone uses Facebook and because I still see people having trouble with this. After a few lessons in XML in my Internet Technology course, I contacted local networks and with the cooperation of network staff, I was able to add a little code so that the recent (10 August 2011) update to the mobile-broadband-provider-info package in Ubuntu adds support for Namibian providers MTC, Leo and Telecom. Namibians often seem to have trouble using their cellphones or dongles to get connected on Linux, and the network staff, being unfamiliar with Linux, usually aren’t much help either. This should solve that.
After my previous post about checking computer specs in Linux somebody asked an interesting question: how do you check your computer’s specifications if you don’t actually have any operating system to check them with?
In my opinion the easiest way to do this would be to download a disk image of a live CD for a lightweight Linux distribution, such as my favourite: ArchLinux. Once you’ve burned it to a disc you can put it in your computer and boot directly from the disc. ArchLinux is light and fast and will allow you to log in as root with command line access, where you will be able to run the commands I talked about in my other post to find your computer specs even for a computer with no OS or in other cases, for example where you don’t have permission to check with the current OS. If you’re not familiar with Linux don’t worry, follow the on-screen instructions and just type the commands I described. When you’re done checking you can turn off the computer and take out the CD and things will be just as they were before.
❗ Note: automated script downloadable at the bottom of this post!
Something you always want to do on a computer, even if only once, is to check its hardware specifications, that is:
- how much RAM do I have?
- how much hard disk space do I have?
- how “fast” is my CPU?
- how much RAM does my graphics card have?
Of course most modern GNU/Linux desktop environments like Ubuntu usually come with some kind of graphical tool to find this information. GNOME’s System Monitor program should provide at least some of what you’re looking for. The information here is more for when you’re staring at a blinking cursor on a black screen trying to remember what the command was to show information about the CPU, RAM or Graphics Card.
This is the third time I’ve had to go on an internet search quest to remind myself how to do this in a Linux terminal. To save myself the trouble in the future, I’m writing down the commands here and if anyone else finds it useful then that’s great, and a second bird is figuratively killed!