Lietu's homepage

Lietu's tech blog

Yet another techie blog by Janne Enberg, aka. Lietu

GRWU - Gnome RSS Wallpaper Updater

UPDATE: Project in GitHub Because I wanted to make some updates to this tool, I found it more convenient to move the project to GitHub. Here's the link: https://github.com/lietu/grwu/ Further updates will happen there, and only there. What is this? I was using the NASA image of the day RSS feed to dynamically update the wallpaper on my Windows desktops and realized I wasn't doing that on my linux desktops (which are running Gnome 3). I checked quickly and it looked like there were no existing tools for...

Bookmarklets (Cookie Clicker)

Cookie Clicker Hack This bookmarklet will make cookie clicker show the prices for items as “price per cookies per second”, so which one is the most cost-efficient purchase will be easy to see. Cookie Clicker Hack Drag & Drop that on your bookmarks bar, go to Cookie Clicker and click on it. What are bookmarklets? Bookmarklets are basically snippets of JavaScript code stored in a bookmark. When the bookmark is activated, the JavaScript code is run on the page you are currently on. These bookmarkl...

Python code quality monitoring - pyquality

What is this? Python has excellent coding standards that everyone should follow (PEP-8) and excellent tool to check for standards-compliancy (pep8). There's also a good tool for checking various errors (e.g. unused imports) called pyflakes. Running these tools manually can easily become too much of a chore, and mass running them after doing a bunch of changes can end up with a lot of issues to be fixed at once making it a chore to fix all the little issues. To make following PEP-8 and keeping the code cl...

BASH playlist management for your Raspberry Pi

Introduction I just recently got a Raspberry Pi, which is a decent piece of hardware, but the fact that it can't really do video playback using any other player than omxplayer left me annoyed. Omxplayer isn't a very nice player, most annoyingly it's missing playlist functionality. To make the Raspberry Pi a bit more useful for me, I decided to make my own playlist manager around omxplayer, and this is it. What to do Set up a local bin folder (optional but recommended) Why would you want to do this? Be...

GOG.com dosbox releases to Linux desktop

What is this? GOG.com is an online store that, among other things, sells a lot of old PC games that are distributed for use with Dosbox. The games come with a Windows (sometimes also Mac) installer, but nothing for Linux. Getting these games to run on Linux sometimes takes a bit more effort, if they're not designed to be run with Dosbox, but when they are it should not be very difficult to get them running. This is what this page is about. GOG 2 Linux To make it simpler for me to set up those dosbox pow...

Nginx reverse proxy cache for multiple sites

Introduction If you are hosting a site or multiple sites where performance is more important than that updates are immediately visible, or that the architecture is especially "cool", you might want to think of running Nginx as a reverse proxying cache server. What this approach provides is easily configurable lightning fast serving of your content. What you will need Nginx installed on a server (I'm sure you can find another guide for this) Write access to Nginx configuration directory Main web ...

Quick Web performance test script

Preface I was interested in testing out my new homepage server's performance in rather simple terms. I thought bombarding a single URL with Apache Benchmark would distort the results too much, and I also didn't want to load the resources outside my control (e.g. Google Analytics). I made a simple BASH script that loops indefinitely and does a wget call that fetches all the resources and links on my homepage recursively and displays the time it took to do that for each iteration. Code This simple shell sc...

Get interface addresses in a scriptable format in Linux

Preface I noticed it's annoyingly difficult to get the IP addresses assigned to your network interfaces for scripting purposes. I ended up writing the fairly simple one-liner below that lists all IPv4 addresses (change -4 to -6 for IPv6) in the format "interface-address", e.g. "eth0-192.168.1.1". It also ignores the loopback address since that's generally quite irrelevant. I personally used this to check which interfaces a certain program was communicating over and send me alerts if it uses the wrong int...

Quick Web performance test script

Preface I was interested in testing out my new homepage server's performance in rather simple terms. I thought bombarding a single URL with Apache Benchmark would distort the results too much, and I also didn't want to load the resources outside my control (e.g. Google Analytics). I made a simple BASH script that loops indefinitely and does a wget call that fetches all the resources and links on my homepage recursively and displays the time it took to do that for each iteration. Code This simple shell sc...

Jekyll

Jekyll is a tool that can be used to build static HTML websites using a HTML template engine etc., however it's not perfect by itself, and the documentation for the plugins is rather crappy at times. Unfortunately, you will need to install ruby (including -devel packages) and do whatever you need to do to get RubyGems installer. More about Jekyll: http://jekyllrb.com/ Jekyll Asset Pipeline Definitely worth installing is jekyll-asset-pipeline, it makes sure your CSS and JS files are combined and compress...

Linux and sleep mode wakeup

I just recently battled a long time to get my Windows machine to sleep properly. That is, to automatically go to sleep mode after a timeout, not wake up from sleep mode from useless events like keyboard and mouse, and recover from sleep mode successfully. In Linux, pretty much everything worked out of the box, even with exotic-ish hardware (Apple Mac Mini), except for not waking up from useless events. Preventing automatic wakeup from useless events So I had the issue that my Linux desktop was waking up...

Windows and sleep mode

Getting Windows to play nicely with sleep mode I just recently decided to get my main desktop to finally work with sleep mode properly. It has never worked in the past (the heart of the machine, mobo & cpu, are a couple years old), but now I felt like I want to do something about it. As a quick reference, here are the key details of the machine: OS: Windows 7 Professional CPU: Intel Core i7 920, overclocked RAM: 6GB triple channeled 1600MHz DDR3, OCZ Motherboard: Asus Rampage II Extreme (X...

VMware ESXi + FreeNAS, NFS vs. iSCSI performance

Initial information I have a FreeNAS box that I use to provide disk space to my VMware ESXi box that has no disks other than the USB stick it boots from. The FreeNAS machine's specifications: Intel Celeron E3300 @ 2.50GHz Gigabyte GA-EG41MF-US2H Intel G41 LGA775 microATX motherboard Corsair Value Select 4GB (2x2048MB) 667MHz DDR2 RAM 3x 3TB Seagate Barracuda 3 TB 64 MB 7200 RPM 3.5" SATA III The VMware ESXi machine's specifications: Intel Core 2 Quad Q9400 @ 2.66GHz Intel DG45ID LG...

Simple Linux/BSD service monitoring script

Here's a simple script to monitor the status of a service via a normal control script such as /etc/init.d/varnishd as commonly found under Linux and BSD based systems .. it should be super simple to modify for most other types of systems, such as systemctl. Just configure, place somewhere on the server, and set a crontab line to run it every now and then. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46#!/usr/bin/env bash ...

Installing Mageia 2 (or most Linux systems) on Mac Mini 4.1 (mid 2010 edition) (and probably other Macs too)

It took me quite a while to get a well working linux dualboot on my Mac Mini (version 4.1, the mid 2010 edition), and wanted to make it easier for others. Most of this should apply to other distributions of Linux, as well as other Intel-based Mac machines. The instructions are a bit rough (didn't plan on this, but turned out to be difficult enough to warrant writing this), but this is roughly how it goes: In Mac OS X, use Boot Camp Assistant to divide your disk space between what you want for Mac OS X...

Creating an Ubuntu Server virtual machine with Node.js

Preparation You will need the following tools to complete this process: Virtual Machine Hypervisor, such as VMware Player SSH client, such as Nutty Ubuntu Server disc image This guide is aimed for Windows users, the rest can probably figure out the parts that have only been described for Windows. These steps are likely to change a little when new versions of VMware Player and Ubuntu Server are released, however generally the default settings are sane and you can just use them when in doubt. ...