Latest Publications

Establishing and maintaining a backup of mobile phone user media files

This is the procedure for establishing and maintaining a backup of user media files, such as pictures, movies and songs, that are stored on a mobile phone. It is assumed, that USB is used.

In our example, we will use a Nokia 5300 mobile phone and an Ubuntu computer.

Attach the USB cable to the phone and to the computer. If the phone does not respond to this, unplug the cable, turn the phone off, turn the phone on and try again. When the phone responds, select data transfer. On the Ubuntu computer, a dialog appears. Select Cancel.

Now, that the connection is established and the mobile phone is mounted, we can do the data transfer. We ensure, that the backup directory exist, and copy all changes between the mobile phone and the backup directory using rsync.

This means, that the first run will take more time than the following runs, and, that deleted files on the mobile phone will be deleted on the computer.

mkdir -p -m 0700 ~/nokia_5300
rsync -a --delete /media/disk ~/nokia_5300
umount /media/disk

This procedure does not replace the Nokia PC Suite backup procedure for the mobile phone, which also copies calender, messages, internal settings and more.

Print

Implementing an open source multiuser invoice system

First, we define our requirements for a multiuser invoice system. These will help us find the right system.

  1. The system should be available as open source and have an online demonstration or satisfying screenshots.
  2. The system should be easy to install, easy to backup, easy to restore, easy to use, have a neat layout and use English language.
  3. The system should be able to handle users, billers, customers, products, currency, tax rate, number series, payments and conditions.
  4. The system should be able to produce an order (offer), an invoice and a credit invoice in a printable and a sendable format, such as PDF or HTML. These should include a unique number, biller information, customer information, date, product specification, currency, tax rate, payments and conditions.
  5. The system output should be easy to modify, such as translating invoices into other languages.

We will do a quick search on Google, take a quick glance at the results and pick a bunch of possible candidates, that we will test against our requirements.

Possible candidates are Bamboo Invoice, Simple Invoices, Siwapp, My Client Base and phpBMS.

Now, we can put the candidates to the invoice test, one by one. We simply want to create a user, create a biller, create a customer, create a product, set currency, set tax rate, define conditions and produce an invoice. We will use online demonstrations, when available.

Bamboo Invoice does not seem to handle products nor seem to be able to produce an order. However, those are acceptable deviations.

Simple Invoices does not have a neat layout. Invoices look horrible. This is not acceptable.

Siwapp does not seem to handle customers nor products. Handling of currency is deviating from DKK to DKr. Invoice does not contain biller information. This is not acceptable.

My Client Base does not seem to have an online demonstration nor screenshots. This is not acceptable.

phpBMS does not seem to handle users and aims for integration within a business. It seems, that configuration are done elsewhere than in the online demonstration. This is not acceptable.

Bamboo Invoice, developed by Derek Allard, seems to be the best candidate. We download the latest source, unpack it and follow the installation instructions. It seems, that users are actually not supported, thus only one user and one biller can use the installation. This is not acceptable.

Leaving us with no acceptable candidates left, our recommendation for an open source implementation of a multiuser invoice system is, that the system must be developed, either as a spin off from one of these candidates or from scratch.

If you are in need of a quick way to invoice your customers using open source software, we recommend using the OpenOffice spreadsheet to produce a master invoice, that meets legal requirements. Then use the master invoice as a template for invoicing your customers. This will also help you define the invoice layout for your future invoice management system.

Print

How to change group ID and user ID in Ubuntu

When working with a network file system (NFS), it is necessary, that users has the same unique user ID and group ID on all machines in order to ensure read and write privileges.

Changing user ID and group ID for a user is not as easy as it sounds. If not done correct, such changes can cause the user account to fail. If the user has encrypted files and folders, then these changes will cause the user account and associated files and folders to fail.

In this example, we want to configure an Ubuntu 9.04 workstation to match the user ID and group ID, that are used on a network file system.

We need to perform this procedure while logged in as a user, that has system administrator privileges, and, that is not the same user as the one, that need to have changes to user ID and group ID done. If no other user exist, we need to create one from

If the group for our users does not exist, we create it at this point.

groupadd -g 1001 users

If the group for our users exist with a wrong ID, then we change it.

groupmod users -g 1001

We change the user ID and the group ID for users. Files in the user home will have their ownership updated automatically. In our example, the group ID and the user ID for Ann is changed to match the network file system and the operating system is rebooted.

usermod -g users -G adm,dialout,cdrom,floppy,audio,plugdev,lpadmin,admin,sambashare -u 1009 ann

reboot

Confirm, that users and groups was changed as expected by inspecting the files passwd and group in /etc.

Print

How to configure NFS

On large networks, it might be more convenient to configure a central NFS server in which to store all the user home directories. These home directories can then be exported to the network so that users would always have the same home directory, regardless of which workstation they log in to.

Several machines could have a common source directory. That way, when you need to install a port on several machines, you can quickly access the source without downloading it on each machine.

In our example, we want to configure an NFS server on a FreeBSD 7.2 operating system, so one or more Ubuntu workstations can mount and work on central home directories on the server.

It is assumed, that users has the same user ID and group ID on all machines.

On the server, we need to make sure, that the NFS server nfsd is started at boot time, that it serves TCP NFS clients, that it serves UDP NFS clients, that it creates a specific amount of servers, and, that it binds to a specific IP address. If the server has more than one network interface, this is important.

We also need to make sure, that the mountd utility, that listens for service requests from NFS clients, is started at boot time. We might want to allow for regular files to be served as well.

vi /etc/rc.conf

nfs_server_enable="YES"
nfs_server_flags="-t -u -n 4 -h 192.168.1.10"
mountd_flags="-r"

Then we need to configure the remote mount points for the NFS client requests. That is, which directories, homes, that are shared. This is done in the exports file. We want to share specific homes, translate their local credentials to the remote credentials, and, lock the share to a specific IP address.

vi exports

/usr/home -maproot=root -alldirs -network 192.168.1 -mask 255.255.255.0

If you make changes to this configuration, the mountd utility must be restarted. Any errors will be logged using syglogd.

killall -HUP mountd && tail /var/log/messages

Now, we need to install the NFS client on the Ubuntu workstations.

sudo apt-get install portmap nfs-common

Then we configure the static information about file systems.

sudo nano -w /etc/fstab

starnix:/usr/home/ann /home/ann/starnix nfs rw 1 1
starnix:/usr/home/bill /home/bill/starnix nfs rw 1 1

Make sure, that the local directories exist.

That’s it. We mount the remote file systems, specified in the static table, and we can use the central homes.

sudo mount -a

Print

How to mount an external USB storage device

In this example, we will attach an external Trust USB card reader to a FreeBSD 7.2 machine.

Our memory card is inserted into the card reader, and the card reader USB cord is then plugged in. The USB port will be probed by the generic mass storage driver and we can then fetch the device name, that can be used to mount the external file system on the memory card. We can fetch the result using the dmesg utility.

dmesg | grep sectors

In our case, the result is da0, which is very common for USB storage devices.

We can get more information about the file system from the devices.

ls /dev/da0*

This reveals, that the file system of our interest is da0s1. We can now mount the external file system. In this example we know, that the file system is MSDOS. This is a very common file system from digital cameras, such as Canon IXUS.

mkdir -p -m 0700 /mnt/usbcard
mount -t msdosfs /dev/da0s1 /mnt/usbcard

If we attach an USB storage device, such as an external harddisk, that we would like to store an external backup on, preformatted with a native file system, we could mount it without specifying the file system type.

mkdir -p -m 0700 /mnt/backup
mount /dev/da0 /mnt/backup

When we are done, we need to unmount the external devices again.

umount /mnt/backup
umount /mnt/usbcard

Print

Installing a laser printer in Ubuntu 9.04

Installing a laser printer is actually straight forward, if you keep in mind, that most laser printers has standard queues, from which they accept input. One of these is the raw queue, also referred to as RAW or RAW1. Using this, you do not have to mingle with drivers in the operating system or drivers from the vendors.

Select “System”, “Administration” and “Printing”. Select “New” and “Printer”. Using the guide, select “Generic” and “Raw Queue”.

Open a browser, such as Firefox, and open a website, that contains simple text and graphics, such as the front page of Google. Configure printer options, such as paper size, headers and footers. Print the page and adjust as necessary. Margins and other options can be set in the “Printing” utility from before. Select the installed laser printer, “Printer”, “Properties” and “Job Options”.

In this case, a Dell 1710N network laser printer was installed.

Print

Solving a missing shared object problem

The following error was returned when trying to start smbd on a FreeBSD 7.0 operating system after a power failure in a failed uninterruptible power supply (UPS).

/libexec/ld-elf.so.1: shared object "libcrypt.so.15" not found, required by "libgnutls.so.26"

Assuming, that ports, that depend on libgcrypt, has to be reinstalled, the following procedure is executed. libgcrypt is a general purpose cryptographic library based on the code from GnuPG.

A tool, named portupgrade, that can perform a recursive reinstall, is installed. Before that, the ports tree is updated. Assuming, that portsnap has been used to update the ports tree before, the ports tree is updated using the update feature of portsnap.

portsnap fetch
portsnap update
cd /usr/ports/ports-mgnt/portupgrade
make install

All ports, that depend on libgcrypt, is upgraded.

portupgrade -rf libgcrypt

Unfortunately, portupgrade failed to complete due to a major version problem with libtool. This is also referred to as a version bump, that occurs because some programmers hardcode their versions, which causes critical dependancy failures. libtool is deleted and reinstalled before we try again.

pkg_info | grep libtool
pkg_delete libtool-1.5.24
cd /usr/ports/devel/libtool22
make install
portupgrade -rf libgcrypt

This time portupgrade completed with succes and the problem was solved.

Print

Filtering Facebook quiz results

Quiz applications and their results are a huge problem on Facebook. They appear frequent and tend to spread like virus through exploiting lists of friends. Some of them even lead to loss of money.

Use this procedure to block them by adding a filter to Firefox.

First, we need to add a script parser, that can parse user scripts. Visit the homepage of Greasemonkey. Confirm, that you are using a version of Firefox, that the Greasemonkey add-on supports. Download. Restart Firefox.

Second, add the user script, that will do the filtering. Visit userscripts.org, which is a website, that offers user scripts and extra features for your browser. Install Facebook Purity.

If you are actually updating the script, you need to uninstall the old version first. Updating is necessary from time to time as Facebook implements changes.

Print

A more neat desktop in Ubuntu

The default desktop in Ubuntu is actually pretty neat. However, there are a few quick options, that optimizes the look, feel and practical usage.

The default desktop shows two grey bars. There is one on the top and one on the bottom. Let’s make this a little more neat. Disable the bar on the bottom. Move the bar to the bottom. Make the background solid and transparent. Delete the launch icons or just the ones, you will not be using.

Double clicking a window title bar will maximize the window. Not very practical as the button in the upper right corner does this. Change this, so the window will roll up instead, which is more useful when working with many windows. It is done by clicking System, Preferences and Windows and changing the title bar action.

You might want to use more workspaces. This is configured by temporarily adding the workspace switch panel and configuring it. If you also want to make use of the cube below, then 4 work spaces is recommended.

Let’s use some neat graphics. It is assumed, that Compiz Fusion is installed.

If Compiz Fushion is not enabled yet, do so now by clicking System, Preferences, Appearance and Visual Effects. Select Extra. Click System, Administration and Hardware Drivers. Activate the recommended proprietary driver.

Click System, Preferences and Compiz. Disable Negative. Enable Opacity. Not to confuse with Opacify! Enable Desktop Cube. Enable Rotate Cube. Disable Wobbly Windows. Enable Screenshot.

The overview of workspaces is shown by pressing Super-E. Rearrange windows by dragging them with the mouse. Press Right and Left followed by Enter to switch to another workspace.

The switch between workspaces, directly from one to another, is done by pressing Ctrl-Alt-Right and Ctrl-Alt-Left. The active window is moved along by adding Shift.

Window transparancy is adjusted by pressing Alt and then rolling the mouse scroller as appropriate.

CubeRotating the cube, which is a kind of impressive way to switch between workspaces, is done by pressing Ctrl-Alt-MouseLeft and then moving the mouse around as appropriate.

Taking a partial screenshot is done by pressing Super+MouseLeft and then dragging a box around what should be in the partial screenshot.

Taking a screenshot of the entire screen, also when looking at the cube, is done by clicking Applications, Accessories and Take Screenshot. Use the delay feature.

Now, you might want to configure the look and feel of your applications. You might also want to check out available themes from gnome-look.org.

Print

Profile

Our business profile has now been written and published on our website.

The purpose of our business profile is to give an introduction to Open Tech SmbA and describe how we can help businesses of our customers with good practise of system and network administration.

Print