Archive for the 'Linux' Category

Deleting unused config files in Debian

Thursday, October 13th, 2005
  • Getting a list of unused packages (not the installed ones): dpkg –list | grep -v -E “^ii”

  • Purging packages list: dpkg –purge packagename

So doing all this in one line would be something like: dpkg –purge dpkg --list | grep -v -E "^ii" | perl -ne '/^rc\s+([^\s]+)/ && print "$1 ";'

Be careful!

Problems mounting ipod on linux: end_request: I/O error,…

Tuesday, September 27th, 2005

Here is a nice explanation and how to fix the problem: LinuxQuestions.org- The iPod and the Penguin – LinuxAnswers

At the end, I enabled additional partiotion types and disabled the EFI. It seems to work now. CONFIG_PARTITION_ADVANCED=y CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y

CONFIG_EFI_PARTITION is not set

Configuring PostgreSQL ODBC connector

Thursday, September 22nd, 2005
  1. apt-get install unixodbc odbc-postgresql

  2. Add the following line into /etc/odbcinst.ini

    [Postgres]
    Description             = Postgres
    Driver          = /usr/lib/odbc/psqlodbc.so
    Driver64                = /usr/lib
    Setup           = /usr/lib/odbc/libodbcpsqlS.so
    Setup64         = /usr/lib
    UsageCount              = 1
    CPTimeout               =
    CPReuse         =
    
  3. Add the following DSN into /etc/odbc.ini

    [test]
    Description   = test
    Driver    = Postgres
    Trace   = No
    TraceFile   =
    Database    = test
    Servername    = localhost
    Username    =
    Password    =
    Port    = 5432
    Protocol    = 6.4
    ReadOnly    = No
    RowVersioning   = No
    ShowSystemTables    = No
    ShowOidColumn   = No
    FakeOidIndex    = No
    ConnSettings    =
    

NOTE that the hostname is called servername here! If you use a standard hostname, the driver will connect to a socket, not the inet and you get a “connection refused” message.

  1. The DNS-less connection string to PostgreSQL (don’t need step 3 then) would be: "Driver=Postgres;Database=test;Servername=localhost;Port=5432;Username=test;Password=xxxx;"

NOTE: It’s error-prone and hell to debug.

  1. Driver should not be in curly braces {} (should be according to the spec).
  2. Absolutely no spaces anywhere (should be ok according to the spec).
  3. Error messages are not very informative as it fails silently and calls another connection methos producing “Data source name not found, and no default driver specified” :-|

A useless pointer: DSN-less connection strings – discussed here.

Conifure Ad-hoc wireless router on Linux

Thursday, September 8th, 2005

It’s acutally quite simple-got it to work in 5 min.

Setup at the server:

  1. iwconfig eth1 essid <essid> mode ad-hoc
  2. ipconfig eth1 10.0.0.1 up
  3. echo “1″ > /proc/sys/net/ipv4/ip_forward
  4. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Setup on a client:

  1. iwconfig eth1 essid <essid> mode ad-hoc
  2. ipconfig eth1 10.0.0.2 up
  3. route add default gw 10.0.0.1
  4. echo “nameserever 10.0.0.1″ > /etc/resolv.conf

Should work. Another thing you may try is if your network card supports a “master” mode (iwconfig <interface> mode master) and if it does, you can setup an access point. I guess the rest should be similar (use “mode managed” on a client of course).

Building kernel on Debian

Tuesday, July 12th, 2005

Once and forever ;-)

make-kpkg –append-to-version .normand –added-modules thinkpad kernel_image modules_image

Converting SVN from BerkleyDB to FSFS

Tuesday, June 14th, 2005
  1. svnadmin dump <repository> > <dumpfile>
  2. move the repository somewhere else.
  3. sdnadmin create –fs-type=fsfs <repository>
  4. svnadmin load <repository> < <dumpfile>

VLAN tagging

Tuesday, June 7th, 2005

802.1Q VLAN – tagging for packet exchange between switches (need to reconfigure the switch port). Can do it with hypervisor to attach VLANS to virtual domains.

Linux: don’t know how to do it the easiest in iptables? There seems to be another l2 filtering tool: http://ebtables.sourceforge.net/

Bind forwarding

Monday, October 25th, 2004

One of the problems with DNS cat is that the sefver may be already running a DNS server. Multiple servers cannot share a single port 53.

The workaround is “DNS forwarding”. (more…)