M. Ahmad Zafar - step4wd.com

Knowledge Increases When Shared

Mount BIN CUE Images in Ubuntu

Mounting ISO files in Linux is quite straight forward and simple e.g. using the mounter function in Ubuntu straight from the context menu or by using a command line like this:

mount -o loop image.iso /mnt

Anyway mounting BIN/CUE image files is not that straight forward as they’ll need conversion to ISO before mounting, however the process is quite simple, but it need a small application called bchunk. The bchunk package contains a UNIX/C rewrite of the BinChunker program. It converts a CD image in a .bin/.cue format (sometimes .raw/.cue) into a set of .iso and .cdr/.wav tracks. The .bin/.cue format is used by some non-UNIX CD-writing software, but is not supported on most other CD-writing programs.

To install the package:

sudo aptitude install bchunk

In order to convert a bin/cue image set:

bchunk image.bin image.cue image.iso

Then to mount the iso image using this command:

mount -o loop image.iso /mnt

Now you can view the contents in the folder /mnt.

Add Google Repositories to Ubuntu (Linux)

Google provides repositories for installing its packages in various Linux distributions. These repositories are automatically added if you simply download, for instance, Google Chrome and install it.

You can visit the following link providing by Google to add the repo using command line also: http://www.google.com/linuxrepositories/

Update and upgrade the package manager after following the mentioned steps.

Add RAR and 7-ZIP Support in Ubuntu

Support for RAR and 7-ZIP compressed files can be added to Ubuntu simply by running the following commands:

sudo apt-get update
sudo apt-get install unrar p7zip

Now double clicking on these compressed files will work without doubt.

Change Default GRUB 2 Options in Ubuntu

With Ubuntu 9.10, GRUB 2 is installed by default as the boot loader (although it is still in beta version). The files and commands have been changed.

GRUB 2 settings can be viewed using the command:

sudo gedit /boot/grub/grub.cfg

(You can replace gedit with vim or whichever editor you prefer). This grub.cfg contains the menu entries but it is NOT recommended to change anything in this file. Infact, this file is compiled.

To alter the default menu item, timeout etc, open the grub file using the command:

sudo gedit /etc/default/grub

Make the required changes, for instance in my case I made you changes:

GRUB_DEFAULT=4
GRUB_GFXMODE=1280x800

After making the changes, save the file and compile the output using the command:

sudo update-grub

Reboot and see the results!

Enable IP Forwarding in Linux

What is IP Forwarding?

Normally, a system can not communicate with another system belonging to a different network address. IP forwarding is the mechanism of forwarding an IP packet from one network (example: 192.168.1.0) to another network (example: 192.168.2.0).

How to enable IP Forwarding in Linux?

By default, IP forwarding is disabled in linux. The current setting can be verfied using the command:

cat /proc/sys/net/ipv4/ip_forward

This will give the output: 0

Another way to test is to run:

sysctl net.ipv4.ip_forward

This will give the output:

net.ipv4.ip_forward = 0

Where 0 means disabled and 1 means enabled.

Enabling IP Forwarding for the Current Running Kernel

Running either of commands will perform the task:

sysctl -w net.ipv4.ip_forward = 1

or

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

But this is only for the current running kernel session. After reboot the old values will be restored.

Permanently Enabling IP Forwarding

Open the required in VIM or any other text editor:

vim /etc/sysctl.conf

Locate the line and modify it as under:

net.ipv4.ip_forward = 1

But these changes will not take effect unless the system is restarted or the command is run:

sysctl -p /etc/sysctll.conf

For Redhat systems, restarting the network service will automatically reload the changes to sysctl.conf:

service network restart

On Ubuntu, this is also possible by restarting the procps service:

/etc/init.d/procps.sh restart

For Debian distributions open the /etc/network/options and make the following changes and restart the network service or reboot:

ip_forward = yes

For Redhat distribution open /etc/sysconfig/network and do the same:

FORWARD_IPV4 = true

The changes can be viewed using the commands mentioned above.

Runlevels in Ubuntu

Runlevel is the mode in which the operating system like Linux is running. Conventionally, seven runlevels from 0 to 6 existed. Where 0 meant shutdown and 6 meant Reboot.

In previous versions, Ubuntu used to the /etc/inittab file to manage runlevels, just like most of the Linux distributions. This file was based on traditional init daemon, which is used to perform system startup tasks. This was replaced in Ubuntu 6.10 (Release date: 26th-Oct-2006) with Upstart, an event based daemon. Now there are several files under the /etc/events.d/ directory.

The runlevels that Ubuntu handles by default are: * Runlevel 0 - Halt * Runlevel 1 - Multiuser text mode * Runlevel 2 - Graphical multiuser mode * Runlevel 6 - Reboot

For more details visit Ubuntu’s Upstart section.

Website Launch

Today is the launching day of this website. This website will inshAllah cover Tips, Video tutorials, Coding techniques related to software development. If anyone benefits from it, we will be happy!

Knowledge increases when shared

You are welcome to request comments. If you like a post, rate and share it with others!