onsdag den 11. november 2015

Arch Linux on the Orange Pi .. I like it



So about a month ago i ordered an Orange Pi development board. At the time it was $12 + shipping from mainland China. And i just got it a few days ago. I have been buying up used Raspberry Pi's for the past year hoping to build a cluster at some point, and i have several boards in use for various projects and media centers at home.

The Orange Pi had a low price. 1024 MB RAM and a Allwinner Quad Core 1.6GHz CPU. For $12 that is a steal. The fact that it sports a Allwinner CPU, this device will at best deliver partial hardware accelerated video playback using the CedarX multimedia library, and i have no idea if it is supported or not. For my use i couldn't care less about video playback. I had been eyeing the RPi2 for the specifications to use for a few more demanding tasks that needed the boost in specification.

The documentation for the boards is really bad, and the instructions to get a board up and running is actually so bad the if you follow them, you will not end up with a board running anything.

I was planning to use the Debian image for the board, but when i spotted an Arch Linux image just above the Debian one, i was sold. I love the efficiency of Arch and the AUR, and as a long time Arch user, i was aboard. After running $ dd to write the image to my SD card, i was left with a prebuild Arch install and a BOOT directory containing kernels and resolution scripts that i had to further narrow down to fit the device i got.

After that, i spend about an hour setting up the yaourt package manager, that was a bit more tricky to do on the ARM7 platform than it is on my x86 devices.

First of all. When adding the yaourt repository to /etc/pacman.conf i usually add this:

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
However. For the arm platform i added:
[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/arm

After that i manually downloaded and build both the yaourt package and the package-query package it has among it's dependencies.

package-query and then yaourt:

$ wget https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz
$ tar xfz package-query.tar.gz
$ cd package-query  &&  makepkg
$ sudo pacman -U package-query*.pkg.tar.xz  
$ wget https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz
$ tar xzf yaourt.tar.gz
$ cd yaourt  &&  makepkg 


And Finally:


$ sudo pacman -U yaourt*.pkg.tar.xz

onsdag den 26. august 2015

Adding the Arch Assault repo to pacman.conf



After getting gpg related errors when trying to add the Arch Assault repository to my pacman.conf i came upon this solution.

the error message read:

gpg: keyserver receive failed: No dirmngr

So it was a missing directory. And a gpg directory non the less.

Searching the mighty interwebs i came upon a gpg mailing list mentioning bug in which the dirmngr was not being created for the root user in the arch linux architecture for obvious reasons.

But there seems to be conflicting arguments whether the bug is related to gpg or to arch linux itself, since that the root user in arch should not have to have a .gnupg dir, but never the less needs one for certain operations.

So. As root create the directory:

dirmngr </dev/null

Afterwards, still as root. You can now add the repo to pacman.conf and the arch assault keys with --noconfirm (safe right?):

echo "[archassault]" >> /etc/pacman.conf && \ echo "Server = http://repo.archassault.org/archassault/\$repo/os/\$arch" >> /etc/pacman.conf && \ pacman-key -r CC1D2606 && \ pacman-key --lsign CC1D2606 && \ pacman -Sy --noconfirm archassault-keyring archassault-mirrorlist


onsdag den 1. juli 2015

why VIM uses "h,j,k,l" for navigation

The UNIX equivalent to race wars can be found in terminal text editors. And even though i have been using both nano and VIM for a fair amount of time, it was not until today that i actually learned that the navigation keys in VIM of h,j,k,l was not implemented to create some sort of hipster elite, but rather it came to be due to the fact that VIM used the keyboard layout from the "ADM-3A" terminal that had secondary arrow keys mapped to the h,j,k,l keys.


mandag den 9. marts 2015

makepkg 4.2 killed --asroot.

A dirty fix that works from the yaourt github thread.
Edit /usr/bin/makepkg
Add asroot to OPT_LONG (line 3366). 
Search for "OPT_LONG".
OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg'
          'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild'
          'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'pkg:' 'repackage'
          'rmdeps' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps'
          'verifysource' 'version' 'asroot')
Remove EUID check (line 3577).
Search for "EUID".
if (( ! INFAKEROOT )); then
    if (( EUID == 0 )); then
        #error "$(gettext "Running %s as root is not allowed as it can cause permanent,\n\
#catastrophic damage to your system.")" "makepkg"
        #exit 1 # $E_USER_ABORT
        plain "$(gettext "Running as root restored by Orc ;)")"
    fi

 This dirty fix helped me install snort on my pi once again. Remember running makepkg as root will make baby jesus cry.

søndag den 1. marts 2015

Archbang login manager

Now i am in no way fluent in linux, but i have been using it for years, and i want to start writing down the solution to some of the problems i encounter during my usage. I may embarrass myself with how i frame the problem, but i will at least include a solution that has worked for me.

Now. Punching the Arch philosophy in the face, i choose to skip a few steps from time to time, and install Arch Bang, instead of pure Arch. Now calm yourself down. i have installed Arch from scratch several times, so i know exactly what it is i want to skip over if i need to save some time in order to get a fully functional system. 

So i just spend some time to figure out how to kill off the login manager that came with Archbang. That will teach me not to control every aspect of the install.

Now the Arch Bang Wiki is not the Arch Wiki, which is close to being the most thorough and well written guide i have ever encountered. It is close, since the end result of installing Arch Bang is Arch, but looking at the package list of Arch Bang the login manager looks to be Slim.


Searching my system i could not find a single reference to Slim. It took me way to long to think about taking a look at the systemd processes enabled on my system, but running the following command listed every enabled process.

systemctl list-units -t service --all

This command revealed that the login manager was in fact "lxdm"

Good times. Now i can disable the process by running:

systemctl disable lxdm

And there was much rejoicing ..