Installing Samba

Running on CentOS 4.1 the following steps were use to install Samba.

Install RPM’s
$ rpm -ivh samba-3.0.10-1.4E.i386.rpm
$ rpm -ivh samba-swat-3.0.10-1.4E.i386.rpm

Start Processes
$ /etc/rc.d/init.d/smb start


Check Processes
$ ps -ef | grep smb
root 21243 1 0 10:19 ? 00:00:00 smbd -D
root 21244 21243 0 10:19 ? 00:00:00 smbd -D
$ ps -ef | grep nmb
root 21248 1 0 10:19 ? 00:00:00 nmbd -D

Enable on System Reboot
$ chkconfig smb on
$ chkconfig –list smb

Configure SWAT (web interface to administer samba)
$ vi /etc/xinetd.d/swat

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat 
#              to configure your Samba server. To use SWAT, 
#              connect to port 901 with your favorite web browser.
service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
#       only_from       = 127.0.0.1
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = no
}

$ killall -SIGHUP xinetd
$ tail /var/log/messages

Sep 13 10:17:18 omega xinetd[2160]: Starting reconfiguration
Sep 13 10:17:18 omega xinetd[2160]: Swapping defaults
Sep 13 10:17:18 omega xinetd[2160]: Reconfigured: new=1 old=0 dropped=0 (services)

Verify Settings

Using the installed SWAT, simply point the browser to http://111.111.111.111:901/

Htaccess is root and the system root password

Configuring Samba, well that’s another story.

Brisbane MySQL Users Group

By accident I came across a MySQL Users Group in Brisbane .http://mysql.meetup.com/84/. I guess I should have thought about it sooner, I go to the QLD Java Users Group, I spent a long time going to the Oracle Users Group, and have been involved in an XP Users group.

Anyway, it was great to meet with other MySQL users, meet some local MySQL staff, get some inside news of events and products.
There was also a presentation on Ruby, yet another scripting language. The software creator had however introduced some nice features including build-in Unit Tests with the release, easy inspection of class methods, easy extensibility of system classes. The langauge architecture was very inteperative, based in C, however all system functions are provided and run from Ruby source.

New Techstuff Blog

Well, it was about time to move to a more standard Blog for my TechStuff, rather then mixing with my personal blog at http://blog.ronaldandanna.com.

As I wrote this blog software in a few hours one day, and never got around to finishing things like a calendar and RSS feeds, it was also another good excuse to try out Drupal.

Password protecting Apache Site for external users only

In order to make an intranet an extranet, you need to place the intranet on a server in the DMZ.
From here, configure a virtual server accordingly (e.g. intranet.site.com.au)

You will need to configure on an internal DNS (or smoothwall /etc/hosts when using a webproxy) a reference to intranet.site.com.au

Your global DNS for site.com.au should not have intranet specified. This should be invalid in some way. For example in my sites, I have a catch all domain that is an unknown.site.com.au and with wildcard DNS, any invalid domain URL’s in the *.site.com.au go here. For example, try http://intranet.ucb.com.au

Now, within your Apache Httpd conf VirtualHost directive you need to add the following.


<Directory "/home/intranet/www">
  Options Indexes

  Order deny,allow
  Deny from all
  Allow from 192.168.100
  Allow from 10.1.1
  Require valid-user
  Satisfy any

  AllowOverride AuthConfig
  AuthType Basic
  AuthName "Administration Access Only"
  AuthUserFile /home/intranet/.htaccess
</Directory>

You just need to create the appropiate .htaccess file, and restart Apache httpd. Access from the internal network is allowed via IP, and everything else must use the authentication model used.

To setup external access, I created a sepearate subdomain called extranet. To further restrict this past basic access, I configured to to connect to the firewall only on port 81, and then had a rule to redirect to port 80 on the DMZ machine.

So what I ended up with was:

http://intranet.site.com.au internally accesses the intranet.
http://intranet.site.com.au externally redirects to a custom invalid/unknown subdomain page
http://extranet.site.com.au throws a browser not error
http://extranet.site.com.au:81 prompts for a username/password to access intranet.

Moving from standard Apache httpd install to virtual hosts

1. First you need to create an appropiate directory for virtual host. (Using the example of creating an intranet)

$ su –
$ useradd intranet
$ chmod 755 /home/intranet # needed for apache nobody process
$ cd /home/intranet
$ mkdir www logs
$ cd www
$ echo “<html>
<head>
<title>intranet test index</title>
</head><body></body></html>
” > index.htm

2. Second, you need to reconfig Apache Httpd for virtual host management.

$ cd /opt/httpd/conf
echo “Include conf/httpd.include” >> httpd.conf
$ vi httpd.include

NameVirtualHost 111.111.111.111
<VirtualHost 111.111.111.111>
    ServerAdmin [email protected]
    DocumentRoot /home/intranet/www
    ServerName intranet.site.com.au
    ServerAlias intranet
    LogLevel info
    ErrorLog /home/intranet/logs/error.log
    CustomLog /home/intranet/logs/access.log combined
</VirtualHost>

3. Reboot Apache Httpd

$ apachectl graceful

Configuring SSH for automated rsync

In order to rsync files between two servers in an automated sense, you need to setup an appropiate SSH key between both the source and destination servers.

Destination Server

$ cd
$ mkdir .ssh
$ chmod 700 .ssh

Source Server

$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ ssh-keygen -t rsa
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/userch/.ssh/id_rsa.pub.
$ scp id_rsa.pub [email protected]:.ssh

Destination Server

$ cd .ssh
$ cat id_rsa.pub >> authorized_keys
$ chmod 600 authorized_keys

Source Server
$ ssh [email protected]

Should it not work, and you are prompted with password the ‘-v’ option may provide some more information to diagnose the problem.

Throttling the CPU on my laptop

Using CentOS 4.1 as the Operating System on my laptop for all my work, I’ve been able to throttle down my CPU when running on battery power to extend my battery life, much like the modes that Windoze provides.

$ echo 5 > /proc/acpi/processor/CPU0/throttling

If you want to go back up again:

$ echo 0 > /proc/acpi/processor/CPU0/throttling

Not to be thrown, the output of this file looks like:


[root@lamda ~]# cat /proc/acpi/processor/CPU0/throttling
state count:             8
active state:            T7
states:
    T0:                  00%
    T1:                  12%
    T2:                  25%
    T3:                  37%
    T4:                  50%
   *T5:                  62%
    T6:                  75%
    T7:                  87%

Change user file permissions when moving windows disk to new machine

Set, view, change, or remove special permissions for files and folders

Important: If you are not joined to a domain and you want to view the Security tab:

1. Click Start, and then click Control Panel.
2. Click Appearance and Themes, and then click Folder Options.
3. Click the View tab, and then click to clear the Use simple file sharing [Recommended] check box in the Advanced settings box.

To set, view, change, or remove special permissions for files and folders:

1. Click Start, click My Computer, and then locate the file or folder where you want to set special permissions.
2. Right-click the file or folder, click Properties, and then click the Security tab.
3. Click Advanced, and then use one of the following steps:
To set special permissions for an additional group or user, click Add, and then in Name box, type the name of the user or group, and then click OK.
To view or change special permissions for an existing group or user, click the name of the group or user, and then click Edit.
To remove an existing group or user and the special permissions, click the name of the group or user, and then click Remove. If the Remove button is unavailable, click to clear the Inherit from parent the permission entries that apply to child objects. Include these with entries explicitly defined here check box, click Remove, and then skip steps 4 and 5.
4. In the Permissions box, click to select or click to clear the appropriate Allow or Deny check box.
5. In the Apply onto box, click the folders or subfolders where you want these permissions applied.
6. To configure security so that the subfolders and files do not inherit these permissions, click to clear the Apply these permissions to objects and/or containers within this container only check box.
7. Click OK two times, and then click OK in the Advanced Security Settings for FolderName box, where FolderName is the folder name.

CAUTION: You can click to select the Replace
permission entries on all child objects with entries shown here that
apply to child objects. Include these with entries explicitly defined
here
check box. Therefore,all subfolders and files have all
their permission entries reset to the same permissions as the parent
object.If you do this, after you click Apply or OK, you cannot undo this operation if you click to clear the check boxes.

Dell 5150 Wireless under CentOS 4.0

1. Download ndiswrapper from http://ndiswrapper.sourceforge.net/

2. Install
make
make install
lspci
lspci -n

3. Identify and download Windows Driver.

http://ndiswrapper.sourceforge.net/phpwiki/index.php/List

# Laptop: Dell Inspiron 5100
Card: Wireless 1350 (802.11b/g) WLAN miniPCI Card
Chipset: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 02) notice this is revision 02, below is revision 03, Idon’t know if it matters or not
pciid: 14e4:4320
Driver: http://ftp.us.dell.com/network/R90501.EXE
Other: This card is in the miniPCI slot of the Inspiron 5100. The driver below (R83097.exe) did not work, but this one did. To install unzip (program “unzip” works on the .exe) the exe file and use bcmwl5.inf.

Dell 5150 64MB DDR nVidia Corporation GeForce FX Go 5200 under CentOS 4.0

ftp://download.nvidia.com/XFree86/Linux-x86/1.0-7174/README.txt

Directly following the Fedora Core 3 installation I had to get the video to
work. Therefore, at boot time, I went into the grub config file by pressing “e”
and added the following to the end of the kernel line.

linux single

sh NVIDIA-Linux-x86-1.0-7174-pkg1.run
vi etc/X11/xorg.conf

Driver “nv”
(or Driver “vesa”)

with

Driver “nvidia”

In the Module section, make sure you have:

Load “glx”

You should also remove the following lines:

Load “dri”
Load “GLcore”

Reference:

http://www.ccs.neu

Changing IE spinning logo and title

This tweak will change the animated bitmap image that displays when IE (or Outlook Express) is busy. This tweak also removes or changes the branding string added to the window title ( Figure 2 ). To restore the defaults, delete the five values listed below. To use custom animated images (for instance, a spinning globe), first create 20- by 20-pixel and 38- by 38-pixel static bitmap images. Then create a bitmap image 20 pixels wide and a multiple of 20 pixels high, with each successive frame of animation positioned below the previous. Then create a 38-pixel-wide animated bitmapped image in the same way.

Ripping CD's to MP3 (on Windows)

For use on Windows platforms I use Free MP3 Rip from mgshareware.com.

My Settings are:
In CD | Options menu option

* on the General Tab, select Default Encoding Format MP3.

* on the Output Path Tab, I choose for Path Extension and File Name Extension (3 – Both)

* on the Encoding Tab, I choose a 192 Min bitrate.

Then simply load a CD, Select All songs (with the green tick), and then Rip to Default Format (the CD icon).

HTML (ampersand) Character Codes

· (&middot;) Middle Dot
• (&#149;) Bullet, black small circle
« (&laquo;) Left-pointing double angle quotation mark
» (&raquo;) Right-pointing double angle quotation mark

Development Software Suite As At 26 June 2004

Java J2SDK 1.4.2_4 http://java.sun.com/j2se/1.4.2/download.html
Tomcat 5.0.25 http://jakarta.apache.org/site/binindex.cgi
JSTL 1.1 http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
MySQL 5.0.20 http://dev.mysql.com/downloads/mysql/4.0.html

Apache HTTP 2.0.49 http://httpd.apache.org/download.cgi
PHP 4.3.7 http://www.php.net/downloads.php
PHPMyAdmin 2.5.7 http://www.phpmyadmin.net/

Eclipse 3.0 http://eclipse.org/downloads/index.php

Eclipse 3.0 was released today.
PHP 5.0 is in RC3
MySQL 4.1.2 is still in Alpha

Adding a second IP address to Linux Server

If say you want to run apache and tomcat both on port 80 (default), you can create a seperate IP address on an internal network.

For RedHat Distros

$ cd /etc/sysconfig/network-scripts/
$ more ifcfg-eth0:0

DEVICE=”eth0:0″
BOOTPROTO=”none”
ONBOOT=”yes”
IPADDR=”XXX.XXX.XXX.XXX”
NETMASK=”255.255.254.0″
BROADCAST=”XXX.XXX.XXX.255″

$ ifup-aliases eth0

Changing A Server's Timezone

For RedHat 9

$ redhat-config-date (except this requires X)

or

$ clock
$ rm /etc/localtime
$ ln -s /usr/share/zoneinfo/Australia/Brisbane /etc/localtime
$ /usr/bin/rdate -s time.nist.gov
$ /sbin/hwclock –systohc

The last two commands can be added to cron for regular syncing with running ntp

0,30 * * * * /usr/bin/rdate -s time.nist.gov >/dev/null 2>&1
1,31 * * * * /sbin/hwclock –systohc >/dev/null 2>&1