z·eeki·sh

tech log on gentoo, linux, and random stuff

Archive for the ‘no cat is good cat’ Category

actkbd and screen rotation in archlinux

leave a comment »

actkbd is in AUR. I need it so the tablet keys on X220 tablet can serve more use (e.g., differentiate between long and short press, etc.)

In order for the rotation script triggered by actkbd to be able to communicate with X, we need to start actkbd with the DISPLAY=:0 environment variable. The AUR package created the /etc/rc.d/actkbd entry. Just change

[ ! -f $PIDFILE ] && /usr/sbin/actkbd -D -q -p $PIDFILE

to

[ ! -f $PIDFILE ] && DISPLAY=:0 /usr/sbin/actkbd -D -q -p $PIDFILE

Written by zsh

February 20, 2012 at 2:40 pm

Posted in no cat is good cat

Tagged with , , ,

dd-wrt ssh port forwarding quirky

leave a comment »

I guess it is more of a web-gui quirky. Anyway, here is what I desire: I want to move the ssh port of the router itself to say 9999, and forward port 22 to a workstation connected to the router.

What I did, which is wrong:
1) dd-wrt -> services -> services: change port of ssh to 9999
2) dd-wrt -> NAT/QoS -> port forwarding: add port from 22 to workstation-ip:22

What I now have, which is correct thanks to this post, is:
1) dd-wrt -> services -> services: change port of ssh back to 22
2) dd-wrt -> NAT/QoS -> port forwarding: add port from 22 to workstation-ip:22
3) dd-wrt -> administration -> management: change [ssh remote port] to 9999

Written by zsh

February 17, 2012 at 12:27 pm

MKL FATAL ERROR /path/to/libmkl_def.so: undefined symbol: i_free

leave a comment »

I started fooling around with python/scipy with the intention of replacing ruby/gsl. Came across this very weird error.

Minimal script to reproduce: invoke ipython -pylab, then in it,

In [1]: from scipy import *

In [2]: a=zeros(1000); a[:100] = 1; b = fft(a)

In [3]: plot(abs(b))

and ipython spits out the titled error.

Found a solution here: before running ipython,
export LD_PRELOAD=/opt/intel/mkl/10.0.5.025/lib/32/libmkl_core.so

apparently, some symbols are defined in libmkl_core.so instead of libmkl_def.so.

Written by zsh

February 5, 2012 at 1:35 am

Posted in no cat is good cat

Tagged with , , ,

adding an ssh tunneling account to dd-wrt

with 2 comments

A server I helped to setup recently has its OS re-installed, and I
know that because I can no longer log onto it. I used to have an
ssh-tunneling account set up on that server too for people who need to
reach outside a certain great firewall, and it’s also gone with the
revamp–my father being one of the users. So I decided to add an
ssh-tunneling account to my router (with dd-wrt)

What I need is the public key of whoever is going to use it, in this
case my father’s–alternatively I can also make a pair of
private/public keys and distribute the private key to the target
users, but that kind of defies the purpose of a “private” key.

All I need to do is to put the following snippet into my router’s
startup script, which can be modified from the web interface of
dd-wrt: administration -> commands.

The code goes as

mkdir -p /tmp/tunnel/.ssh
# somehow, /bin/false doesn't work
echo "tunnel:*:401:10:User,,,:/tmp/tunnel:/bin/sh" >> /tmp/etc/passwd
echo "public-key-content" >> /tmp/tunnel/.ssh/authorized_keys

and replace public-key-content with the content of a
desired public key (or several).

And the last thing is to ask the end user to log onto your server once
in case the server’s key fingerprint is not yet in
his/her ~/.ssh/known_hosts

Now conjure up the magical ssh -Nf -D9999

Written by zsh

August 9, 2010 at 5:30 pm

Posted in no cat is good cat

Tagged with ,

mounting sansa fuze microsd

leave a comment »

need CONFIG_SCSI_MULTI_LUN, can be found at:
device drivers -> scsi device support -> probe all LUNs on each SCSI device

Written by zsh

September 8, 2009 at 3:43 pm

create socks5 proxy using window-less openssh from cygwin

leave a comment »

After half day’s work, my dad and I successfully revived a 7-year-old Toshiba Satellite 3000 S353 laptop, and he happily confiscated it as his travelling laptop. However, in considering that most online banks in China still require some IE activeX controls, he insisted that I replace the ArchLinux in it with WinXP, and since he has grown accustomed to the ssh tunnelling between his desktop and mine for him to browse all those news sites blocked by the GFW, he asked if I can do the same thing on the new windows.

So here’s the thing. We’ll need a cygwin environment, in particular its openssh, psmisc, run and any POSIX compliant shell (e.g., ash). Suppose the cygwin environment is installed in d:\cygwin, create ssh-proxy.bat batch script as follows:

    REM ssh-proxy.bat
    REM this will create a socks5 proxy at localhost:9999
    REM @echo off

    d:
    cd cygwin\bin

    REM give remote server two sec to close an already-open connection
    killall ssh && sleep 2

    REM use explicit invocation:
    REM run /bin/ssh -Nf -D9999 user_name@your.ssh.server
    REM or a `tunnel' profile in ~/.ssh/config:
    run /bin/ssh -Nf tunnel
  

and if you opt to use the ssh profile `tunnel’, put the following in ~/.ssh/config (windows absolute path d:\cygwin\home\USER\.ssh\config):

    # ~/.ssh/config
    Host tunnel
    HostName your.ssh.server
    User user_name
    Compression yes
    DynamicForward 9999
    # use pub-key auth for password-less connection. cf. SSH_CONFIG(5)
    #IdentityFile ~/.ssh/some_private_id_file
  

Now for each internet session, just run ssh-proxy.bat once when you need the proxy. The run command used in the batch script prevents the ssh command from creating a console window. It’s almost transparent for web browsing if you combine it with foxyproxy and Firefox.

As an afterthought, I probably could have done it with putty and AHK, suppose AHK can hide the putty window, but that’d take me sometime to learn the AHK syntax.

Written by zsh

July 7, 2009 at 1:01 am

mis-focused framebuffer console on nvidia 6600gt after switching back to VT from X

leave a comment »

the machine starts just fine in framebuffer VT, but after entering X and switching back to any VT, screen text gets smeared out. modprobe nvidia with the following option solves the problem.

# /etc/modprobe.d/nv6600gt.conf
options nvidia NVreg_UseVBios=0

ref

Written by zsh

June 25, 2009 at 5:15 pm