tring tring – research log

research log

Archive for the ‘Uncategorized’ Category

Minimal trac how-to

without comments

To add a user:
htpasswd .htpasswd
Make this user trac-admin:
trac-admin . permission add TRAC_ADMIN
To View the permission list:
trac-admin . permission list

It is easier to just create the admin user first. Once you log into trac as the admin user you can then setup the permission list by the web interface.

Written by tringer

August 7, 2009 at 3:44 am

Posted in Uncategorized

Tagged with

emacs

without comments

From http://www.bloomington.in.us/~brutt/emacs-c-dev.html

Indexing your source code for easy navigation
Emacs comes with an etags executable (and also probably its cousin ctags), which can index source code, allowing you to jump around your source code quickly by simply giving a method name to jump to, etc. Here are some simple steps to get you started:

1. from a shell, run etags *.[ch] in your source directory, which will index or re-index the .c and .h files in your source directory, and will create a file named TAGS.
2. inside emacs, run M-x visit-tags-table RET and then enter the name of the TAGS file created by the previous step.
3. for example, to visit a function named “sortRecords”, type M-. and then enter the name “sortRecords”. Or, better yet, enter just “sortRec”, as substrings will work as well, as long as they are unique.
4. did your press of M-. not put you in the right function/variable? Then try pressing C-u M-. to visit the next function/variable with a similar name.
5. do you want to go back to where you were before the last M-. or C-u M-.? Then simply to M-*, each press of which will pop a stack and return you to where you came from.

Written by tringer

July 19, 2009 at 12:58 pm

Posted in Uncategorized

Tagged with

building a specific module

without comments

To build say the rt73usb.ko module without building the whole linux kernel you just need to do the following:
My build is in “build/” folder.
$ make O=build/ drivers/net/wireless/rt2x00/
This will build the modules
After this then first remove the module by doing
$ sudo rmmod rt73usb.ko
and then
$ sudo insmod rt73usb.ko
Then use
$ dmesg
to check if your module gave any messages.

Written by tringer

February 9, 2009 at 1:58 pm

Posted in Uncategorized

Tagged with

Kernel Panic…VFS:Unable to mount root fs on unknown block…

without comments

Recently I was trying to install a linux kernel on a Compaq N800W. After I built the kernel I would always get the error kernel panic error. I found my answer on page 59 in here.

The full book is here.

I feel the main problem was that “ata_piix” was built as a plugin module instead of being built into the kernel. When I explicitly required “ata_piix” in the config file, then the kernel panic went away.

From the book but I want this as quick reference.

How to find out the Disk Controller:

$ tree -d /sys/block | egrep “hd|sd”

$ ls -l /sys/block/sda

device -> /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0

$ ls -l /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0

device -> ../../../../../../bus/scsi/drivers/sd

Notice here that the SCSI disk controller is responsible for making this device work.

Continuing up …

Written by tringer

February 7, 2009 at 8:30 am

Git cheat sheet

without comments

This is great.

If that is missing then this should also work.

Written by tringer

January 26, 2009 at 10:51 am

Posted in Uncategorized

Tagged with

Changing oil: 2006 SAAB 9-3 2.0T Step 1

without comments

Posted this since I could not find a decent site where I could get all the information I needed. The biggest challenge is to get to the oil filter. To know where the oil filter is, turn to your SAAB manual; it will give you directions to it. Now, how do we open the container to get to the oil filter. You will need some tools:

1. 1.25 inch 12 Pt. Socket (mine is with a 0.5 inch drive). The 12 Pt. is really necessary. If you get a 6 Pt. Deep Socket it will be too tall to fit in the engine.

2. I also needed an extension, so I got this: 10 inch Dual Position Extension with a 3/8 inch drive.

3. Since both my extension and my ratchet have a drive of 3/8 inch, I need a converter that will convert the drive to 0.5 inch. This is because the socket has a drive of 0.5 inch. So I got 3/8 inch F x 1/2 inch M Adapter.

4. A Hex screw driver. You will find this at the trunk of your car underneath the spare tire.

The following steps will guide you on how to open the container:

1. Open the hood of the car and you should see this. The oil filter is located here.

2. Now take off the plastic part so we have access to the oil filter.

3. Now you have direct access to it.

4. Put your tools to work.

The next part of this will be coming in about a week.

Written by tringer

November 9, 2008 at 8:44 am

Posted in Uncategorized

Tagged with

ee-sane menu milwaukee wi

with 4 comments

I cannot find the ee-sane menu anywhere to order a take out, so I thought of posting it here. They are the best “researched” thai food place. :)

Here are the menus:

1. ee-sane menu page 1

2. ee-sane menu page 2

Written by tringer

February 3, 2008 at 1:31 pm

Posted in Uncategorized

Tagged with , , ,

Setting up Gentoo on Dell Latitude D820

without comments

    Security and usability is not a huge concern for me at this point. If you are building a server or something like that then you should really not follow what I am doing here. I am building this system so I can do some work with device drivers.

    Gentoo User Administration:

    adduser -m -G users,wheel,audio -s /bin/bash USERNAME

    passwd USERNAME
    userdel -r USERNAME

    Gentoo installing ssh:

    emerge openssh

    Configuring ssh:

    configure your /etc/ssh/sshd_config in the following manner:

    Port 22

    Protocol 2
    ServerKeyBits 2048
    SyslogFacility AUTH
    LogLevel INFO
    LoginGraceTime 60
    PermitRootLogin no
    RSAAuthentication no
    PubkeyAuthentication yes
    PasswordAuthentication no
    PermitEmptyPasswords no
    PAMAuthenticationViaKbdInt no
    Compression yes
    KeepAlive yes
    ClientAliveInterval 30
    ClientAliveCountMax 4

    Just a quick important NOTE: If PasswordAuthentication is set to no as is in the case above then you cannot login from a remote machine using a username/password.

    Seeing what all hardware there is:

    emerge pciutils
    lspci

    How to configure the vanilla-sources for Dell Latitude D820:

    Here is what all are installed for me:

    00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
    00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
    00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
    00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
    00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
    00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 01)
    00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 01)
    00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 01)
    00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
    00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
    00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
    00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
    00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e1)
    00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 01)
    00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 01)
    00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
    03:01.0 CardBus bridge: O2 Micro, Inc. Cardbus bridge (rev 21)
    03:01.4 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02)
    09:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5752 Gigabit Ethernet PCI Express (rev 02)
    0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

    Use the following website during you gentoo kernel configuration. I could not find some of the settings mentioned in the wiki. I am hoping it is because I am utilizing the vanilla-sources instead of the gentoo linux kernels. The reason I am using vanilla sources is again to stay very close to the original source as possible.

    Anyways I have decided to put X11 on the system. These are the steps I had to do:

    1. emerge xorg-x11
    2. env-update
    3. source /etc/profile
    4. Xorg -configure
    5. X -config /root/xorg.conf.new
    6. cp /root/xorg.conf.new /etc/X11/xorg.conf
    7. startx

    After this emacs was installed. I then installed XPDF.

    I also installed syslog-ng by doing the following:

    1. emerge syslog-ng
    2. rc-update add syslog-ng default

    Written by tringer

    January 10, 2008 at 1:04 pm

    Posted in Uncategorized

    Postgres – cheat sheet

    without comments

    Setup (http://www.postgresql.org/docs/8.1/static/tutorial.html):

    If you use MacPorts to do your postgres install then remember to append the path for the postgres install location to your PATH variable in the .bash_login file (this should be in your home directory). In my case it is:

    “/opt/local/lib/postgresql81/bin”

    1. Setting up Postgres
      1. mkdir data (this is for the database file)
      1. initdb -D data (initialize the database file)
    2. Starting the database
      1. pg_ctl -D . start -l logfile (remember here the . signifies the present directory. Your log file may not be here)
    3. Stopping the database
      1. pg_ctl -D . stop -l logfile
    4. For more information on pg_ctl type:
      1. pg_ctl –help
    5. Using PSQL (type psql –help)
      1. To list all the databases: psql -l
    6. Default HOSTNAME: “localhost”
    7. Default PORT: “5432″
    8. Default NAME: “the username you used to set it up”
    9. Create your DB:
      1. createdb dbname
    10. Delete your DB:
      1. dropdb dbname
    11. Connect to the database using:
      1. psql dbname
      2. psql \du (this will list the users in your database)
    12. Creating a user:
      1. create user username password pass
      2. psql \du (this will list the user in your database)
    13. Give the user all rights for the database you created:
      1. grant all on dbname.* to username
    14. Show all the tables in a database:
      1. \dt

    Also, something else that might be helpful is pgAdmin III. It is a gui for postgres.

    Written by tringer

    January 8, 2008 at 9:06 pm

    Posted in Uncategorized

    Tagged with

    Installing python, django, postgres, psycopg2 for Mac OS X

    with one comment

    To install:

    1. Python 2.4.4
    2. Postgres 8.1
    3. Django 0.96
    4. psycopg2 — this is the postgresql adapter for python

    Installation:

    1. The real pain is psycopg2. (You need this and will solve everything!)
      1. To avoid this just use MacPorts to install psycopg2. I did it by running the command “sudo port install py-psycopg2″. This will also install Postgres 8.1 and install python 2.4
      2. Make sure you have the PATH value defined for the new python 2.4 in your .bash_login file in your home directory.
      3. Now use MacPorts to install django 0.96.

    By doing this we stay out of the MacPython stuff. What happened to me was initially I had installed MacPython 2.5 using the installer, then I installed django 0.96 and postgres. But when I had to install psycopg2, then the real trouble began. So I reverted to using MacPorts and I used the steps I have mentioned above.

    Please, if you need some quick tips about how to use MacPorts, look at my earlier post. It will save you some time digging around.

    Written by tringer

    January 7, 2008 at 5:43 pm