Saturday, August 10, 2013

nvidia-drivers: low FPS in OpenGL

Don't forget to
# eselect opengl set nvidia

Monday, December 03, 2012

Amarok-2.6 doesn't scroble to last.fm

Upgrade to liblastfm-1.0.3 and amarok-9999 (from the kde overlay in layman).

Wednesday, June 20, 2012

Emacs multi-term: backward||forward-word and kill-word

With the default configuration Emacs term moves only the emacs cursor but not the shell cursor when moving by words with default keybindings.  You can fix that by appending
'(("M-d" . term-send-forward-kill-word)
  ("M-DEL" . term-send-forward-kill-word)
  ("C-DEL" . term-send-forward-kill-word)
  ("M-<backspace>" . term-send-backward-kill-word)
  ("C-<backspace>" . term-send-backward-kill-word)

  ("M-<right>" . term-send-forward-word)
  ("C-<right>" . term-send-forward-word)
  ("M-<left>" . term-send-backward-word)
  ("C-<left>" . term-send-backward-word))
to custom valiable term-bind-key-alist.

Tuesday, March 29, 2011

Using Sudo with Xorg

I found a simple way to use Sudo with Xorg applications.
Run:
  # mv -v ~/.Xauthority{,.b}    #For backup
  # ln -s ~{your_user_name,}/.Xauthority    #Substitute your_user_name with your user name
Now you can use Sudo to run X apps. (Maybe they won't be able to connect to DBus, though.)

Sunday, June 27, 2010

Easy way to set up dial-up in Gentoo (+- Xfce)

It's based on Gentoo Wiki Archives - Dial-up with some additions. Look here to learn how to enable support for your modem in the kernel. This article is for serial modems.I'm going to use wvdial, because using ppp directly in Gentoo(in Ubuntu it's OK) requires much work.
1. Install wvdial:
  Run in termial:
    $ su
    Password: (enter your root password)
    # emerge -avt wvdial (-avt is --ask --verbose --tree)
    (you know what next:))
2. Add non-root users that need to connect by dial-up to the dialout group:
  Run in terminal:
    # gpasswd -a [user] dialout
3. Configure wvdial:
  1. Turn on your modem
  2. Run in terminal:
    # wvdialconf /etc/wvdial.conf
    (wvdial will probe your serial(COM in Win) ports and your modem)
  3. Edit the configuration file(/etc/wvdial.conf):
    Uncomment "Username =", "Password =" and "Phone =" and change it. If you have pulse dialing(not tone), add P in front of the phone number(ex. P8w600100). You can know if you have tone dialing when you dial with your phone and it sounds like this: DTMF Dialing.ogg.
    It's safe not to touch Baud.
  4. My configuration file as an example:
    http://dpaste.org/aOKB/
4. Now you can try to connect:
  Run in terminal:
    # wvdial
  If you see something like this: http://dpaste.org/CaNU/ then it has connected. You can try it in your browser.
    Press Ctrl+C to disconnect.
5. Set it up that non-root users may connect:
  1. Edit sudo configuration file:
    Run in terminal:
      # visudo
    Add these lines:

%dialout        ALL=(root) NOPASSWD: /usr/bin/wvdial
%dialout        ALL=(root) NOPASSWD: /usr/bin/killall wvdial

  2. For example here is my sudo configuration file:
    http://dpaste.org/LAx0/
  2. You can connect as normal user with this command:
    sudo wvdial
  Disconnect:
    sudo killall wvdial
  Or by pressing Ctrl+C if you run the connect command in terminal.
  3. If you are not using Xfce or planning to connect from the command line(but not from the Xfce panel) you can make it easier:
    1. Edit your ~/.bashrc:
      Add this line:

alias wvdial='sudo wvdial' dialup_hangup='sudo killall wvdial'

      You can replace wvdial and dialup_hangup with anything you like.
    2. Now you can connect and disconnect with these commands(wvdial and dialup_hangup)
6. Optional: Enable connection from Xfce panel:
  1. Install(if you don't have it) xfce4-modemlights-plugin:
    Run in terminal:
      $ su
      Password: (enter your root password)
      # emerge -avt xfce4-modemlights-plugin
    It will be masked, so you must unmask it:
      Edit /etc/portage/package.keywords:
        Add this line:

xfce-extra/xfce4-modemlights-plugin

  2. Add "Modem Lights" to your panel:
    Right-click on the panel, choose "+ Add new items..." and choose "Modem Lights"
  3. Configure Modem Lights plugin:
    Connection Command: /usr/bin/sudo wvdial
    Disconnection Command: /usr/bin/sudo killall wvdial
    For Device and Lockfile read the plugin's help: click "(i)"
  4. You can connect and disconnect by clicking on the phone icon.

Thursday, May 06, 2010

My recent bugs

"Bug 6353 - Thunar mounts USB flash with wrong encoding" http://bugzilla.xfce.org/show_bug.cgi?id=6353
"Bug 12718 - Panel stretches" http://bugzilla.abisource.com/show_bug.cgi?id=12718
"Gentoo Bug 317099 - x11-base/xorg-server-1.7.6 update: 4 blocks" http://bugs.gentoo.org/show_bug.cgi?id=317099 : Solved

Sunday, October 25, 2009

The fastest way to replace GNOME's Metacity with XFWM4 in Ubuntu.

I replaced Metacity with XFWM because:
1. XFWM is faster. Xfce is much faster than GNOME, but I'm not using it because I have dial-up and I can't download such size(20+ MB). So I must replace window manager to make Ubuntu a little faster.
2. It supports built-in compositing. It can make menus, inactive windows, ... transparent without Compiz so I can use compositing on OpenGL-incompatible video card.
3. It has easy theming. XFWM uses XPM(X Pix Map) and PNG formats and a text file to create themes, unlike Metacity, that uses XML that I badly understand.
OK, let's start.
1. In Synaptic install package "xfwm4". Also, if you want to choose themes, install "xfce4-settings". Then if you want to run XFWM Settings, run: "xfce4-settings-manager &" in terminal.
2. Go to System->Settings->Startup Applications.
3. Click "+ Add".
4. In Command field, enter : "xfwm4 --replace".
5. Type something in Name field.
6. Click "+ Add".
7. Reboot and enjoy:).
As you will notice after reboot there will be a black screen for a short time. It's because autostart is not done immediately after log in. But it's the fastest way.