Tuesday, August 31, 2010

Using vpnc for cisco vpn (pcf file)

  1. install vpnc with synaptic
  2. open terminal, type sudo pico /etc/vpnc/default.conf
    An example of default.conf:
    IPSec gateway ip.to.vpn.server
    IPSec ID VPNservergroupname
    IPSec obfuscated secret cryptedpasswordfrompcffile
    Xauth interactive
  3. ctrl+x
  4. y
  5. sudo vpnc-connect
  6. enter your vpn user name, enter
  7. enter pin code or what ever kind of system you have, enter. Now you're inside vpn tunnel
  8. after you're done, sudo vpnc-disconnect

Monday, August 16, 2010

Running Hardware Driver as sudo on xubuntu

 gksu -D /usr/share/applications/jockey-gtk.desktop /usr/bin/jockey-gtk

Wednesday, April 22, 2009

Building on 64 bit Linux system

If ./configure can't guess the right system try run a compiler like gcc:

> gcc -dumpmachine
x86_64-redhat-linux

If make gives error:
"xxx.so: could not read symbols: File in wrong format"

Maybe wrong library is loaded for compile:

./configure --target=x86_64-redhat-linux LDFLAGS=-L/usr/lib64

See http://www.c3.lanl.gov/~pakin/software/conceptual/userguide/Could-not-read-symbols.html

Saturday, September 20, 2008

ViEmu commands

If you use Ctrl-V or Ctrl-Q to enter visual block mode, and select a range, you can key in any operator directly and it will be applied to the range. Here are some samples:

d Deletes the block (and copies it to the default register for later pasting)
y Yanks the block (copies to the default register)
gU Makes all characters uppercase
gu Makes all characters lowercase
~ Toggles the case of all characters
c Change - deletes the region, enters insert mode, and then repeats the string input in all lines (if we were initially in block visual mode)
etc...

The docs have a complete list of ViEmu-supported operators.

'x' also works to delete a visual region.

Thursday, August 7, 2008

pthreads

To compile C++ code with pthread library on Linux

g++ --pthread main.cpp

Thursday, January 31, 2008

Making Microsoft Natural Ergonomic Keyboard 4000 Working

If your Windows XP doesn't recognize this keyboard saying something like "Cannot install this hardware" because of can't find the software etc, and you are absolutely certain that your USB ports (and HID-Human Interface Device drivers/services) are all working, then you may want to try what I did below.

At first I thought the keyboard was faulty, because all my other USB devices had no troubles whatsoever. But I decided to test and plugged it into my laptop which also runs Windows XP. Surprisingly it had no trouble at all to detect and install the right driver for this keyboard.

What I ended up doing was copy the working registry entry on my laptop to my desktop. The registry entry is under something like: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\
Vid_045e&Pid_00db\5&2e32ec62&0&1

One issue is the USB port you use on the desktop will definitely be different than the one you use on your laptop, so figure out which entry it's under and change the "working" entry's key name to the "non-working" entry's name and delete the "non-working" entry from the registry.

You may need to change the permission on these entries to Full Control to be able to delete them. Once that's done, unplug the keyboard and plug it back in, Windows XP should detect it and start to install the HID driver.

BIG WARNING: EDITING YOUR REGISTRY IS VERY RISKY, YOU MAY NOT BE ABLE TO BOOT BACK INTO WINDOWS IF YOU MESS SOMETHING UP. FIND SOMEONE WHO KNOWS WHAT THEY ARE DOING TO HELP YOU OR JUST USE ANOTHER KEYBOARD WITHOUT THIS PROBLEM.

Wednesday, January 30, 2008

VTK 5.04, libpng, and many others

VTK:
  • follow instruction on how to build VTK from source
  • get CMake
  • run CMakeSetup.exe from VS command line env
  • set the configurations
  • open the generated solution file and build from there
VTK python:
  • after compile and build, use the INSTALL project in the VS solution to install it to configured directory
  • to have vtkpython find these vtk packages add this to env:
    • PYTHONPATH=D:\VTK\bin;D:\VTK\lib\site-packages
    • rename all vtk*python.dll to vtk*python.pyd (python 2.5 only recognizes *.pyd files as packages)
libpng
  • convert solution files current VS
  • zlib project in the solution doesn't work well, just remove it
  • update zlib include and lib path in libpng and pngtest project config
libtiff 3.8.2
  • open nmake.opt and update the path to zlib and libjpeg
  • then open up VS command line env go to libtiff dir run "nmake /f makefile.vc"
  • read install instructions from the lib online for windows
libjpeg
  • read the install doc, basically copy jconfig.doc to jconfig.h then run "nmake /f makefile.vc"
zlib
  • if you use the prebuilt binary lib from zlib, put the dll file in the system directory so these libraries can find it