Translate

Archives

Plumbing NICs in Linux

Setting up a network card in Solaris (prior to Solaris 11) involving plumbing the interface prior to configuring it. If you did not plumb the interface, you did not see the interface. This is a feature which many people liked but was missing from Linux until quite recently. One recent feature in the Linux kernel (2.6.13 and later), is the ability to bind or unbind a device driver from user space. This can be used to make a network interface completely disappear from the output of ifconfig -a. Previously, the only way to disconnect a driver from a device was

GNOME 3 Is Bad For Your Health As a Developer

With the recent release of GNOME 3.6, once again the GNOME developer cabel have managed to royally upset their third party developer base – in particular those who develop GNOME Shell extensions and themes. This blog post sums up the attitude of the GNOME developers nicely and should be required reading for anybody who thinks of developing an extension, theme, or application for GNOME 3. GTK 3.6 breaks virtually every third party theme out there. GNOME Shell 3.6 breaks a large number of third party extensions. The removal of the ability to display debugging messages in Looking Glass in GNOME

First Letter Capitalization in Bash and Korn Shell

Bash does not have a built-in facility to first letter capitalize a string but Bash 4.0 and later has the necessary tools to do so as shown by the following example: #!/bin/bash Firstcap() { lower=${1,,} echo ${lower^} } Firstcap lINUX >>> OUTPUT IS: Linux This function not only uppercases the first letter of the argument passed to it but also lowercases the remaining letters of the argument. Here is how to do the same thing in ksh93: #!/bin/ksh Firstcap() { typeset -u f f=${1:0:1} typeset -l r r=${1:1} echo “${f}${r}” } Firstcap lINUX >>> OUTPUT IS: Linux

Bash and Korn Shell Let Keyword

Recently a colleague of mine recommended using the let keyword in shell scripts to perform arithmetic evaluation. That prompted me to write this post about the let keyword. Here is what the bash manpage says about the let keyword: let arg [arg …] Each arg is an arithmetic expression to be evaluated. If the last arg evaluates to 0, let returns 1; 0 is returned otherwise. And here is a simple example of it’s use: $ a=2 $ b=5 $ let c=$a+$b $ echo $c 7 $ let c=$a + $b $ echo $c 2 As you can see from

Find Hard Disks on System

Assuming you have a Linux 2.6 kernel, there are a number of places where you can find information about the hard disks on your computer without using any utilities such as fdisk, gdisk or lshw, or by checking log files. All disks and partitions are listed in /proc/partitions. Each disk also has an entry under /sys/block. Under /dev, you can find disks and partitions by serial number (/dev/disk/by-id/), by UUID (/dev/disk/by-uuid), by filesystem label (/dev/disk/by-label/) or by hardware bus (/dev/disk/by-path/.)