How to Update a File on All Zones at the Same Time

I recently modified /etc/resolv.conf on all of my global zones after building new nameservers. I wanted a quick way to copy this updated configuration to all child zones. A simple one-liner does the trick on each global zone (assuming all your zones are in the /var/zones zonepath):


 

OpenVMS: How to Get TCP/IP to Start Automatically on Boot

After installing Compaq TCP/IP on my OpenVMS 7.3 SIMH image, TCP/IP was not starting when the node was rebooted.

To resolve this, I performed the following steps. First, ensure you have assumed your privileged identity (or just log in as SYSTEM):

Next, edit SYS$COMMON:[SYSMGR]SYSTARTUP_VMS.COM:

Find the following line, and uncomment it (by removing the leading $! comment sequence):

Save and exit the editor (with Control-Z). Now, you can either reboot the node

or just start the services manually for now:

It’s worth noting that the following command will shut down TCP/IP:

It’s also worth noting that individual services can be restarted using the following format, just substitute TELNET for the service you wish to act upon:

How to Use wget for Recursive get Without Traversing the Parent Directory

When grabbing files with wget, it is useful to sometimes not traverse parent directories. For example, say I want to download everything under http://www.example.com/my/home recursively, but not traverse upwards into parent directories. You can add the –no-parent option for this.


 

How to Disable Name Resolution with Snoop

Whilst analysing some issues with multicast on a pair of Solaris boxes, I wanted to filter out some unwanted multicast addresses when viewing my snoop traces.

However, by default, snoop will resolve IPs, and ALL multicast IPs in the 228.x.x.x range (which I’m using) resolve to “reserved-multicast-range-not-delegated.example.com”.

So … how to “play back” the snoop output without name resolution? Just use the -r option. I also added -ta to get readable timestamps.

I could then pipe this through grep -v and see only the information I cared about.

How to Generate a Hashed Password

Another OpenSSL related tip.

If you’ve ever wanted to generate a hashed password suitable for inclusion in the /etc/shadow file (for example, during post-install procedures such as sysidcfg), you can use the openssl passwd command:

Apache httpd: How to Use htpasswd to Password Protect Areas of your Site

This doesn’t cover the basics of configuring httpd, etc. You should know how to do that! Also, this is being done on an old RHEL 4 box.

If you’re having trouble with selinux blocking CGI in weird and wonderful ways, disable it:

Anyway … modify /etc/httpd/conf/httpd.conf and add a <Directory> directive for the directory that you wish to protect, e.g. :

It will protect all subdirectories under the directory too. You can obviously just specify a specific directory if you want, but I want to password protect the entire website.

Create a directory for your htpasswd file - do not put this under your DocumentRoot - somewhere under the ServerRoot is good, but I put it in /usr/local/etc/httpd:

Then create the htpasswd file and add your first user

I always chown apache:apache /usr/local/etc/httpd/users and then chmod 400 /usr/local/etc/httpd/users.

The -c is not required when adding further users to the users file

Then, just restart httpd (only needed as we changed the httpd.conf file - you don’t need to restart httpd after just adding/deleting users with htpasswd), and browse!

(or service httpd restart, /etc/init.d/httpd stop && /etc/init.d/httpd start, whatever….)

Done !

Squid: How to Enable the PURGE Method for squidclient

By default, the PURGE method is denied with squid, therefore, you cannot use squidclient to purge the cache for a particular page.

The solution to this requires a change in your squid.conf file to allow the PURGE method from localhost.

At my site, squid is installed at /usr/local/squid and the server listens on ports 80 and 8080 instead of the default 3128. You can see what ports squid is listening on with the following:

First, we need to add a couple of acl‘s to the configuration file, one for localhost (if you haven’t defined it already), and one for the PURGE method itself.

Now, we can add our http_access definitions to allow use of the PURGE method when requested by localhost only. Make sure you add both of these entries before your global http_access deny all entry.

Now, we’re ready to ask squid to reload its configuration file.

No errors? Cool. Now we can attempt to PURGE our cache for a particular page …

If the object is in the cache, you should receive a HTTP/1.0 200 OK message. If the object is not in the cache, you’ll be greeted by a HTTP/1.0 404 Not Found message.

How to Build and Configure a Central Logging Server with syslog-ng

Disclaimer: This post was originally posted in 2008 as an article on the now-defunct website zazzybob.com. While the software version and actual commands used may vary, the concepts are still similar and give a general idea of how to approach a given problem.

This article describes the process of replacing the venerable but limited syslog daemon with a versatile, flexible and customisable replacement, syslog-ng. We will be using our syslog-ng enabled host as a central logging server, so we’ll use LVM to create a log volume that can easily be expanded as disks are added to the system.

Continue reading

Hardware: How to Reset ALOM Password on T2000

There is no scadm command for the sun4v architecture on Solaris 10.

Therefore, to reset a forgotten ALOM password, you’ll need to connect the Serial management cable. (For example, I used an Annex terminal concentrator, and then telnet‘ed into the appropriate port on the Annex). Warning: you’ll be erasing your ALOM NVRAM during this procedure, but you have no choice.

Pull both power cables from the back of your (init 5‘d) T2000. Leave them unplugged for 5 seconds, and plug them back in.

Watch as the ALOM initialisation flows past your serial, and when you see the following, hit ESC:

You’ll know if you’re successful, as you’ll see the ALOM <ESC> Menu:

First, hit “e” to erase the ALOM NVRAM:

Then, hit “r” to return to the ALOM boot process:

Once the ALOM comes up, you’ll be logged in as admin with no password:

Reset the admin password:

You’ll need to setup the SC again:

I always add another personal admin user, to save this sort of thing happening:

Check you can access the console, and you’re good:

Security: Replacing a Digital Certificate within a Java Keystore

Some notes I prepared whilst renewing a certificate stored in a Java keystore: