Blinky on Arduino UNO with Zig

Let’s give Zig a try on Arduino UNO with microzig

DIY Dependabot for Clojure

preview

Unfortunately, dependabot does not support Clojure. And as such, I came up with a silly idea of putting something similar together using Github Actions.

3D printed foraging cat toy

Here is a foraging cat toy based on design I saw in a youtube video by EvanAndKatelyn.

Scripting with Go on NixOS

This is a short HOWTO based on great idea from this blog post on how to utilize gorun and binfmt_misc to use go files for scripting.

Routing with Go on Google Cloud Functions

Couple of days ago Google cloud functions got official support for go 1.11. I got interested in how to handle routing in cloud functions in go, so after couple of experiments I came up with a solution based on http.ServeMux.

YubiKey as a portable SSH key

This blog post is just a bunch of shell snippets quickly put together that explain how to use YubiKey as your ssh key.

Arch Linux on Lenovo IdeaPad Y700 15"

Collection of tweaks that I gathered after installing Arch Linux on to Lenovo IdeaPAD Y700.

Arch Linux on Macbook Pro 8.2 (17" 2011)

Couple of tips from my experience of running Arch on Macbook 8.2.

Nvim terminal + ClojureScript and figwheel

This is a small post on how to improve your ClojureScript development flow in NeoVim using its terminal feature.

ServerSide rendering of Reagent components

Great thing about React is that you can write what people nowadays call “isomorphic JavaScript”. In this post we will not discuss how wrong this term is in many ways, but instead we will focus on how to achieve similar results in your ClojureScript code using Reagent library.

ln -sf /usr/bin/emacs /usr/bin/vim ?

Some time ago I actually did run ln -sf /usr/bin/emacs /usr/bin/vim. And left it like that for a couple of days. I must say that it was surprisingly nice experience. Tinkering around with elisp, building editing environment from scratch.

Of course interesting question is “How did I end up with this idea in my head?”.

Grench binary for OpenSUSE

Grenchman is a small tool that runs leiningen tasks over nrepl.

Helps with JVM startup time during development. Build in OCaml. If you are not in to the building binary on your own, there are pre-build binaries on the official website.

And here is one missing binary for OpenSUSE (tested on 13.1, fedora binary does not work).

grench-opensuse [sha1 | sig]

Two way data bindings in Reagent

Small code snippet showing ability to generate 2 way data bindings in Reagent. Underneath it’s all about core.async. Also provides ability to apply transformation using transducers.

Replacing shell scripts with Clojure+JamVM

We all hate shell scripting. Scripts are annoyingly hard to debug, test and verify. Would be lovely, to use some kind of lisp for scripting, right? To do interactive development with repl in your favorite editor. To write it in a nice predictable language that you also enjoy. But sometimes it’s impossible to add some external dependencies to the system. What if you have only JVM to your disposal, will you be able to pull it off only with JVM and clojure.jar?

Building Hacker News json api with Haskell

Small announcement post.

Today I launched tiny scotty server that serves json for Hacker News front page. Project source code is located on github. You can access api here.

Hacker news parser is implemented using HXT and HandsomeSoup. Json is served with help of Scotty web framework. Currently it’s running on Heroku using this ghc-7.8 buildpack.

I don’t use RSS since I’m also interested in points and amount of comments. For me HN is more about interesting links than community and conversations behind the posts. So I don’t really care about anything except front page.

Originally I started this project as a Haskell learning exercise. I hope someone will find it useful.

Installing Spotify Linux beta on OpenSUSE 13.1

Very small post (more like insruction for myself for the future) on how to convert deb packages provided by Spotify to rpm. Solution can be applied to any rpm based system (I think so).

Autoconnect to NetworkManager VPN on systemd based system

Here is small post with instructions how to setup auto connect to VPN. Of course you can probably figure out all this yourself, but what if you are lazy?

HN Tray icon in 50 lines of Clojure

Today I got a little bit bored and spend few hours poking around with java.awt in Clojure. Result is tray app that shows stories from HN front page. Just in ~50 lines of Clojure code. Enjoy!

Github Project.

Source code is below:

Hardware Cut/Copy/Paste with Arduino Leonardo

Since I switched to Programmed Dvorak layout default keybindings for different operations started to annoy me sometimes. I was thinking about hardware cut/copy/paste in apps even before that. But only with Dvorak I realized how useful it can be. I always wondered why there is no hardware support for that on various keyboard that are out there. And then I saw keyboard.io. Project is about hackable ergonomic mechanical keyboards build on top of Teensy/Arduino Micro boards. And I decided to play a little bit with that idea. Lets start with implementing hardware cut/copy/paste using Leonardo and then lets see how far we can push the idea.

VisualRuby gem on OpenSUSE 13.1

visualruby

I found out about ruby gem called visualruby and decided to give it a try. Unfortunately it has a lot of dependencies that were missing on my system. So to save my (or maybe your’s if you are reading this now) time in the future here are required dependencies for OpenSUSE 13.1. I bet you can figure out similar packages for different distribution.

Yin-Yang Call/cc puzzle in Ruby

Digging deeper in to the call/cc land I found interesting puzzle called yin-yang.

Here is Scheme implementation:

(let* ((yin
        ((lambda (cc) (display #\@) cc) (call-with-current-continuation (lambda (c) c))))
       (yang
        ((lambda (cc) (display #\*) cc) (call-with-current-continuation (lambda (c) c)))))
(yin yang))

It will print @*@**@***@****@*****@******@... forever.

OpenSUSE 13.1 + Mate 1.6 + Xmonad

So OpenSUSE 13.1 was released. And it’s great. But… Since gnome 3.9 support for custom window managers was broken. How to restore sanity to your desktop? Mate it! Here is quick how to.

preview

My first experience with core.typed

Today I started improving my feeds2imap.clj project with core.typed. And already hit few issues, so this post is something like collection of tips how to solve issues with core.typed based on my experience. I couldn’t find answers on my issues in wiki or documentation. But I got answers annoying Ambrose Bonnaire-Sergeant on Google+. Thank you for your patience, man! And keep doing what you are doing, core.typed is just amazing thing!

Cheap standing desk

I love idea of standing desks. I feel myself much more productive behind standing desk. But commercial desks suffer from high price and complicated design.

Solution? Build your own standing desk!

Speed/Ping test graphs with Clojure and Raspberry Pi

I’m often complaining about my ISP quality. Sometimes pings are high, sometimes download speed goes down. So I decided to make sure it’s my ISP fault and not just my opinion based on my hate to them.

How to do so? Let’s collect data about download speed and pings over time, and show some graphs based on that data.

RSS/Atom reader in Clojure via IMAP

Motivation

Google Reader was shut down and I started looking for alternatives. And sadly I did not found anything close to Google Reader experience. There are plenty good alternatives, but all of them suffer from some kind of background noise (social based features, weird hotkeys, weird ui, unusable mobile clients and etc.). All I wanted was simple to use news reader.

Quick LXC configuration with netctl nat

So I spend few hours playing with Linux Containers. Pretty interesting stuff. So here is small tutorial on how to create and use container on Arch Linux as host machine.

Clojure on Raspberry Pi: OpenJDK vs Oracle JRE (Java 8 armhf beta) benchmark

Here you can download latest Java 8 preview for armhf. Lets benchmark it on Raspberry Pi!

Building RC Toy with Clojure

Bored and have free time? Lets build something. Lets build RC Toy. Hm, and lets use Clojure (because clojure is pure fun to use).

How I cook Ctags in Vim

Ctags is great piece of software. And it took me some time to realize how I can use ctags with vim in optimal for me way. My solution is petty simle. I have few vim functions that vim runs when buffer write is done.

Blue Midnight Commander color scheme

I spend today few hours reading mc documentation about color scheme configuration. Came up with following color scheme. Enjoy :)

Blue Midnight Commander color scheme

.config/mc/ini:

[Colors]
base_color=lightgray,blue:normal=blue,default:reverse=green,default:gauge=gray,lightgray:selected=white,blue:marked=yellow,default:markselect=yellow,default:directory=brightblue,default:executable=brightgreen,default:link=cyan,default:device=brightmagenta,default:core=red,default:special=lightgray,default:dnormal=lightgray,blue:dfocus=lightgray,black:dhotnormal=yellow,blue:dhotfocus=yellow,black:menunormal=lightgray,blue:menuhot=yellow,blue:menusel=lightgray,black:menuhotsel=yellow,black:menuinactive=lightgray,gray:errors=lightgray,red:errdhotnormal=yellow,red:errdhotfocus=yellow,lightgray:input=lightblue,gray:inputunchanged=blue,gray:inputmark=white,blue:bbarhotkey=white,black:bbarbutton=lightgray,blue:viewbold=lightgray,default:viewunderline=lightblue,default:viewselected=lightgray,grey:helpnormal=lightgray,default:helpitalic=lightblue,default:helpbold=lightgray,default:helplink=green,default:helpslink=lighgreen,defalt:

For more information take look at mc wiki and run mc --help-color to see available color variables in your mc version. Format of color configuration is what=foreground,background:. All configuration shoud be in one line (ofcourse you can write it in multiple lines and then use vim (or other cool editor) magic).

ClojureScript on BeagleBone: simple benchmark with Node.js

Benchmark is based on my previous experiments with BeagleBone and Clojure. Setup is the same. BeagleBone is running Ubuntu 12.04. Cpu is running on 500 Mhz. Node version is 0.6.12. ClojureScript is compiled with advanced and simple optimizations.

Easy HTML5 Validation Fallback for Older Browsers using Modernizr and JQuery Validation Plugin

So I heard that you hate IE. Also I heard that you love HTML5. Is that true? Great, I feel the same about IE. So here is quick fallback script for html5 validation in older browsers. You will need three things for that.

Note on privacy #1

Today I removed from my blog all stuff that can track users. I removed Twitter follow and tweet buttons, Google +1 button, Google Analytics script, Facebook related crap. Why? Because it’s just unfair. Why would you provide any information about yourself by just being curious? I actually not interested in how many people are reading my blog, anything about traffic sources. Only thing that I am interested in is feedback from users.

Programmer Dvorak and switching workspaces in XMonad

Recently I migarted from awesome to xmonad. I’m Programmer Dvorak freak, so I stuck with controlling current workspace from numbers row.

Clojure on BeagleBone: OpenJDK vs Oracle Embedded JRE benchmark

After installing Embedded JRE on BeagleBone I decided to benchmark it against OpenJDK.

Installing Oracle Embedded Java on Beaglebone and Ubuntu Issue

Recently I was playing with Clojure on Beaglebone and decided to give a try to Oracle’s new Embedded JRE. But after downloading JRE from Oracle website (with filling useless stupid forms) I received following error:

java: no such file or directory

So here is fix:

sudo apt-get install -y libc6-armel libsfgcc1

via

Arch Linux migrated to GRUB2

My current GRUB2 theme

Great news everyone! Today Arch Linux officially switched to GRUB2!

Fix Broken Comments Count for Disqus

I just figured out that my disqus account was attached to gonzih.github.com but my blog was actually hosted using blog.gonzih.org domain. That is why comments count was equal to 0 for every post on my index page. To fix that go to admin ui in disqus and use domain migration tool.

The Internet Defense League

IDL Launch

The Internet Blackout was just the beginning. Together, our websites and personal networks can mobilize the planet to defend the internet from bad laws & monopolies. Are you in?

Join Internet Defence League at internetdefenseleague.org

How to use Magnet Links with RTorrent

Here simple script that will add magnet link as torrent file to your watch directory. You can use it from command line or set it in your browser to handle magnet links.

#!/bin/bash

cd ~/watch    # set your watch directory here
[[ "$1" =~ xt=urn:btih:([^&/]+) ]] || exit;
echo "d10:magnet-uri${#1}:${1}e" > "meta-${BASH_REMATCH[1]}.torrent"

via

Nice Vim Keys Map

Large image (2.4 Megabytes).

Source on github.

Set New PostgreSQL Databases Encoding to Unicode

You must change encoding for template1. For do that run following.

UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';

#recomended
\c template1
VACUUM FREEZE;

via

How To Fix Octopress Pygments Error on Arch Linux

If your get following pygments error using octopress with arch linux.

Building site: source -> public
  File "<string>", line 1
    import sys; print sys.executable
                        ^
SyntaxError: invalid syntax

It’s happens because RubyPython use Python version 2 by calling “python” command. By default python equal to python3 in Arch Linux.

For fix simple add ruby file to plugins directory with following code.

Installing opkg Package Manager on Android (mc, rsync, screen, htop, zip, busybox, tree)

Tmux + Rvm + Zsh Fix

If you have throuble with tmux and rvm default simple add following to end of your .zshrc file.

[[ $TERM = "screen" ]] && rvm use default

Backbone.js + Ruby on Rails Tips