Gnome startup errors.

December 24th, 2009

Latest GDM has troubles with starting off the /etc/ttys. Oldschool tricks are not working anymore. GDM started flawlessly, but as soon as I entered my username/password combination it just pushed me out back to the GDM login screen.

Solution was easy: do not run GDM from /etc/ttys. Use the following rc.conf knob instead:  gnome_enable=”YES” and restart the box (or cycle to the single user mode and back)

Back after a long break

December 24th, 2009

Plenty of time has passed since I made my last post. I am feeling guilty for not being able to update in time. Anyway, now I am back and planning to continue my blog at the same pace as it was before.

First of all I have installed FreeBSD 7.2 onto my Lenovo s10E netbook recently. All works fine except ACPI and WIFI. Did a 8.0 upgrade from sources and still no luck.

Some people on official freebsd forums were mentioning experimental bwi driver which is worth to try during spare time I believe.

And yes, ACPI is not that important as WIFI is.  For now, I am using the ethernet cable without being able to walk around the flat and do things on the go.

bakinternet ISP and MTU on a FreeBSD gateway

March 2nd, 2009

Recently Bakinternet has changed their system to use PPPoE for ADSL subcsribers without any written or oral communication.

If you are unlucky guy using Bakinternet ADSL subcsription behind a FreeBSD NAT, then make sure that the MTU value on the external network interface of the FreeBSD gateway is set to 1492 otherwise you may get half-loaded web pages and other quite annoying symptoms. MTU value of 1492 can be set using the following command under root:

ifconfig em0 mtu 1492

where em0 is the interface connected to the ADSL modem.

ibm t61 & FreeBSD 7.1 RELEASE

February 27th, 2009

Today I was playing around with the IBM t61 laptop. I have successfully installed FreeBSD on it with everything working fine except wireless adapter which just randomly hangs.

  • Intel Mobile 965 Integrated Graphics Controller support is available from /usr/ports/x11-drivers/xf86-video-intel .Do not install it as a package. This is what I did first and got unrecognized symbols while loading the driver. Recompiled it from the source and everything started fine.
  • Added Option “AutoAddDevices” “false” to ServerFlags in xorg.conf to make my mouse and keyboard work in the newest xorg-server
  • Wireless adapter support is available via wpi(4) driver from the base system. I am not satisfied with the performance, though. man wpi for additional information.

www/c-icap port fix

February 14th, 2009

It turns out that www/c-icap port is marked broken for more that 6 months due to the clamav related compilation problems:

srv_clamav.c: In function ’srvclamav_init_service’:
srv_clamav.c:150: warning: implicit declaration of function ‘cl_loaddbdir’
srv_clamav.c:164: error: ’struct cl_limits’ has no member named ‘maxratio’
srv_clamav.c: In function ‘must_scanned’:
srv_clamav.c:445: warning: pointer targets in assignment differ in signedness
*** Error code 1

After reading through the clamav sources I have recognized that usage of the cl_loaddbdir() function has been abandoned in favor of cl_load(). Furthermore, cl_limits does not contain maxratio member anymore. After fixing both of this issues the port compiled and started just fine.

The patch has been submitted to the maintainer. Meanwhile you can take it from here: c-icap + clamav >= 0.93 patch

UPDATE:

My patch has been incorporated into the FreeBSD ports tree. Additionally, I have been appointed to be a maintainer of this port.

portmaster vs portupgrade

January 21st, 2009

If you have portupgrade installed - then it is time to replace it with portmaster.

Portmaster is a handy script written for /bin/sh and needs no additional dependencies to be installed as portupgrade does.

Portmaster is located in /usr/ports/ports-mgmt/portmaster.

icecast2 FreeBSD problem

January 11th, 2009

Recently, I have updated my icecast installation to the latest version (2.3.2) available from the FreeBSD ports colletion. Update went fine, but icecast did not start. The only message it spit was:

Server startup failed. Exiting

have recompiled icecast with gdb support and found out that the problem is on the following line of the net/sock.c:

if (getaddrinfo (sinterface, service, &hints, &res))
return SOCK_ERROR;

After digging more into this I have discovered that sinterface holds the hostname of my server, not the numerical ip address which contradicts with the fact that hints.flags forces numeric address usage according to the AI_NUMERICHOST bit set:

hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG | AI_NUMERICSERV | AI_NUMERICHOST;

After disabling AI_NUMERICHOST and recompiling - icecast started fine.

Decided to post this information here so anyone who comes across this issue can solve it quickly.

ipod nano notes size limit hack

December 26th, 2008

I have bought an ipod nano with 8gb storage space recently. After playing some time with this fancy device I have discovered that each note kept on the ipod can not exceed 4k limit. To circumvent this limit one should divide his big note into pieces of 4k each. Furthermore, it is possible to place html links to point pages.

Below is a simple python script which reads stdin and creates ipod-compatible ebook which can be uploaded and read on your beloved device. Simply cat a big note to the script’s stdin and do not forget to define an ebook name. After successful completion of the script you will get a new directory in cwd containing all pages of your ipod ebook. Sample usage is like this:

cat /path/to/big/myebook | ./ipod_ebook.py myebook


#!/usr/local/bin/python2.5
import sys
import os

# 4k bytes in one page is allowed
ebook_page_bytes_count = 4000

if len(sys.argv) != 2:
  print "Usage: ", sys.argv[0], “ebook_name”
  sys.exit(-1)

try:
  os.mkdir(sys.argv[1])
except OSError:
  print sys.exc_value, “\nCould not create directory:”, sys.argv[1]
  sys.exit(-1)

j = 0
i = 0
ebook_page = open(sys.argv[1] + “/” + sys.argv[1] + str(j),”w”)
ebook_page.write(”<?xml encoding=\”utf-8\”?>\n”)

for line in sys.stdin:
  if i >= ebook_page_bytes_count:
    # Link to the next page at the bottom of the current page
    ebook_page.write(
    “\n<A HREF=\”" + sys.argv[1] + str(j + 1) + “\” NOPUSH>to page #”\
    + str(j+1) + “</A>”)
    ebook_page.close()
    j = j + 1
    i = 0
    ebook_page = open(sys.argv[1] + “/” + sys.argv[1] + str(j),”w”)
    # Ebook page header
    ebook_page.write(”<?xml encoding=\”utf-8\”?>\n”)
  ebook_page.write(line)
  i = i + len(line)

Supermicro servers and tehnical support

December 10th, 2008

Before bying any of the Supermicro servers be sure to read this. Ridiculous.

I have also had a bad luck with Supermicro servers in past. USB KVM completely refused to work.

Basin Modeling center at the Geology Institute of Azerbaijan

December 9th, 2008

One of the recent projects I was working on got a media coverage available here (russian version).

Newly established Basin Modeling department at the GIA will be involved in geological data analysis for BP.

As a part of this project 4 Centos based workstations were installed as well as the Gocad software suite with flexlm license manager.

sony dsc h2 camera with FreeBSD

October 9th, 2008

Recently I was trying to make my Sony DSC H2 camera work under the FreeBSD operating system. My first try was unsuccessful: umass0 device successfully initialized, but no disk device appeared.

Here is what I got in the log file:
Oct 7 21:14:37 schizo kernel: umass0: Sony Sony DSC, rev 2.00/6.10, addr 2

Solution was quite simple. Add the following usb quirk to the umass.c:

{ USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC, 0×0610, UMASS_PROTO_RBC | UMASS_PROTO_CBI, RBC_PAD_TO_12}

Do not forget to recompile, install and kldload umass afterwards:

  • cd /usr/src/sys/modules/umass
  • make clean && make && make install

As soon as you reattach the camera a disk device should appear which can be easily mounted like this:

  • mount_msdosfs /dev/YOUR_DISK_DEVICE_NAME /mnt

mini_snmpd FreeBSD port

September 30th, 2008

mini_snmpd written by Robert Ernst is a lightweight snmp daemon targeted mainly for the embedded platforms according to the description on the official page. As FreeBSD is making its way to the embedded platforms I have decided to port it to my favorite operating system.

It turned out to be an easy task. In fact, I have updated the header #include statements to make compilation happy under FreeBSD.

In order to get it all working do the following:

  1. Download original sources from the official page and unpack them
  2. Download the patch from the following location
  3. cd to the original sources directory and apply the patch: patch < /path/to/patch_file
  4. define the __FREEBSD__ knob in CFLAGS inside the Makefile
  5. make
  6. mount_linprocfs procfs /proc
  7. ./mini_snmpd to start the daemon

You should get 161 udp/tcp ports listening upon successful start. In order to test your shiny new snmpd you may need a net-mgmt/net-snmp port to be installed.

day.az has been knocked down for one day long

August 11th, 2008

One of the high-volume online news agencies has been put to its knees today.

tqdk.gov.az knocked down by pupils

June 10th, 2008

www.tqdk.gov.az was going to release results of nation-wide school completion examinations today at 6 pm.

Half hour has passed already, but the site is still spitting an ugly message:

Server is too busy

I wish government agencies payed more attention to such critical web services in future.

Stealth ssh login

June 1st, 2008

This is ridiculous, but if you execute a shell directly from the ssh command-line your login will not be reflected in wtmp or utmp. This means that w, who, last and friends will not be able to recognize your presence on a system.

Try it:

ssh username@hostname /bin/sh

(you can use any shell of your choice here. Be sure to include the absolute path) Due to the absence of the environment variables you will not see a shell prompt, but the shell will be waiting for your commands anyway.

One week to 6.2-RELEASE EOL

May 24th, 2008

A busy month is over hopefully.

Support of 6.2 release is going to be dropped on May 31 according to this table. Today is 24′th of May and I’ve started to transition my servers to 6.3 release which is going to be supported until January 31, 2010.

Enderunix team

April 24th, 2008

Turkish Enderunix team is going to host a FreeBSD conference. There are plenty of interesting topics to be spoken during this event. Some of them are shown in the rest of this post.

Read the rest of this entry »

Kyocera UTU/UTD driver now in the FreeBSD ports tree

April 22nd, 2008

Kyocera UTU/UTD driver has been incorporated into the FreeBSD ports tree according to the short message received today:

Synopsis: new port comms/ib
State-Changed-From-To: open->closed
State-Changed-By: osa
State-Changed-When: Tue Apr 22 07:57:44 UTC 2008
State-Changed-Why:
Committed with totaly modifications, thanks!

The port is available from comms/ib-kmod destination. Currently only 6.x releases are supported. Planning to complete 7.x support asap.

I would like to express my gratitude to Sergey Osokin (osa@freebsd.org) for pointing out and fixing issues with makefiles.

UPDATE 25/04/08:
this port compiles only on 6.x releases. I am offered a 7.0 box to work this out. Will update asap.
UPDATE 27/04/08:
7.0 support has been completed. Patch has been sent to committer. Waiting for the commit confirmation.
UPDATE 28/04/08:
7.0 support has been committed to the official ports tree.

Limiting available memory

March 28th, 2008

A while ago, I’ve upgraded my system from 512M to 1G ram without growing my swap partition. This means that it is impossible to take standard kernel crash dumps, because swap partition is twice less than actual ram. Being lazy is a pleasure, so I left things as they are.

Some time later I had decided to test an experimental driver which have panicked without even giving any chance to get a core because of a little size of the swap partition. I was about to get a screwdriver in order to downgrade my box to 512M ram and get the crash dump successfully, but something stopped me. As usual there was much simpler solution by limiting the ram amount using hw.physmem sysctl. This sysctl is read only, so the only way to set it is during the boot time:

schizo# grep phys /boot/loader.conf
hw.physmem=”512M”
schizo#

After getting my crash dump I’ve deleted this option and got my 1G ram back.

Operating Systems and System Programming course from Berkeley

March 26th, 2008

The Operating Systems and System Programming course is available for download here.

This course is very useful for those who are interested in UNIX-like operating systems internals.