Category Archives: Arch Linux

Vim colorscheme tuneup

I hadn’t thought about it for awhile but today I updated by Vim colorscheme for the first time in about two years. In the process I found a few that were notable:

rdark-terminal

vcs_1_rdark-terminal

link

gruvbox

vimcs_2_gruvbox

link

synic

vcs_4_synic

I think this one is based on neon. link

kolor

vcs_5_kolor

link

jellybeans blueberry

vcs_7_jellybean-blueberry

This is what I decided on. It’s jellybeans with a twist. I put this in my ~/.vimrc for the adjustments:

colorscheme jellybeans
" Jellybeans colorscheme edits (not working)
"let g:jellybeans_overrides = {
"\   'Normal': { 'ctermbg': '242' }, 
"\   'CursorLine': { 'ctermbg': '238' },
"\}
highlight Normal     ctermbg=323232
highlight Normal     ctermbg=303030
highlight CursorLine ctermbg=238
highlight Visual     ctermbg=240

Others may have different results though as the theme alters dynamically as per background (mine is #323232 btw).

Download

I got these from a collection today and have put them in the AUR

xuserrun – Run a command on the currently-active user’s X.org server display

xuserrun is a bash script to run a command on the active X.org server display.¬† This is primarily necessary if from within another environment¬† (different user, console, cron, boot script…).¬† xuserrun gathers DISPLAY and user environmental variables via systemd and passes them on to be able to dothis. xuserrun is designed for use with only a single user X.org server display. Running it is basic:

xuserrun xclock -digital

Tto put out a notification:

xuserrun notify-send "Hello, Dave."

It’s available for Arch users in the AUR and is also downloadable on github.

Firefox: Defining font type and size

See Firefox/Font type and size.

systemd transfer… Done!



Well, after being throughly put off, I dived into systemd and have done a complete (pure) systemd installation; and I can tell you, I think its pretty nice.

I had no plans to change Arch’s initialization system, but I needed to switch to systemd because parts of GNOME 3 require it. Its been a long time a coming but systemd is a good thing for Linux, a real good thing. Arch’s init system was legendary. It’s what I believed what attracted a lot of people about Arch. Being so pulled to for me was it’s basic, straight-forward setup, so I wasn’t exactly excited about having to switch to systemd. systemd setup isn’t quite as easy as Arch’s rc system but I like it and found it has good logic. The best thing about systemd though will be its unification between other distros. This means that setting up a good number of programs will be similar no matter what distribution documentation is read. Also systemd will save a good amount of developers time as many of the distribution-based init scripts will no longer have to be specifically written (and will rather be included in the application). Plus it inclusion of D-BUS makes it a good deal more powerful.

Here’s what it looks like. It’s not quite as nice looking as Arch’s, but oh well:

systemd is the future… yeeeaaahh! A more unified Linux front.

A basic detail of my systemd install can be found on my GNOME 3 Setup page. Even better to read the whole page on the wiki which is really well done.

Download Package Source Files

I wanted a way to easily download source files for quick editing. Sure abs and numerous AUR-helpers do it but I wanted a simple all-together program/script that could do it, and it turned out to be pretty easy. I wanted to be able to define the repository, and then the package and I did it!

pacpull extra/a52dec

aur/ can be used here as well as the other repositories. I set up /etc/abs.conf and $XDG_CONFIG_HOME/cower/config to use my pkgbuilds directory ~/.arch/pkgbuild (ABSROOT="/home/todd/.arch/pkgbuild", TargetDir = /home/todd/.arch/pkgbuild/aur respectively) so it looks pretty nice:

ls
aur  extra  own  testing

If the repository is wrong it will list the available repositories:

pacpull extar/a52dec
 Not a valid repository:
  core
  extra
  community
  multilib
  testing
  community-testing
  multilib-testing

And it’s nice and it’s basic:

Arch Linux Legacy Blue1 Toon Logo

I created this because I liked the legacy logo and was inspired by Encelo’s Arch toon logo. It needs help on the gradient. To do a curved gradient, I had to rely on a blur (because Inkscape does not appear to be able to do curved gradients) and it bleeds a bit. But otherwise, I think it turned out pretty good. Under the CC license so be free to do what you want with it.

makepkg Shortcuts Script

This one is not as important as the pacman related script but I find I use it often too. I maintain several packages in the AUR and it comes in handy to quickly refer to common tasks related to makepkg. The md5sum function still needs a bit of work (i.e. it requires the build function in the PKGBUILD be able to place the md5sums nicely). Otherwise it’s pretty ready. Here’s what it does:

 mp <option> - common makepkg building tasks
  b - build package (install dependencies if required)
  m - update md5sums
  r - remove previous build directories
  s - create source files for upload, prompts for submission to the AUR
  t - create PKGBUILD template

(ar)ch (pa)ckages – a generic package tasks script for Arch Linux

I once saw a wrapper-script for pacman in the forums that was basically a short-hand version of common pacman tasks. I thought this was a good idea and over the last couple years, I’ve expanded on it. It does just about everything I need it to. It’s real basic and I call it arpa. Here is a basic synopsis:

arpa [option] [*package] - a generic package tasks wrapper script
  -e, --explicit - install a package as explicit
  -g, --get      - get/download package upgrade(s)    : -G get pkg upgrades all
  -i, --install  - install a package                  : -I install as dependency
  -l, --list     - list package files                 : -L list pkgs installed
  -o, --owns     - owning package of a file
  -q, --query    - query for an installed package     : -Q query w/ description
  -r, --remove   - remove a pkg and its deps          : -R force, no argue orphs
  -s, --search   - search for a package               : -S search w/ description
  -u, --upgrade  - upgrade system                     : -U upgrade AUR
  -y, --sync     - sync package db

Good for me to have this around so I can remember everything :), and it is in the AUR.

Back to Blue

Well, I got my Arch installed again and it feels good. I’d been working in Ubuntu for awhile because my older laptop had problems with suspend (that I desperately needed) that I couldn’t figure out in Arch and because of serious time constraints. Being back though, I forgot how much I missed the simplicity and straightforwardness of Arch. I had built a helper script for Ubuntu/Debian that could do just about anything but it took awhile to get there. So far on Arch I’ve actually done a lot less bug fixing, tracking down issue take less time, and with the AUR all the packages are there.

I’d been fixing bits in the wiki as I gone through setup (which is still doing great Misfit) and was able to re-write and add considerably to the MiniDLNA today. Feels good.

Customizable LiveUSB

If you ever have an emergency and need a rescue disk to recover your Linux install, or maybe you just want to brag to your friends there’s some good LiveCD/USB’s out there and many distro’s now make LiveUSB install images, but it is also possible to create your own customizable LiveUSB. Hey, if you’re willing to put the time in, you can have a portable Linux in your pocket.

There’s alot of articles about creating your own custom CD/LiveUSB but many of them seemed dramatic involving messing with things like syslinux… Plus many of these create a fixed image, meaning that once it’s on your USB it can’t be changed. But having a customizable Linux on a USB flashdrive isn’t that difficult – just install Linux to the USB drive.

Partition the USB Drive

The first thing you’ll need is at least a 2GB flash drive. Anything less and you better plan a real basic install. First thing you might like to do is partition the flash drive. This isn’t necessary but I was pretty sure I wouldn’t need the 4GB for what I needed so I partitioned the flash drive to have a 1GB FAT32 partition first (so that Vista can see any files I put on it) then I partitioned the remaining 3GB as ext4 with kparted (there’s also gparted for gnome users).

Install via VirtualBox

No need to burn an ISO and reboot, use VirtualBox and do it from your desktop. You can follow my Testdrive a LiveCD with VirtualBox post to getting VirtualBox setup. I personally used Arch Linux for this install because it’s easy to configure, Gentoo should work well too, and Ubuntu looks to be easy.

Note: At the time VirtualBox does not have 64bit capabilities. If you want to install a 64bit Linux on your flash drive best to boot a LiveCD and follow these instruction from there.

Make sure your user is part of the VirtualBox group to enable usb recognition:

sudo gpasswd -a <username> vboxusers

Boot the LiveCD/USB iso/img in VirtualBox then in Devices > USB devices select your flash drive. Now the installer will recognize your flash drive. Proceed to install the distro on the flash drive. If you partitioned beforehand you can skip partitioning and go to setting Filesystem Mountpoints. When you reach GRUB setup be sure to install GRUB on the flash drive itself, for me it was /dev/sdb. Be sure NOT to install GRUB to a partition, it should be at the beginning of the drive.

Fix Grub

Because your BIOS is likely setup to recognize your hard drive before your USB drive you get drive denominations like /dev/sda for your hard disk and /dev/sdb for your flash drive on regular bootup. If booting from a flash drive, many BIOS’s have you enter a key (mine is F10) to get to a Boot Menu. So when you select your flash drive in your BIOS Boot Menu your flash drive now becomes /dev/sda, hard drive /dev/sdb. In grub terminology this is hd0 and hd1. Most BIOS’s are like this (though there a few exceptions). To know for sure you won’t be able to detect this until you try and boot your flash drive (more below).

Close VirtualBox and open your GRUB menu list and change to the first recognized drive:

sudo mount /dev/sdb2 /mnt/usb
sudo vim /mnt/usb/boot/grub/menu.lst

or however you edit your system files. Then change:

# (0) Arch Linux
title  Arch Linux
root   (hd1,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/34393cdf-9f39-431e-88c8-ea89a2518c83 ro
initrd /boot/kernel26.img

to:

# (0) Arch Linux
title  Arch Linux
root   (hd0,1)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/34393cdf-9f39-431e-88c8-ea89a2518c83 ro
initrd /boot/kernel26.img

The (hd0,1) value denotes the partition number, again starting with 0. So this denotation tells GRUB the root filesystem is on the first drive, second partition.

Arch-specific Details (Mostly)

If you already did the configuration for your hard disk, you should be able to copy most the configuation files over to the flash drive (rc.conf, mirrorlist, modprobe.conf, local.conf…) and then install xorg, xfce4… by chrooting in. This is my chroot script:

#!/bin/bash
# chrootmount - change root to current directory

cp /etc/resolv.conf etc/resolv.conf
mount -t proc none proc
mount -o bind /dev dev
mount -t sysfs none sys
chroot . /bin/bash
source /etc/profile
grep -v rootfs /proc/mounts > /etc/mtab
source ~/.bashrc

This will allow you to just cd to the mounted directory and enter command to chroot to the new environment. From there you can install a desktop environment (I choose XFCE because I wanted a lightweight environment and limited disk space):

pacman -Syu
pacman -S xorg xfce4 gdm <few-fonts> nvidia

And a couple other things following the Beginner’s Guide.

The kernel initramfs image will need to be rebuilt too to have usb driver support. In the chrooted environment edit /etc/mkinitcpio.conf and add usb to HOOKS:

HOOKS="base udev autodetect pata scsi sata filesystems usb"

Then find the the kernel version name and version:

uname -r

and build a new initramfs image:

mkinitcpio -g /boot/kernel26.img -k <your-kernel-name-version>

The -k option needs to be specified to use the chrooted kernel and not runtime kernel that is being used by chroot.

When done, exit chroot:

exit && umount proc sys dev

Reboot and Test

Now reboot and get to the BIOS Boot Menu. As I said, all BIOS’s are different so keep an eye for a key to get to it. Once in the Boot Menu select your USB drive.

Try and boot the flash drive. If you get a GRUB 17 error or boot into hard drive OS, you’ll have to edit your menu.lst. You can find the devices Grub sees by starting the flash drive again and in the Grub menu press e to edit. On the root line press e again and delete to:

root (hd

now press tab and it will show you the availble drive and partitions. Enter the correct one, hit escape and then b to boot. That’s it, you should now have your own customizable Linux USB drive.

Troubleshooting

If you get errors loading the kernel, it may be because USB device detection may need a delay before loading root. Try to add this to the end of your kernel line in your menu.lst:

rootdelay=8

Conclusion

I was a bit surprised. I didn’t think a USB drive would be much different that a CD/DVD but actually it was alot faster. And I just discovered that I’m using a USB 1.1 flash drive. :) Not quite as quick as my hard drive but definitely not bad. This is also the first time I ran without an xorg.conf and my desktop runs great. Definitely worth a try if you ever need a rescue os to fix problems with.

Follow

Get every new post delivered to your Inbox.

Join 58 other followers