Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Thursday, July 31, 2008

ATAD #8 - Package Management Systems

A Software Package is usually a software program that provides some functionality bundled with metadata that contains information about the package. And a Package Management System as defined by wikipedia is a collection of tools to automate the process of installing, upgrading, configuring, and removing software packages from a computer. The package management system is more common in unix and unix-like operating systems to operate with multiple packages. A few significant benefits of such a system are

- maintains a Repository of packages available for the running system (OS and Architecture specific) and resolves dependencies among various packages.
- looks up the repository and automatically downloads the requested packages and its dependencies when installation is triggered.
- can be used to easily upgrade the system to a defined release or level.
- system administrators can create repositories of packages which can be pulled by users, thus allowing easy maintenance of systems across the network and centrally stored packages to reduce memory requirements.

Common Package Management Systems are yum (Yellowdog Update Modifier) that is distributed with Fedora and apt (Advanced Packaging Tool) that's distributed with Ubuntu.

__tipped__

Tuesday, July 29, 2008

ATAD #7 - The network administration tool

If my previous post gave you an opinion that configuring networking on Linux is a head spinning task, im sorry; the Network Administraton Tool that is bundled with most of the newer linux distro is there just to make this task easy for you. You should be able to launch the GUI based tool from the 'System' drop down menu and in RedHat the system-config-network command can be used.

The following types of interfaces can be configured using the network administraton tool.
- Ethernet
- ISDN
- modem
- xDSL
- token ring
- CIPE
- wireless devices
- device aliases and profiles

Points worth a note:
- 'Export' your original networking configuration before editing them, so you can recover from a mistake by importing back the settings. Most of the network administrator tools provide this option.
- 'Save' your settings after editing and 'Activate' the interface after they are created.
- When interface aliases are configured, DHCP will not work with the interface and its aliases

__tipped__

Sunday, July 27, 2008

ATAD #6 - Specifying Networking Options

The /etc/sysconfig/network-scripts/ contains configuration scripts for each network interface, and its important not to confuse this with the /etc/sysconfig/networking/ directory that is used by the Network Administration Tool (system-config-network) whose contents should _not_ be edited manually. Each NIC has its corresponding configuration file /etc/sysconfig/network-scripts/ifcfg-eth(x) which allows the administrator to control the functioning of each interface individually.

Two or more network interfaces can be coupled to act as one to increase bandwidth and provide redundancy by creating a bonding interface using the bonding kernel module . Bonding options can be specified in the kernel module's configuration file /etc/modprobe.conf, but however IMHO it seems better organized to use the bonding device's own configuration file /etc/sysconfig/network-scripts/ifcfg-bond(n) instead.

A nice thing to know while changing the speed or duplex settings is that it requires disabling autonegotiation. This needs to be stated first, as the option entries are order-dependent in the ETHTOOL_OPTS= configuration parameter.

ETHTOOL_OPTS="autoneg off speed 1000 duplex full"

Furthur reading: ethtool, modprobe.conf

__tipped__

Friday, July 25, 2008

ATAD #5 - What’s that SysRq key on your keyboard?

The SysRq key is used to give input to the operating system without interfering with the software running (or rather hanged, which you can figure out later in the post) on your system. In essence it's a BIOS routine that triggers INIT 15, bypassing INIT 9 from reading the scan code, and thus the key pressed thereafter is not stored in the keyboard buffer, and to which the kernel will respond to. This will work unless the kernel is completely locked up, in which case you can give another try after tapping the Alt keys a couple of times or will have to head to the nearest "power" button.

In the Linux world the Alt + SysRq key is termed the Magic SysRq key that can be used to fix or debug a frozen system.

It's required to turn on SysRq in order to use it. So make sure this is done after your system installation in case you forecast (pun intended) a system hang. You can do this by setting the kernel parameter, which is in extension of my previous post on linux proc fs

# echo 1 > /proc/sys/kernel/sysrq

On X86 machines you can press ALT-SysRq-(command) to send useful commands (also listed in the wiki article) to the kernel.

ALT-SysRq-C can be used to manually trigger a 'C'rashdump when the system has hanged.

ALT-SysRq-REISUB can be used to manually trigger a neat and safe reboot when your machine has hanged, instead of pounding on the power button and risking HDD problems in the event where data is being written when the system hanged. Its easier remembered as BUSIER spelled in reverse.

And here is what's happening under the hood
R turns off keyboard raw mode and sets it to XLATE / gives back control of the keyboard
E send a SIGTERM to all processes, except for init.
I send a SIGKILL to all processes, except for init
S attempt to sync all mounted filesystems
U mounts all filesystem as read-only to prevent a fsck at reboot
B reboots the system no matter what

__tipped__

Thursday, July 24, 2008

ATAD #4 - Where is your OS bootable partition?

The /boot/ partition (or) directory contains static files, like the kernel, that are required to boot the system properly.

The /boot/ partition _can_not_ be on a logical volume group because the boot loader can not read it. If the root / partition is on a logical volume, then its required to create a separate /boot/ partition which is not a part of a volume group. If you are making a RAID partition of /boot/, you must choose RAID level 1, and it must use one of the first two drives (IDE first, SCSI second). Source [RHEL deployment guide]

A neat description of the boot process can be found here

Btw just noticed that MS Windows does support the use of "/" and "\" to traverse across directories. neato. :)

__tipped__

Wednesday, July 23, 2008

ATAD #3 - linux Access Control Lists (ACLs)

File permissions on linux are traditionally Read (r), Write (w), and Execute (x) permissions associated with users and groups. Providing appropriate permissions, especially as an ordinary user, is more often complicated than we think.

Let me illustrate this with an example. User "tom" creates a file named "hoohaha" and wants to give "dick" and "harry" permissions to read and execute it. Ofc this is fairly simple if dick and harry were exclusively part on one group. What if that group dosent exist? tom will have to ask the "already overloaded" system administrator to create a group consisting of just dick and harry. This, like you can see dosent sound too good.

To overcome this limitation, Linux has implemented support for Access Control Lists (ACLs). ACLs serve as an extension to traditional Unix permissions, giving end-users the ability to specify special access rights to a file and provide desired users and groups with appropriate permissions. To use ACLs you should have at least kernel version 2.6.x (some manual steps are required with older kernel versions), a filesystem that supports ACL, and additional user tools to create, view and modify ACLs. ext3 filesystems natively support ACLs, and support can be added to ext2 filesystem by performing some additional steps. ACL support is native on RHEL5, Fedora 9, Ubuntu Fiesty and SuSE 8.1 (there would be more).

The setfacl utility sets ACLs for files and directories, and getfacl can be used to determine the existing ACLs for a file or directory. The cp and mv commands do preserve the ACLs. tar and dump dont, so use star instead.

tom $ getfacl hoohaha
# file: hoohaha
# owner: tom
# group: tom
user::rwx
group::r--
other::r--


The requirement is realized when tom sets ACLs for the file hoohaha
tom $ setfacl -m user:dick:rx hoohaha
tom $ setfacl -m user:harry:rx hoohaha


__tipped__

Monday, July 21, 2008

ATAD #2 - linux swap space

Swap space is used when a system requires memory greater the physical memory (RAM) available. Physical memory is divided into chunks of memory called pages. When the amount of RAM is full, a page of memory which is relatively less used is moved to a preconfigured swap space on the hard drive (HDD).

Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files. The combined sizes of the physical memory and the swap space constitute the amount of virtual memory available.

RedHat recommends swap size be equal to 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB.

So, if:

M = Amount of RAM in GB, and S = Amount of swap in GB, then

If M < 2
then
S = M * 2
else
S = M + 2
fi

However, if you think you will be upgrading the RAM sometime in the near future, consider the total amount of RAM you would be having after your upgrade and decide on the swap space during install time. swap space can also be altered post installation by

1. creating a new swap partition
# lvm lvcreate -n -L (size_in_mb)M


2. creating a new swap file
# dd if=/dev/zero of=/swapfile bs=1024 count=(size)

3. extend swap on an existing logical volume (recommended)
# lvm lvresize (lvol) -L +(size_in_mb)M

Remember to boot the system in rescue mode before altering the swap space as the swap space can not be in used when being modified.
Further reading: swapoff, mkswap, swapon

__tipped__

ATAD #1 – linux /proc filesystem

It’s been a long time since i really sat down to read something, apart from what work demanded, technology round ups and reviews. Its this strange time in my life when academic acumen kicks in, and I wonder; “why not spend a few minutes each day to learn something new”.
I will log my learning’s with A Tip A Day.

Over the years I have understood that the /proc directory (also called the proc file system) contains files that store information about the state of the linux kernel and the running applications. The files can be interpreted by applications and the users (though a few are restricted only to the ‘root’ user) to gain a whole wealth of information about the running system. The contents of the files under the proc directory can be easily read using the cat program

OK, this is probably stale news for a few. But an interesting find was that a few files under /proc/sys can actually also be used to adjust settings to the kernel.

Eg, here im changing the hostname of the linux system to hoohaha

# echo hoohaha > /proc/sys/kernel/hostname

A few others store boolean information, for example the /proc/sys/net/ipv4/ip_forward when set to 1 will immediately start forwarding network packets.

# echo 1 > /proc/sys/net/ipv4/ip_forward

__tipped__

Saturday, March 29, 2008

Why we use Linux

Vlad Dolezal blogs about "Why we use Linux"
We tell people we use Linux because it's secure. Or because it's free, because it's customizable, because it's free (the other meaning), because it has excellent community support...

But all of that is just marketing bullshit. We tell that to non-Linuxers because they wouldn't understand the real reason. And when we say those false reasons enough, we might even start to believe them ourselves.

But deep underneath, the real reason remains.

We use Linux because it's fun!

I can't agree any lesser.
Since the day i migrated to this brighter face of the planet, ive been spending more fun, 1 on 1 time with my computer in tweaking stuff to my likes. Of course there were the troughs with undesired effects, but recovering from them and bringing about the desired change was a cherished learning experience by itself.

Open up and live free.

Sunday, August 26, 2007

Ubuntu'd and luvin it

More experiments with Ubuntu are up on Gadget7 and you can check it out here

For sheer expandability and customization, im totally addicted to this OS. This is fun :)

Thursday, July 26, 2007

Rough tide leads to pleasant discovery

The last month was a period of experiments with my computer, starting with the fact that I was running on a ‘going to break’ HDD and the DST short test was failing repeatedly. So before anything, I backed up all my data (which also includes my windows partition) after running openSUSE in recovery mode; and trust me it was quite a breeze, reinforcing my crush on Linux. Later that day I called DELL support and they promptly shipped me a replacement hard drive one working day later, but the OEM OS that id also asked them to ship was going to take a few days longer as the package which includes WinXP, device drivers, sonic, win backup and a few others were flying in from Netherlands. Nevertheless I was happy with their prompt and ‘no questions asked’ service, afterall I guess ive already paid them quite a sum when I took the 3 yr complete care support for my inspiron 6400.

A few months before this day I had installed the vista transformation pack just to see what the hype was all about. Must say, I was impressed by the freshness it gave to the aeging, yet stable XP. So I decided to head to the nearest and dearest electronics shop to get the Vista Home Premium. I like the way it installed, M$soft finaly decided to keep it simple and voila!! I also have my disk management utility inbuilt right into the installer, and without second thought retained 20gigs of free space for Linux. Two weeks passed and I liked the way vista felt, till I realized that I need more memory for what started to seem like a dying computer. I think I can quite easily point the finger at vista that required ~500 MB just to boot and get running. I ‘tried’ installing Halo for vista, and not to my surprise it didn’t quite go on well. You already get the picture, don’t you? Nevertheless 2Gigs of memory is on its way..

A jobless Sunday afternoon, and what more could I do when I find the ubuntu feisty fawn media lying around, 10GB of free space and a geeky mind. No prizes for guessing right, im now happily ubutun’d with a fresh and functional desktop. And here is a trailer of what could be done with Ubuntu and Beryl



Tell me that you still aren’t impresses by just the eye candy, and then here is more from a functionality pov. The ubuntu installation is done with a couple of user inputs that loads off a Live CD making life much easier, then comes the best part, the apt-get application is used to install any application from the command prompt, all u need to know is the name of the application and a simple `apt-get app_name` will look for the application online, download it, resolve dependencies and install the app. Ive got two words, “luvin it”

Next adventure would be tweaking and compiling the G15 drivers to get my Logitech Z10 working, and then Vmware to get virtual servers running. More later …

Live free, or die.
Linux!!

Thursday, November 30, 2006

linuxed !!

Joblessly sittin and watchin tv post mindnight. Thought id might as well spend the sleepless night and do somethin productive. Rbered that i got the ubuntu media a few days back. Ok, good thing to start off with. did the needed partitions and linuxed the lappy. Its 2am now and all excided. It came with OpenOffice as well, neat, but missed the windows fonts, but no issues, simple solution ..
sudo apt-get install msttcorefontscd /homewget http://www.auriance.com/docs/fonts/fontconfig.tbz
tar -xvjpf fontconfig.tbz

ok.. done, and now thought id set up the networking , figgerd out that ubuntu is built on Debian. now i have no clue as to where to start fiddling arnd, so ditched that and reserved it for the last. All devices were funtioning fine and so was yappy.

remote logged into the office, xterm, clearcase, clearmake .. eyerythin works. cool.. and then ...

% make love
Make: Don't know how to make love. Stop.

crashed into bed. eod.