It is high time I give out a bit of link love for those blogs I always rush to when there’s a new post !
In no particular order !
Hmm, that’s it for now ! This post to be a “thank you” for all the authors behind those blogs who write great posts and, well, ruin my productivity
What about you ? What are your favorite blogs or news sites ?
If you don’t own a blog you can list them in the comments below, but if you do have a blog, you might want to write such a post.
This a great way to share your favorite blogs with your readers and this helps those blogs to crawl their way up in page rank and to get a bit of well deserved fame
If you are running Linux, then you can use LVM (Logical Volume Manager) to get an extra flexibility in the way you allocate your disk space.
Physical disks are wrapped in Physical Volumes (PVs), which are grouped in Volume Groups (VGs). Logical Volumes (LVs) can then be laid over a VG.
So, if you want do manage a disk through LVM, you start by creating a PV for it ( with pvcreate ).
Once this is done, the disk is ready to be used in LVM. You can then choose either to create a VG for this disk alone (with vgcreate), or to add it to an existing VG (with vgextend).
The added space of this disk is now available to be used in the LVs which are laid over this VG either by creating a new LV (with lvcreate) or extending an existing LV (lvextend).
If you decide to extend an existing LV, you’ll probably have to extend the filesystem (i.e : ext2fs, ext3fs, reiserfs …) too with the appropriate command (maybe resize2fs or resize_reiserfs).
References : LVM How-To
Man pages for lvm and related pages
A bit of context : I have a bind 9 DNS allowing DNS updates from clients on the LAN (ok this is fairly insecure, but still my LAN is my home LAN composed of 4 machines … let’s say that’s good enough for me !
)
The named.conf allows those updates with this config directive in the zone config block :
allow-update {mynet; };
and mynet is defined an acl directive to be my LAN.
Then you can update your DNS with the nsupdate tool with a syntax along the following lines :
spaghetti:~# nsupdate
> server 192.168.0.1
> update delete spaghetti.domain.name A
> update add spaghetti.domain.name 8000 A 192.168.0.103
> send
> quit
I was then looking for a place to hook a code snippet doing that update after an update via DHCP and I found the answer in A dynamic dns update client on Debian with dhcp3-client (many thanks dude !).
Here is the drill down :
First of, you’ll have to locate and install the following packages :
The two last are the SSH client parts, it doesn’t hurt to install them.
You need to have the server keys generated in /etc/ssh. Those are the 4 files :
Should they not to be there, you can still generate by issuing the following command : /lib/svc/method/sshd -c.
Finally, you can start the service with svcadm enable sshd.
If this fails then you’ll need to have a peek under the hood … The logs of SMF are located in /var/svc/log and the one of sshd is network-ssh:default.log.
Solaris provides vold (Volume Management Daemon) which lets you deal easily with removable media such as CDs and DVDs.
This tool is provided by the SUNWvolr and SUNWvolu packages. Once you have found those packages and installed them, accessing to your removable medias becomes a bliss : All you have to do is insert your media, and go in the configured directory (ex : /cdrom).
Those directories are defined in /etc/vold.conf.
NB : maybe you’ll need to mkdir /vol, and maybe you’ll have to manually enable the service (svcadm enable volfs) the first time (and preferably in this order).
I stumbled on the Solaris 10 training & tutorials and it holds a really nice doc about package management in Sun Solaris 10, broken in 2 parts :
Amongst all the information, I was especially interested in those which I always forget like how to check package installation integrity (or how to know if files have been tampered with since it was installed) with pkgchk PACKAGE_NAME (eg : pkgchk SUNWcsu) or how to check integrity of a file with pkgchk -p /path/to/file (you’ll get extra information such as which package it was installed from by adding the -l flag).
pkgchk will check both file attributes and contents by default, so it is a great help to investigate problems related to installed packages being tampered with (every sysadmin knows this, either because of manipulation error, or an intruder trying to replace core utilities by trojan horses, backdoors, etc).
Of course you’ll also find the more “trivial stuff” like installing a package (pkgadd -d /path/to/packages PACKAGENAME), removing a package (pkgrm PACKAGENAME) and so on ..
Great resources, really !
If you want to know on which CD is a package, without :
Then you can :
which will output the .virtual_packagetoc_N where N is the number of the CD holding that package.
Exemple :
1 2 3 4 5 | # pwd /mnt/Solaris_10/Product # grep -l SUNWzsh .virtual_packagetoc_* .virtual_packagetoc_5 # |
So SUNWzsh, the package for ZSH shell, is on CD #5 of Solaris 10 distribution (damn, I don’t have it !)
This tip is courtesy of BlaF (thanks dude !)
Zsh extends the usual stream redirections with two nice features …
How often have you done the following :
If you occasionaly write shell scripts then it is likely that the answer is “many times”. If so, then you’ll be glad to know that Zsh can automate this for you.
Considere the following snippet :
spaghetti% cat <(date) <(uptime)
Tue Aug 14 16:08:35 CEST 2007
16:08:35 up 79 days, 18:47, 3 users, load average: 0.16, 0.18, 0.16
What Zsh did here is
That is just what you wanted ... packed in a handy one-liner.
If you've already needed to redirect the output of a command to multiple files, thn you already know the "tee" command. But with Zsh you don't need tee anymore, because Zsh has it built-in.
See the following snippet :
spaghetti% uptime >test.txt >test.txt2
spaghetti% cat test.txt
16:54:47 up 79 days, 19:33, 3 users, load average: 0.22, 0.15, 0.15
spaghetti% cat test.txt2
16:54:47 up 79 days, 19:33, 3 users, load average: 0.22, 0.15, 0.15
spaghetti%
As you can see, output was duplicated to both files.
If you liked this article about Zsh, then you might be interested in my previous article about brace expansion in zsh.