Blog

Printing a Single Line by Line Number with Sed

20.05.2006 at 22:50

Well it turned out that I am not yet that comfortable in shell scripting. I often get error messages which indicating the line numbers on which a problem occurs and I wanted to print that single line of a given file. So I ended up with a solution which was built upon a combination of head and tail, before I finally realized that sed is the right tool for the job.

sed -ne 7p filename

Prints out line number 7 of filename, if you want some context which is likely then supply a range instead of a single line, which can be accomplished as follows.

sed -ne 5,10p filename

Marc

read more comments

Avoid Console Beeping (within VMware)

20.05.2006 at 10:01

In the office where we have Windows clients I quite often use VMWare to test something. In Debian by default the shell beeps if there are multiple possibilities after hitting [Tab], well this gets pretty annoying over time. The obvious and simplest solution would be to just disconnect the virtual sound device from the VM. However, if you need/want sound in some cases this is not ideal. So i ended up with the following settings in my ~/.inputrc or system wide /etc/inputrc.

set bell-style none

Marc

read more comments

MySQL Administration: Backup and Security Strategies on Linux

16.04.2006 at 19:51

I found the following slides from the OpenSource Database Conference 2005 which cover MySQL Administration: Backup and Security Strategies on Linux quite interesting.

Marc

read more comments

PHP Development with Eclipse

15.04.2006 at 22:43

With PHPEclipse there is a decent plugin for PHP within Eclipse available, although it isn't yet as feature rich as Eclipse for Java development it is quite usable. In combination with the Subversion plugin development becomes even easier.

For both PHPeclipse and Subclipse are well documented install instructions available.

Note that there is also an official PHP-IDE from Eclipse which is developed together with Zend. This is however in a early development state and I haven't had time to take a closer look at it. In the long term this is probably the solution to go with.

All in all I am quite happy with the development environment.

Marc

read more comments

Subversion Backend Selection and Authentication Configuration

25.03.2006 at 23:31

After a few DB corruption and journal recovering with the Berkley DB backend I strongly advise you to use the filesystem based backend instead. I think it is by now the default, but to be sure set it on the command line. By the way here is a comparison of the different backends. Personally I like the fact that if needed the repository data can be manipulated by standard tools.

svndadmin create --fs-type fsfs repo

Once the repository is created you can add your files.

svn import . file:///home/svn/repo -m "Initial commit."

Authentication with svnserve (from the docs)

The default svnserve setup provides anonymous read-only access. This means that you can use a svn:// URL to checkout and update, or use the repo-browser in TortoiseSVN to view the repository, but you won't be able to commit any changes.

To enable write access to a repository, you need to edit the conf/svnserve.conf file in your repository directory. This file controls the configuration of the svnserve daemon, and also contains useful documentation.

You can enable anonymous write access by simply setting:

[general]
anon-access = write

However, you will not know who has made changes to a repository, as the svn:author property will be empty. You will also be unable to control who makes changes to a repository. This is a somewhat risky setup!

One way to overcome this is to create a password database:

[general]
anon-access = none
auth-access = write
password-db = userfile

Where userfile is a file which exists in the same directory as svnserve.conf. This file can live elsewhere in your file system (useful for when you have multiple repositories which require the same access rights) and may be referenced using an absolute path, or a path relative to the conf directory. The userfile should have a structure of:

[users]
username = password
...

This example would deny all access for unauthenticated (anonymous) users, and give read-write access to users listed in userfile.

Just in case you do not already know, there is an ebook online which covers Subversion in depth.

Marc

read more comments

<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 >>