Linux

Technical Notes

These notes are my personal online notebook of useful commands and "how-to's". You are welcome to make use of them if you find them helpful. They obviously don't come with any warranty! Click on one of the category tags above for the notes in any category.

Quoting options in bash paramenters

[writeup] **Warning: Tag still open at end of document: "pre" **** Warnings occurred ****

I have spend hours searching for the answer to this problem, so now I have found it I will post it.

Demonstrate problem

Suppose I have a program that takes an option in the form:

myprog -t "Title of Document"

To test this we will create a script: testopt.sh

#!/bin/bash
echo option: «$1», title: «$2», ignore: «$3»

When we run it we get:

./testopt.sh  -t "Title of Document"
>> option: «-t», title: «Title of Document», ignore: «»

The problem shows up if instead of passing the arguments directly, we use a variable:

opt='-t "Title of Document"'
./testopt.sh  $opt
>

Webdav server setup under CentOS 6

I am about to set up a webdav server under CentOS 6.0
Here are some web sources:
-http://www.cyberciti.biz/faq/rhel-fedora-linux-apache-enable-webdav/
-http://www.stigmatedbrain.net/drupal/?q=node/69

Installing Microsoft Access on Crossover Office

Office 97

1. Install package from CD
2. From a previous Windows install, copy system.mdw into .cxoffice/Microsoft Office 97/drive_c/windows/system32/
3. Download SR1, SR2b and the jet upgrade to SR2
4. Open the C/O bottle, find the run command and run each service pack in turn

Note that this crashed when I tried to open an Access form

Office XP

-It seems to only install into a Win98 bottle
1. Install package from CD
2. Download InstMsiA.exe - the Windows Installer 2.0 Redistributable for Windows 95, 98
3. Download SP3 for office XP

Benchmark for Linux

Here are a few CPU oriented benchmarks for Linux.
I am not sure if they are available in packages for CentOS, so I have only given the Ubuntu packages:

(Please note that you will have to enable the community repositories for these)

rebuilding initrd

#to unpack into a new folder
initfile=/mnt/initrd-2.6.18-194.11.1.el5.img
mkdir new; cd new
gunzip < $initfile | cpio -id

#make changes and rebuild with:
find ./ | cpio -H newc -o > ../initrd.cpio
cd ..
gzip initrd.cpio
mv $initfile ${initfile}.old
mv initrd.cpio.gz $initfile

Linux remote access

Gnome shortcut keys

General keyboard shortcuts

Ctrl+A = Select all (In Documents, Firefox, Nautilus, etc, not Terminal)
Ctrl+C = Copy (In Documents, Firefox, Nautilus, etc, not Terminal)
Ctrl+V = Paste (In Documents, Firefox, Nautilus, etc, not Terminal)

F9 = Toggle Sidebar
F2 = Rename
Ctrl+Shift+N = Create new folder

Ctrl+N = New (Create a new document, not in terminal)
Ctrl+O = Open (Open a document, not in terminal)
Ctrl+S = Save (Save the current document, not in terminal)

Installing NX Server

  • Install NX (info from this page: http://www.nomachine.com/download-package.php?Prod_Id=355 )

    CentOS 6.0 64bit

    yum install wget #must be logged on as root
    NXVER=3.5.0
    CVER=7
    NVER=4
    SVER=5
    ARCH=x86_64
    NXURL=http://64.34.161.181/download
    wget $NXURL/$NXVER/Linux/nxclient-$NXVER-$CVER.$ARCH.rpm
    wget $NXURL/$NXVER/Linux/nxnode-$NXVER-$NVER.$ARCH.rpm
    wget $NXURL/$NXVER/Linux/FE/nxserver-$NXVER-$SVER.$ARCH.rpm
    rpm -i nxclient-$NXVER-$CVER.$ARCH.rpm
    rpm -i nxnode-$NXVER-$NVER.$ARCH.rpm
    rpm -i nxserver-$NXVER-$SVER.$ARCH.rpm

yum

Documentation: http://www.centos.org/docs/5/html/yum/index.html

You can install repository priorities: http://wiki.centos.org/PackageManagement/Yum/Priorities
But a better solution might be to leave the extra repos disabled in the yum configuration and
install/update the packages you want from them with:
yum --enablerepo=reponame install packagename

Syndicate content