.Zip Parser
The .Zip file parser has been completed. I will host the code soon, and probably convert it into a Perl module for analysing different types of .Zip files created by different software.
The .Zip file parser has been completed. I will host the code soon, and probably convert it into a Perl module for analysing different types of .Zip files created by different software.
This is a very basic introduction to LVM2 - Logical Volume Manager version 2.
In computer storage, logical volume management or LVM is a method of allocating space on mass storage devices that is more flexible than conventional partitioning schemes. In particular, a volume manager can concatenate, stripe together or otherwise combine partitions into larger virtual ones that can be resized or moved, possibly while it is being used.
Source: Wikipedia.
Be sure to create backups before proceeding with the conversion to LVM!
There are three elements in LVM. They are volume group, physical volume and logical volume. If you want to use LVM, you have to enable support for LVM in the kernel. Most distributions have their kernels compiled with LVM support.
A physical volume can be any device/partition that we are able to find in /dev. For example, /dev/sda2, /dev/hda1, et cetera. A physical volume is indeed physical in this sense. We have to create physical volumes from these partitions. One partition corresponds to one physical volume. In the following tutorial, we will convert partitions named sda5 and sdb8 to LVM2 volumes.
Creation of physical volumes:
[alanhaggai@archer ~]$ sudo pvcreate /dev/sda5 /dev/sdb8
No physical volume label read from /dev/sda5
Physical volume "/dev/sda5" successfully created
No physical volume label read from /dev/sdb8
Physical volume "/dev/sdb8" successfully created
Physical volumes have to be added to a volume group. A volume group is nothing but a collection of physical volumes and logical volumes. We will create one volume group named main. Physical volumes add storage space to the volume group.
[alanhaggai@archer ~]$ sudo vgcreate main /dev/sda5 /dev/sdb8
Volume group "main" successfully created
Logical volumes are to be created within a volume group:
[alanhaggai@archer ~]$ sudo lvcreate -L40G -nhome main
Logical volume "home" created
The above command creates a logical volume of size 40 GB within the volume group main. A file system is to be created for the logical volume:
[alanhaggai@archer ~]$ sudo mke2fs -j /dev/main/home
An ext3 filesystem is created. The device nodes are arranged as /dev/{volume_group}/{logical_volume} which are linked to /dev/mapper/{volume_group}-{logical_volume}.
Resizing an lvm volume involves resizing the logical volume as well as the filesystem within it. Warning: Be careful while shrinking. Do not shrink to a size less than the size of the data in the volume. If shrunk so, it will result in loss of data. An expansion involves passing a + value to the -L flag, and a shrink involves passing a - value.
[alanhaggai@archer ~]$ sudo lvresize /dev/main/home -L+10G
Extending logical volume home to 50.00 GB
Logical volume home successfully resized
[alanhaggai@archer ~]$ sudo resize2fs /dev/main/home
resize2fs 1.40.8 (13-Mar-2008)
Filesystem at /dev/main/home is mounted on /home; on-line resizing required
old desc_blocks = 3, new_desc_blocks = 4
Performing an on-line resize of /dev/main/home to 13108224 (4k) blocks.
The filesystem on /dev/main/home is now 13108224 blocks long.
Volume groups have to be activated:
[alanhaggai@archer ~]$ sudo vgchange -ay
1 logical volume(s) in volume group "main" now active
For an in-depth tutorial, refer LVM HOWTO.
Sometimes, we may need to redirect output to a file owned by root ( or another user ) to which we have permission via sudo.
[alanhaggai@archer ~]$ sudo touch test
[alanhaggai@archer ~]$ stat test
File: `test'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fe00h/65024d Inode: 281248 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2008-09-27 17:08:29.000000000 +0530
Modify: 2008-09-27 17:24:03.000000000 +0530
Change: 2008-09-27 17:24:03.000000000 +0530
[alanhaggai@archer ~]$ sudo echo 'hello' > test
bash: test: Permission denied
sudo executes echo 'hello' as root. Then bash tries to write the output to the file named test as the user alanhaggai. man sudo states:
sudo [-bEHPS] [-p prompt] [-u username⎪#uid] [VAR=value] {-i ⎪ -s ⎪ command}
To circumvent this problem, we use:
[alanhaggai@archer ~]$ sudo bash -c 'echo "hello" > test'
[alanhaggai@archer ~]$ cat test
hello
After some cp -auv action and a SIGINT (Ctrl + C), I was not able to remove some files. They all resulted in the above error, though it was not a NFS related error. A fsck on the respective partition corrected it and I was able to remove the files.
This is a post from the Flock Browser.
Linux system calls — we use them every day. But do you know how a system call is performed from user-space to the kernel? Explore the Linux system call interface (SCI), learn how to add new system calls and discover utilities related to the SCI.In this article, I explore the Linux SCI, demonstrate adding a system call to the 2.6.20 kernel.
Add the following to either ~/.vimrc, /etc/vimrc or /etc/vim/vimrc:</p>:
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Intents will have a width of 4
set softtabstop=4 " Sets the number of columns for a TAB
set expandtab " Expand TABs to spaces
To convert tabs to spaces in an already existing file, open it in vim and enter these:
:set expandtab
:retab
This post is an account of how I got my PixelView PlayTV Pro tuner card to work in GNU/Linux (Arch Linux). It shall work for bt848, bt878 or Fusion 878A chip based cards. I hope it may be of help to all.
Kernel version: 2.6.26.5
I had to compile the kernel atleast thrice to get it right. Everytime, I missed the menu where I was to select the tuner as well as the card. This was because I was stripping down the kernel for my system and did not compile I2C (I-square-C) support. However, I2C had to be compiled-in.
[alanhaggai@archer ~]$ sudo lspci | grep Multimedia
06:02.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
06:02.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
Relevant kernel options:
Device Drivers --->
<*> I2C support --->
<*> I2C device interface
[*] Autoselect pertinent helper modules
I2C Hardware Bus support --->
<*> Intel 82801 (ICH)
Multimedia devices
<M> Video For Linux
[*] Enable Video For Linux API 1 (DEPRECATED)
-*- Enable Video For Linux API 1 compatible Layer
[*] Load and attach frontend and tuner driver modules as needed
[*] Customize analog and hybrid tuner modules to build --->
<M> Simple tuner support
-M- TDA 9885/6/7 analog IF demodulator
[*] Video capture adapters --->
[*] Autoselect pertinent encoders/decoders and other helper chips
<M> BT848 Video For Linux
<M> SAA6588 Radio Chip RDS decoder support on BT848 cards
This is the setup for my system. It may be different for your system. All the above may be compiled as modules. Compile and install the kernel.
Add the following to /etc/modprobe.conf:
options bttv card=37
options bttv tuner=5
options bttv radio=1
The values may be different for your card. Refer cardlist to find out the values for your tuner card. Trial and error may help, if you are not sure about your card.
Reboot to the new kernel. Install tvtime. Run tvtime-scanner to scan for
channels. Run tvtime. There are many other software for
television viewers
in GNU/Linux.
That is it. Good luck!
Open the file: ~/.kde/share/config/konquerorrc. Under [FMSettings], add:
MouseMiddleClickClosesTab=true
First of all, I am happy that you have chosen to get freed from the closed-source world. Welcome to this new world which lives on and around it’s friendly community. Let me give you a short introduction before we move on to the real transition:
What makes GNU/Linux (yes, the operating system is named: GNU/Linux and it is the kernel that is named Linux) interesting and a strong operating system?
It is due to it’s adherence to the Free Software Philosophy. Most software available (and there are many many to choose from!) come along with the source. Source is good in a way that it can be compiled in your own system so that it will make use of your hardware’s capabilities to the best. Also, you are able to edit, modify and use the way you want the software to run for you. This gets you the best software as all software is made for and by people like you and me. Bugs are reported and always solved as fast they can be.
Why is the operating system named: GNU/Linux and not Linux as I used to think?
Linux is the kernel. For an operating system, the kernel is the most important aspect or core of the system. It abstracts the hardware aspects from the software and offers an interface for software so that it can deal with the hardware more easily and can be (mostly) generally coded without knowing the clients’ hardware. Having just the kernel is not so useful. Furthermore, to be called an operating system, the system should have essential utilities and applications. We need software that uses the kernel. GNU provides many many range of software for this kernel. Thus, the correct name for the operating system is GNU/Linux.
I searched with the query ‘GNU/Linux’ and it came up with some pages giving me links to distributions. What are ‘distributions’?
Distributions (or ‘distro’, as they are called in the community) can be thought of flavors like just we think about ice-creams. We have chocolate, vanilla, strawberry and other flavors for ice-creams. Such is the case with GNU/Linux. There are many distributions. They are obviously based on the Linux kernel. So, what makes them different? There are many or at least some differences among different distributions. For example, distributions differ according to philosophy, package management, directory differences, support, commercial or free, release dates, software used, etc.
Why do we need so many distributions? Why is there no ‘standard’ distribution?
With GNU/Linux comes the freedom of choice. One person’s interest may not be of interest to another person. So you are able to choose from the three hundred or so distributions which suits you the best.
What is package management?
Package management, as the name suggests, allows for the management of software packages. They provide an easy way to install, update or remove packages. They also automatically resolve dependencies, thus relieving the user from manually installing the software.
I will write more soon… Do comment.