Raspberry Pi Wifi Setup in Couple Steps

Say, you might have finished configuring your Raspberry Pi. It is running smoothly, but there one thing that gets on your nerves. The pesky ethernet cable is getting in your way. Well, it’s time to get rid of it for good and setup the wifi. To do that, you need to edit the following two files: /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf.

Configure the wireless

Let’s start with the network intefaces. Open the first file in text editor:

$ sudo nano /etc/network/interfaces

Go to the wlan0 section, which stands for you wifi adapter, and edit it so it looks like this:

allow-hotplug wlan0
iface wlan0 inet dhcp
  wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

In case your /etc/network/interfaces does not include a wlan0 section, just copy the whole thing. When you are done, press ctrl + x to save the changes.

Read more…

Change Raspberry Pi Password, Username and Hostname

Rapsberry Pi is the single most popular computer in the world. And it is easily one of the most hacked systems as well. That’s due to single fact - most users never change the default username and password. But is a relatively a simple process, so there is no reason not to do it. If you already have your Raspberry Pi up and running, you can get going.

Read more…

Powerfish - an Elegant and Informative Prompt

Please, all welcome Powerfish, the one true Fish prompt to rule them all. I know what you might be thinking: “Custom shell prompts? I am not that much of a geek.” I was like that too. But then I thought, what if instead of just taking up space, the prompt could show me the information I need? Powerfish does just that and looks good too. No more wasting time typing ‘git status’, having to amend commits and similar annoyances. But enough words, just see it in action:

Powerfish - an elegant Fish prompt

You might have noticed similarities with Powerline. And you would be right. When I was looking for a nice Fish prompt (to no avail), Powerline inspired me to write one instead. To get Powerfish, just head over to the project Gitlab page. Not using Fish shell yet? No need to worry, check out why it’s so awesome and go install it.

Website Obesity

The other day, I stumbled upon an interesting talk by Maciej Cegłowski about the worrying trend of website obesity. I have to say, I fully agree with him. As it stands, the situation is getting quite ridiculous. Designers and web coders should stop the unnecessary bloat. Here’s the transcript of the talk:

Website Obesity

Protect Your Eyes From Computer Eye Strain

Internet has revolutionized our lives. It has changed the way we work, communicate and access information. But as we spend ever more time in front of shining computer and phone screens, our eyes pay the price. We are plagued with near-vision, eye strain and other problems. Allow me to introduce two tools, that can help in relieving the computer eye strain.

Eye excercizes with SafeEyes

We typically watch screens from very close distances, trying to read the tiny letters. That is the biggest culprit behind computer eye strain, because our eyes have simply not evolved for that. So, a collection of techniques called eye yoga were developed to battle eye fatigue. But as with anything, it is easy to forget about them, while you are concentrating on other stuff. Fear naught, SafeEyes comes to save the day. It’s a simple app, that sits in the taskbar and every once in a while reminds you to take a break, suggesting an eye yoga exercise. Kind of like EyeLeo for Mac. It is intelligent enough not to pop up while you are watching a movie. And you can skip a break, if you need to, so it is fairly unobtrusive.

Read more…

Automatically Setup Your Computer with Ansible Playbook

Setting up a computer can be a major annoyance. Being ‘the tech guy’, I still have vivid nightmares of spending every other weekend reinstalling friends’ and family members’ Windows boxes that have come to a crawl. Now, most of us know enough to backup the important data and that makes the process easier. (If you don’t have backups, go setup Nextcloud, Syncthing, or some other automatic system. Seriously, it’s gonna come back to bite you sooner or later.) But there is still the matter of installing and configuring all your software. Some people have tackled that by writing install scripts. However, there is a better way - Ansible playbook. Let me introduce Ansible. Ansible is a software for computer provisioning. In computing, provisioning means automated installation and configuration of software and services. Provisioning tools, such as Ansible, Chef and Puppet, help you cut down the setup time from hours to mere minutes. Their main advantage over custom scripts is that they are idempotent. That means they only makes the necessary changes. So, if a task fails (for example because ou forgot to connect your Ethernet cable, oops), you can just run it again without any worries. The reason I chose to use Ansible, is that the tasks are easily configurable using yaml files. It is also written in Python, which makes it easy to write your own module for it, in case of need. So what is Ansible playbook? It is the collection of yaml files, describing the tasks to be executed. You can find an introduction to its syntax in Ansible documentation. I will demonstrate how you can setup your computers using an Ansible playbook, using mine as an example. You can find it at my Gitlab page.

Read more…

Fix Steam Controller Issues in Linux

Last time I was praising Steam Controller for running smoothly in Ubuntu. Well, I must have jinxed it. As you might have noticed, after a recent update, it stopped working all together. The reason is, Valve have changed the protocol for wireless communication between the controller and the computer. Luckily, the fix is easy. You just have to edit the udev rules. So, open them with a text editor:

$ sudo nano /lib/udev/rules.d/99-steam-controller-perms.rules

and change them to the following:

# This rule is needed for basic functionality of the controller in Steam and
# keyboard/mouse emulation
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"

# This rule is necessary for gamepad emulation; make sure you
# replace 'pgriffais' with a group that the user that runs Steam belongs to
KERNEL=="uinput", MODE="0660", GROUP="pgriffais", OPTIONS+="static_node=uinput"

# Valve HID devices over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="28de", MODE="0666"

# Valve HID devices over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*28DE:*", MODE="0666"

# DualShock 4 over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666"

# DualShock 4 wireless adapter over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="0666"

# DualShock 4 Slim over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="0666"

# DualShock 4 over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="0666"

# DualShock 4 Slim over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*054C:09CC*", MODE="0666"

Now, save them with Ctrl + x.

I wonder, how much of a problem would be to update the udev package along the Steam update. While the updated rules were mentioned in the change log, it did not say which file you were supposed to edit. And of course, not everybody reads changelogs. So this caused a headache to lot of users. Hopefully, Valve will handle updates better in the future.

Diggin’ in the Carts - History of Japanese Game Music

As a kid, I spent countless hours playing 8-bit games. Atari, Nintendo, Sega - had it all. And 8-bit music has had a special place in my heart ever since. Even now, I like to pop a song or two from my favorite games. Not just because of the nostalgia, but because of the special sound qualities of 8-bit, that you won’t find anywhere else. Some of soundtracks are true masterpieces, as evidenced by their being performed by orchestras all over the world. It is amazing how the composers could achieve such acoustic richness, given how little they had to work with.

When I heard from my brother about a Diggin’ in the Carts, a documentary series by Red Bull Music Academy, that covers the history of Japanese game music, I was overjoyed. It features numerous interviews with the composers, giving a unique insight into how some of the most iconic game songs came to light, with a sprinkle of comments by musicians and electronic producers from around the world, who talk about the impact that Japanese game music had on their works. If you are a fan of the 8-bit sound or retro gaming, this is a must-see. As an added bonus, you can turn off the subtitles to get some quality Japanese practice. You can find the whole series on the following page:

Diggin’ in the Carts

Using Steam Controller in Ubuntu

I have recently picked up the Steam controller. With it, I can finally enjoy some of the platformers that have been sitting in my Steam library for ages (such as Never Alone and Feist). Why Steam controller? The reason is twofold. Firstly, it seems to be one of best gamepads around according to the reviews. Secondly, it was also supposed to run out of the box on Linux. Well, that might be the case if you connect it by USB (I have not tried that). But in order to run it in wireless mode, you have to manually install the drivers. Hopefully, they will be automatically downloaded when you install Steam in future releases, but for now, you have to run this command.

$ sudo apt install steam-devices

Or in OpenSuse:

$ sudo zypper install steam-controller

When the installation completes, just fire up Steam in the Big Picture Mode and add your controller. A bit more work that I would have hoped for, but still simple enough. I might sum up my impressions in another blog post. Now I am off to play some games.

Trouble after update

Edit: If you are experiencing problems with your Steam controller after a recent update, check out this blog post.

Autostart Linux Applications in One Command

Usually, when I am done working on the computer, I just suspend it. Thanks to that, I can easily pick up where I left off. But sometimes, I have to swallow the pill and turn it off (for example to preserve charge while traveling). In such cases, you can autostart Linux apps to quickly setup your work environment and get back to being productive. Fortunately, you can easily set this up in desktop environments adhering to Freedesktop standards. These include Gnome and KDE, among others. You just need to copy the .desktop files of your favorite programs from /usr/share/applications/ to the autostart directory. For instance your browser, password manager or a roll-down terminal. If you only want it to start for yourself, copy it to $HOME/.config/autostart. However, for system-wide configuration, the directory is /etc/xdg/autostart. As a result, you don’t have to waste time starting up the same 5 applications every time you reboot. And you can set everything up using just command line. So you can even use it is part of your computer installation script. If you are looking for other ways to automize tedious tasks, check out this guide to automatically configure your computer with Ansible.