Norge Linux
Tuesday, April 3, 2012
SSL
Sunday, April 1, 2012
iSCSI
Now that the boot worked I needed something to boot. I could of gone the easy route of using a usb drive, boot into the live arch installer, install open-iscsi there, log into the target install arch on the target and set up in the live environment. Truthfully I hate sitting at my main computer with laptop by my and not having my main computer so I went my own route. I followed these instructions for install arch from a running system.
https://wiki.archlinux.org/index.php/Install_from_Existing_Linux
Its actually quite easy from a running arch system. Start at Setup the Target System and you will be installed in a couple minutes. Next is grub, I always use grub2, don't ask me why but I always use grub2 (maybe because grub is always the one in the how to's and I like a challenge). This part was a little harder, follow the Arch Wiki pages for iscsi boot and grub2 - that will get you there.
Monday, February 27, 2012
Razer Udev
/lib/udev/keymap -i /dev/input/by-id/usb-Razer_Razer_Anansi-event-kbd >> macros
This was super easy to edit with some find and replaces, and here is the original. The rest is the same as the logitech touchpad.
0x7006A f15 #M1
0x7006B f16 #M2
0x7006C f17 #M3
0x7006D f18 #M4
0x7006E f19 #M5
0x7006F f20 #T1
0x70070 f21 #T2
0x70071 f22 #T3
0x70072 f23 #T4
0x70092 katakana #T5
0x70093 hiragana #T6
0x7008C kpjpcomma #T7
0x70073 f24 #FN
Keycodes are in this file, /usr/include/linux/input.h remove the KEY_ and convert to lowercase. I included the fn key because it needs to remapped, once you do I beleive all the media keys work, I don't use them, I'm using xbindkeys with a guile configuration to allow for the left side macro keys to act as a switch to change many of the keys on my keyboard (control XBMC, control receiver, control TV)
Sunday, February 26, 2012
Openldap... ugh
I was putting this off but I'm tired of not having everything set up. Whenever I set up linux I set up a local admin account to get everything running. I then set up ldap for my actual user. This has probably been the most problematic part of resent life with linux and much of the reason I moved to Arch. In Ubuntu they try to auto set up everything, well that half works and getting the other half working is harder than hell because when I used Ubuntu I only had to edit configs for non standard packages. Arch you set everything up, all those cool scripts that Ubuntu has don't exist in Arch. The thing about these configs is that they are generally easy and give you a much better understanding of Linux. I guess I should make another post just for the howto.
Razer Anasi on Arch Linux
I have been using a Mac Razer Anasi at work, the macro keys are great but alone the keyboard is amazing to type on. I bought the windows version to use with Linux knowing full well it wouldn't work. I had already tested the Mac version and done some research, no one smarter than me had figured out how the razer drivers trigger changing the macro keys from really standard key codes like = - 0 9 8 and various other hard to map keys because mapping them would make much of the keyboard unusable. I had been watching this post on SuperUser http://superuser.com/questions/342107/getting-macro-keys-from-a-razer-blackwidow-to-work-on-linux and there were some good ideas, I was going to use this as a starting point to try and figure out how it all worked. Well someone else beat me too it and I'm glad they did, looking at what they did I don't know if I would have easily figured it out. Basically a command can be sent to the keyboard to change the scan code for each keyboard macro key. So following the instructions from SuperUser and using some of the information learned with the Logitech Trackpad we can assign any of the macro buttons.
First install cabal, ghc and libusb
sudo pacman -S cabal-install ghc libusb
Now we need to update cabal and install the usb module
cabal update; cabal install usb
now clone the git repository for EnableRazer
git clone git://github.com/tuxmark5/EnableRazer.git
I'm using the Anasi so the product ID needs to be changed in Main.hs
gedit src/Main.hs
line 64 is where the product ID goes, use lsusb to find the id of your ID, first part should be 1532 because that is Razers company ID. Its a small program so building and configureing EnableRazer is very quick.
cd EnableRazer/; cabal configure; cabal build
copy the binary to somewhere in your path, I used /usr/local/sbin because it is locally built and root is required to run
sudo cp dist/build/EnableRazer/EnableRazer /usr/local/sbin/
and run it
sudo EnableRazer
this should give you this output
WRITING SET_REPORT
OK
now use xev to see the changes, the t2, t3 and t4 will need to be remapped using udev because they default to trackad toggle, trackpad on and trackpad off. They don't work do anything useful and every easy way of remmaping did not work.
Computer got hosed
Friday, February 17, 2012
Logitech Wireless Touchpad
sudo /lib/udev/keymap -i /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse
I figured out the scan codes for all the gesuteres logitech talks about on this page http://logitech-en-amr.custhelp.com/app/answers/detail/a_id/26426/~/gesture-navigation-with-the-logitech-wireless-touchpad
Here is my "map" of the gestures
Three Down
scan code: 0x7004E key code: pagedown
Three Up
scan code: 0x7004B key code: pageup
Three Left
scan code: 0x90004 key code: 113
Three Right
scan code: 0x90005 key code: 114
Four Down
scan code: 0x700E3 key code: leftmeta
scan code: 0x70007 key code: d
Four Up
scan code: 0x700E2 key code: leftalt
scan code: 0x7002B key code: tab
Four Right
scan code: 0x700E3 key code: leftmeta
scan code: 0x7004F key code: right
Four Left
scan code: 0x700E3 key code: leftmeta
scan code: 0x70050 key code: left
You can see how Logitech did things each gesture comes out as a keyboard press, the one really cool bonus of the keyboard output is that this device should work without any special drivers. The bad part, no custom gestures (not that I've gotten utouch to work under arch anyway). Next all you need to do is create the keymap for the touchpad, I created a file, /lib/udev/keymaps/logitech-touchpad
0x7004E hiragana #Three Down, screendown
0x7004B kpjpcomma # Three Up, screenup
0x90005 leftmeta #Three Right, Activities
0x90004 back #three Left, Back
0x700E2 leftalt #Four up 1
0x7002B f11 #Four up 2, toggle maximized state
0x700E3 leftalt #Four down 1
0x70007 f7 #Four Down 2, Move window
#0x700E3 First part of four right
#0x7004F second part of four right
#0x700E3 First part of four right
#0x70050 second part of four right
The first two are what I'm already using on my keyboard to switch desktops using xbindkeys. Its really easy to configure and I'm sure could write a little post about it if needed. I'm hoping the rest of the remappings make sense,
Now just use this command to remap the touchpad on the fly, if you are going to use different mappings this is very useful for testing.
sudo /lib/udev/keymap /dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse /lib/udev/keymaps/logitech-touchpad
And I have some fun and functional gestures.
The next step is to make a udev rule to load this whenever the device is detected, however I don't intend to restart my computer for a while now so I haven't built the udev rules, I'll follow up with my rule when I make it, otherwise check out the askubuntu.com post. I also hope to post about my fun with the Razer Anasi - the tricks to get it working might also give us clues to unlocking more gestures with the Logitech device.