Blog

Gem on debian moved permanently

Added by Christoph Kappel 29 days ago

Debian seems to have big problems with gem and the different versions, you will notice when you see this:

1 > gem list --remote
2 
3 *** REMOTE GEMS ***
4 
5 ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
6 bad response Moved Permanently 301 (http://gems.rubyforge.org/latest_specs.4.8)

Apparently there is an easy fix, just update the sources of gem:

 1 > gem sources
 2 *** CURRENT SOURCES ***
 3 
 4 http://gems.rubyforge.org/
 5 
 6 > gem sources -r http://gems.rubyforge.org/
 7 http://gems.rubyforge.org/ removed from sources
 8 
 9 > gem sources -a http://production.s3.rubygems.org/
10 http://production.s3.rubygems.org/ added to sources

Unknown encoding in ruby 1.9.1-p429

Added by Christoph Kappel about 1 month ago

Updating Ruby is usually a task that breaks many things, therefore I avoid it if possible. Being archuser, the maintainer of the Ruby decides when I need to face new problems.

This time they just added filesystem encoding stuff in p429:

Error loading gem paths on load path in gem_prelude
unknown encoding name - filesystem
<internal:gem_prelude>:69:in `find'
<internal:gem_prelude>:69:in `set_home'
<internal:gem_prelude>:38:in `dir'
<internal:gem_prelude>:76:in `set_paths'
<internal:gem_prelude>:47:in `path'
<internal:gem_prelude>:286:in `push_all_highest_version_gems_on_load_path'
<internal:gem_prelude>:355:in `<compiled>'

There exists still now sane way to init the gem path of Ruby so we can start with our hack from Setup gems load path in embedded ruby and add the required encoding stuff. This problem is known in the ruby redmine and the changesets to this issue give at least some hints what need to be done:

Numbers: on /off 1 #include <ruby/encoding.h>
 2 
 3 VALUE encoding = Qnil;
 4 
 5 void Init_prelude(void);
 6 
 7 RUBY_INIT_STACK;
 8 ruby_init();
 9 ruby_init_loadpath();
10 ruby_script("subtle");
11 
12 /* Get encoding from file system */
13 encoding = rb_enc_from_encoding(rb_filesystem_encoding());
14 
15 /* Set internal and external encoding */
16 rb_enc_set_default_internal(encoding);
17 rb_enc_set_default_external(encoding);
18 
19 /* FIXME: Fake ruby_init_gems(Qtrue) */
20 rb_define_module("Gem");
21 Init_prelude();

Logitech Wave

Added by Christoph Kappel about 1 month ago

I finally made a decision and chose the Logitech Wave after reading about it with all the pros and cons. Yesterday it arrived and I am really satisfied with the layout and especially with the wave design, it really makes typing a bit more pleasent. Overall it's not as heavy as it looks and it's well manufactured.

The mini usb receiver is a bit bigger than something I would call mini and to connect mouse and keyboard you need to press the connect keys manually. After that both work properly.

Wave and linux

On the linux console no problems at all, but under xorg many keys didn't work like expected and I am not speaking of the multimedia keys. This is probably a fault of my xmodmap though. Generally almost all of the multimedia keys have keycodes that aren't in the range of the supported keycodes(0-255) of the kbd driver. After some goodling I found the suggestion to use the evdev driver for this, here is my config for mouse and keyboard:


Section "InputDevice" 
  Identifier  "Mouse1" 
  Driver      "evdev" 
  Option      "Device"            "/dev/input/by-path/pci-0000:00:04.0-usb-0:9:1.1-event-mouse" 
  Option      "ZAxisMapping"      "4 5" 
EndSection

Section "InputDevice" 
Identifier  "Keyboard0" 
 Driver  "evdev" 
 Option  "Device"      "/dev/input/by-path/pci-0000:00:04.0-usb-0:9:1.0-event-kbd" 
 Option  "XkbModel"    "evdev" 
 Option  "XkbLayout"   "de" 
 Option  "XkbVariant"  "nodeadkeys" 
 Option  "XkbOptions"  "ctrl:nocaps" 
 Option  "evBits"      "+1" 
 Option  "keyBits"     "~1-255 ~352-511" 
 Option  "Pass"        "3" 
EndSection

The devices need to be adjusted for your config, by-path is a bit more pleasent than just relying e.g. on event0. This can avoid trouble when you switch usb ports.

Multimedia keys

There are many multimedia keys on the keyboard, some of them work and some of them don't. Currently I am only using the keys to control mpd.

Here is my Xmodmap for this:


keycode 121 = XF86AudioMute
keycode 122 = XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume
keycode 165 = XF86AudioPrev
keycode 171 = XF86AudioNext
keycode 172 = XF86AudioPlay
keycode 174 = XF86AudioStop

You can use the keynames than in your config, like I don in my subtle:

1 grab "XF86AudioMute", "amixer set Master toggle" 
2 grab "XF86AudioRaiseVolume", "amixer set Master 2dB+" 
3 grab "XF86AudioLowerVolume", "amixer set Master 2dB-" 
4 grab "XF86AudioPlay", "mpc toggle" 
5 grab "XF86AudioStop", "mpc stop" 
6 grab "XF86AudioPrev", "mpc prev" 
7 grab "XF86AudioNext", "mpc next" 

GDM, subtle and the missing logfile (1 comment)

Added by Jøran Zeller 2 months ago

Ok, slim log's now while GDM doesn't. This is another approach to log something usable:

touch /usr/share/xsessions/subtle_withlog.desktop
touch ~/.startsubtle
chmod 700 ~/.startsubtle

insert in /usr/share/xsessions/subtle_withlog.desktop:

[Desktop Entry]
Name=subtle_withlog
Exec=~/.startsubtle

insert in ~/.startsubtle:

autostart () {
   foo &
   bar &
   foobar &
   $InsertWhateverYouWantToAutostartHere &
}

subtle &> ~/subtle.log &
PID=$!
autosubtle & 
wait $PID

Done. Subtle logs now into your home - you may want to change that, i believe.

Gdm and a xinitrc (1 comment)

Added by Christoph Kappel 3 months ago

The current version of gdm ignores the ~/.xinitrc and the ~/.xsession completely which really surprised me, I thought it used them in prior versions.

The is mostly a problem when using ubuntu but there is a way to get this working. Gdm loads the .desktop files from /usr/share/xsessions and offers them in the sessions menu, therefore the easiest way is to create a new entry for our xsession:

[Desktop Entry]
Name=Xsession
Exec=/etc/X11/Xsession

This will load our ~/.xinitrc as we expect it.

Running sshd on gentoo

Added by Christoph Kappel 3 months ago

I got this new vserver and I decided to use it as Gentoo buildslave. Just after installing the image I had no working ssh. Reading the log I stumbled across this:

Jun 17 14:46:17 vadmin234 sshd[3519]: Server listening on :: port 22.
Jun 17 14:46:17 vadmin234 sshd[3519]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jun 17 14:46:23 vadmin234 sshd[3519]: Received signal 15; terminating.

Looks like sshd binds port 22 on :: and tries to bind then the same port on 0.0.0.0 which obviously can't work. This is overall a bit cumbersome, because I don't have any ipv6 address for this machine.

A solution is either to remove ipv6 support from the kernel or even better say sshd which address it should use:

ListenAddress 0.0.0.0

Ingate offers 55 free vserver

Added by Christoph Kappel 3 months ago

I just discovered this on a blog of a friend, sorry it's a german blog and therefore a german company: Wir verschenken 55 VServer!

Actually I never heared anything about this company, but this offer is just unique. The prices sound solid and we will see who gets a server. Whenever I am that lucky to be one of the 55 and I will report about the overall experience with it too.

The vserver (VServer Basic) itself has following stats:

  • 5GB disk space (RAID1)
  • 200MB RAM (min)
  • 200MB Swap
  • Traffic flatrate
  • Full root-access over ssh
  • IP-Addresses (RIPE)

Edit: I am currently setting it up as another buildhost for subforge.

Slim and Subtle

Added by Jøran Zeller 4 months ago

I need Slim because of xmodmap. It maps my capslock to the windowskey and xmodmap won't work when there's no running x-session. The problem with this is that you don't see any messages from Subtle (especially when it crashes). So, let's bend stderr and stdout to a file.

Modify your .xinitrc like this:

exec ck-launch-session subtle 2>&1 > /tmp/subtle.log

Happy bugreporting :)

Magic characters

Added by Jøran Zeller 4 months ago

Subtle crashes when using "°" as separator?

Just put

# coding: utf-8

on the first line in your subtle.rb

Semi "raise-on-focus" per view

Added by Jøran Zeller 4 months ago

One thing that was a bit anoying to me is that windows won't raise when they get the focus. It's ok when working with terminals or windows that fit in a given gravity. But ,e.g. using Kicad with multiple windows, one hand is already on the mouse, so it takes more time to put your hand back on the keyboard for raise or lower a window. When using Kicad i've alwas 1-3 windows in "near-fullscreen", in a stacked order.

To get the windows raise when they get focus you can drop this in your config:

HOOKS = {
 # Added for "raise-on-focus" only on desk-view
 :HookClientFocus => lambda { |c| c.raise if("desk" == Subtlext::View.current.name)}
}

This does a raise-on-focus on a view called "desk". When you want to have this behaviour on all views simply delete the "if(foobar)"-statement.

1 2 Next »

Also available in: Atom RSS