Sunday, 27 November 2016

Change Thinkpad T61 page forward/back to page up/down in Linux

The Thinkpad T61 is a formidable machine that has earned it's place in history and for me is still my go-to laptop of choice despite its' 10+ year manufacture date.

There one flaw that I have found, that the Page Up/Page Down keys are in the most awkward of places, on the very top right of the keypad.

There are two keys in prime position that are not utilized at all on Linux, so here is a quick and dirty way to remap the Page Previous/Page Next to Page Up/Page Down.

This is an easy problem to fix through the use of xmodmap in your .bashrc file.

To remap the keys all you need to do is:
  • Open your bashrc with vim/emacs/nano ~.bashrc
  • Add these two lines to the bottom of the file
  xmodmap -e 'keycode 167=Next'
  xmodmap -e 'keycode 166=Prior'
  • Either log out or source your bashrc with source ~.bashrc
Then you should have a new Page Up/Page Down in the correct placement that is the most productive spot for such keys.
 


Monday, 21 November 2016

How to compile micro text editor on Termux on Android

Micro is a brilliant editor that is like an enhanced version of Nano. I'm really starting to enjoy coding in it. If you want to use it on Termux on Android, like I do then here's a quick walk through on how to comile it.



In Termux we are going to need a couple of packages before we get started; git and golang:

apt insall git golang

Then we need to set the Path in your shell of choice, so open Termux and open the rc file to your shell of choice. I'm using zsh and nano in this case, so this is the command I use:

nano ~/.zshrc

So now we need to set the GoLang path so when we compile the program this is where the binary file will go. Add this line to your .zshrc/.bashrc file:

export GOPATH=$HOME/go

Save and exit, you may need to exit or just source your shell with:

source ~/.zshrc

Now it's time go get the git repo and download it:

git clone https://github.com/zyedidia/micro

cd into the git cloned directory

cd micro

Now we need to compile the install by invoking the make command:

make

It may take a little time and appear to to nothing but it is. Once the command exits, enter the final command of

make install

Sunday, 20 November 2016

Deviot, a much better alternative Arduino IDE

The default IDE that ships for the range of Arduino boards isn't really my kind of application. I have searched and tried quite a few on Linux over the years and have settled on a great one called Deviot.

My biggest issues with the official IDE were the lack of customisation, font sizes and rendering are horrible and not extendable at all.

I have found a great plug-in that works with the Sublime text editor, it's not really my text editor of choice, but I found just using the official IDE drove me away from coding the Arduino, so I'm all for using Deviot.

Here's how to get it going on Ubuntu Linux


  1. Install Sublime Text 3 from sublimetext.com/3
  2. Open Sublime and open Install package control with Ctrl + Shift + P
  3. In the dialog, type install package
  4. Type in Deviot, the package will appear as the search feild is narrowed
  5. Click on the package an it will be installed
  6.  Confirmation output of "Installation finished, now you can enjoy Deviot!" is displayed in the bottom panel