how to restrict dhclient from adding a default gateway

0 comments
source : debian-user-digest # 1413.

Issue : I have a Debian Lenny box with two NICs, eth0 and eth1. eht1 is a trunking interface and can be put onto any VLAN. Whenever eth1 is put onto a VLAN, I want it to get an address from DHCP but I do not want it to set a default gateway.

Solution : The dhclient-script sets the route. If you want to prevent it then you will have to either prevent dhclient-script from setting it or to remove it after it has been set.

$ man dhclient-script

Then browse through the script /sbin/dhclient-script and look at how it is setting routes.
$ less /sbin/dhclient-script


Step 1 : Turn on the debug variable script by setting RUN="yes" :
$ nano /etc/dhcp3/dhclient-enter-hooks.d/debug

Step 2 : then look in /tmp/dhclient-script.debug to see what variables are available.
less /tmp/dhclient-script.debug

Step 3 : create a new script at
/etc/dhcp3/dhclient-enter-hooks.d/no-default-route

Step 4 : in the above script put something similar to this :
case $reason in
BOUND|RENEW|REBIND|REBOOT)
unset new_routers
;;
esac

The above disables the default route. You will probably want more specific control such as only doing that when certain conditions are met. Such as if the IP address matches your particular IP address or some such. But I think this is probably enough to get you going.

WARNING : Be very careful trying this if you are accessing the host over the network and your connection requires a default route. Because obviously removing the default route will break your connection to the host. Connections on the local subnet will be okay.

Note that the script is sourced into the dhclient-script and that the dhclient-script is a bash script.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

kernel-wedge failed: make: *** [binary-arch] Error 2

0 comments
source : debian-user-digest # 1488.

# apt-get source linux-kernel-di-i386-2.6
gets the package and unpacks it in the directory in which you invoke the apt-get source command.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to create an encrypted lvm partition of disk manually

0 comments
This post will show only an encrypted lvm partition creation only. I choose install option at the time of installation from dvd. If you find anything inconsistence with the steps please inform me asap. The images and names of the disk and partitions may vary.

Step 1 : choose the manual option by clicking manual as shown in the image below for the partitions of the disk :



Step 2 : click the disk to start partitioning :



Step 3 : create a new partition table on the selected device :



Step 4 : click free space to create partitions :



Step 5 : choose create new partition :



Step 6 : enter the desired partition size for /boot :



Step 7 : select primary for the partition type :



Step 8 : select beginning for the new partition :



Step 9 : click Use as and change it to Ext2 file system; select /boot for the mount point & click done setting of the partition.



Step 10 : again select the free space to create an encrypted volume :



Step 11 : create a new partition as shown in step 5.

Step 12 : enter the desired partition size for encrypted volume as shown in step 6 :

Step 13 : select primary location for the new partition as shown in step 7 :

Step 14 : select beginning for the new partition as shown in step 8 :

Step 15 : select physical volume for encryption :



Step 16 : click done setting of the partition :



Step 17 : click configure encrypted volume :



Step 18 : click yes to write changes to the disk :



Step 19 : click yes to erase the data on the encrypted partition :



Step 20 : create a password with atleast 20 characters of letters, numbers and punctuation marks :



Step 21 : re-enter the password provided in step 20 :



Step 22 : click the encrypted volume to add support for logical volume manager :



Step 23 : select physical volume for lvm :



Step 24 : click done setting of the partition :



Step 25 : click configure the logical volume manager :



Step 26 : create volume group :



Step 27 : create a volume group name :



Step 28 : select the device [ aestrik indicates that device is selected ] and click continue :



Step 29 : create a logical volume :



Step 30 : select the volume group in which you want to create volumes :



Step 31 : create volume name. be careful with the creation of volume names. i choose the generic names of the partition types in linux. e.g. : usr, var, tmp, swap, etc.. it will help you a lot from step to step :



Step 32 : enter the desired size for the logical volume :



Step 33 : click finish after you have created usr, var, tmp, swap, root and home partitions with the desired partition sizes.



Step 34 : cross-verify the details of the created volumes :



Step 35 : click the logical volume to change the partition settings :



Step 36 : select use as and change to Ext3 journalising file system; change mount option :



Step 37 : repeat steps 35 and 36 for the logical volumes.

Step 38 : select finish partitiong and write changes to the disk :



Step 39 : select yes to write changes to the disk :



Step 40 : install the base system, users and passwords, grub, etc..

Step 41 : after the installation is completed, and hopefully nothing goes wrong, when you boot into your newly installed system, it will prompt for password created in step 20.



The End.
 
 
Creative Commons License
This work by © 2012 maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

an example of managing wireless network system by integrating ifplug,guessnet and wpa_supplicant

0 comments
source : debian-user-digest # 1517.

interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0

# ifplugd brings up interfaces, so do not bring them up at startup
noauto eth0 
#auto eth0

#iface eth0 inet dhcp


# Profile "none" is selected if no network signal is detected
# (i.e. there is no cable plugged into the socket)
#no-net missing-cable

mapping eth0
script guessnet-ifupdown
map default: foreing
map timeout: 3
map verbose: true

# If there is no link detected, don't try DHCP
iface interface inet manual
test missing-cable
pre-up echo No link present.
pre-up false

# guessnet default
iface foreing inet dhcp    

allow-hotplug wlan0
iface wlan0 inet manual
wpa-driver wext
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface wifihome inet dhcp


wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1
eapol_version=1
fast_reauth=1

network={ 
ssid="*******"
scan_ssid=1
proto=WPA2
key_mgmt=WPA-PSK
psk="***********"
pairwise=CCMP TKIP 
group=CCMP TKIP 
priority=5 
id_str="wifihome"
}
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to assign administrative privilege to a non-privileged user

0 comments
replace username with your desired username.
# echo "username ALL=(ALL) PASSWD:ALL" >> /etc/sudoers
 
 
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

Firefox 3.5.6/Iceweasel 3.5.6 for i386 is available now

0 comments
I have been waiting for the latest version of the Firefox or Iceweasel.
Earlier it was available for amd64 in lenny-backports. Thanks to backports team.
Now and then I check availability for backport packages.
I have installed the package and it is working great.
Download and enjoy the surfing in the new broswer.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

small issues with debian

0 comments
Yesterday by mistake I have given the command rm -rf /home and oops ...... it deleted more than 3 gb of data before I can use ctrl+d.

I did not configured safe-rm and I have to bear the burnt of it. It took most of the day in trying to recover the data through various means. I failed to recover data. Any how the data is not that much interesting or important.

The deleted data was mostly before I installed safe-rm, thankfully it did not deleted the latest data.

I have decided to verify the data on every boot with fsck. Even though this is not necessary because in ext3 file system you need not verify the data. The data is constantly updated and check for errors. I have observed that data which was at least 3 weeks old and which has not modified was deleted rather than modified folders and files. I have concluded that if i force check the data on every boot, may be in future i might not able to see the same issue again.

I have installed xfce4 from Stable branch. I resisted to install from backports since I will be using only one desktop environment.

I have learnt a couple of things about safe-rm and how to use the shutdown command to force fsck on boot. I will write another post rather than posting here.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

Debian GNU/linux lenny 5.0.6 is released

0 comments
If you have constantly updating your system using apt-get or aptitude, you can ignore. It will take 24-48 hours for the .iso

images to appear on the website. You can download from here.

You can view the list of updated packages, link.

The End.

how to inspect the cause of automatic rebooting of debian gnu/linuxlenny server

0 comments
source : debian-user-digest # 1380,1382.

[ A ] : You have several options :

[ 1 ] : attach a serial console, configure your kernel to send console messages to it - somewhat of a pain, but when the kernel panics, some things ONLY go to the console ( like a stack backtrace ) -- there's a serial console howto on tldp.org that's a good start -- note that you'll need a console that saves stuff ( e.g., a PC running a terminal program ) -- for my servers, I purchased a rather nice box from Lantronix that turns a serial port into something you can ssh into via the net ( server - serial port - Lantronix serial-to-ethernet-box - the net - ssh terminal program )

note : getting this all to work gets a little tricky, be prepared for a night in the server room, and be sure to have a rescue disk - getting the right incantations into /boot/grub/menu.lst can be tricky ( moreso in my case, as I'm running Xen, which adds another level of complexity and configuration to the boot process )

you can set your machine to reboot, or not ( see 2., below ) - either way, you'll capture something on the serial terminal

[ 2 ] : set your machine to NOT reboot on crash -- that way a crash will leave you at a point where you might be able to nose around system state with a debugger ( note : you'll need an attached console, preferably a serial terminal for this )

take a look in /etc/sysctl.conf for lines like
[sourcecode language="bash" gutter="false" autolinks="true"]
kernel.panic = 20
kernel.panic_on_oops = 1
[/sourcecode]

or nose around in /proc/sys/kernel ( do a google on /proc/sys/kernel for details )

see http://www.pc-freak.net/blog/how-to-automatically-reboot-restart-debian-gnu-lenny-linux-on-kernel-panic-some-general-cpu-overload-or-system-crash-2/ for some good background on how this all works

[ 3 ] : install a kernel that supports crash dumps and a crash dump utility - note that this is a bit of a pain in Linux, less so in BSD and Solaris based systems - with this approach you can set your machine to save a crash dump, then reboot - you can analyze the dump at your leisure -- sort of important if people depend on your server being up


[ B ] : Besides software issues there are also hardware glitches that can lead in a system reboot. Computer overheating ( beeping included ), bad ram modules or a faulty power supply can make that "black magic" to happen. Can you get a pattern for the restart ( it happens always at the same time, while performing concrete tasks... ) or it happens randomly ? Maybe logs would tell...
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

Why did I choose Debian GNU/linux ?

0 comments
I shifted from windows xp professional.
There are many Linux Distro's available.
Debian is stable and strong along with great community and irc help.
Debian packages are old and rarely you will find upto date packages.
The packages are tried and tested over many times and then only they are included in the official releases.
I want peace of mind. I don't want to reinstall and repair the operating system frequently.
It has been more than 6 months. I have reinstalled only couple of times not because system broke but to get right size of partitions.
It is consuming a lot less of RAM, at any point of time it is consuming not more than 50% of RAM [ i.e. 256 MB ].


If you want to install newer packages you can upgrade either to experimental or unstable packages. But they come with a cost, the system might not be stable and it might result in data loss sometimes.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

Does BCCI pay tax to Indian Government ?

0 comments
BCCI Board of Control for Cricket in India.

BCCI is a society registered under Tamil-Nadu Societies Registration Act.
It has 27 state associations members across 5 zones.
And it conducts various domestic cricket competitions including the Ranji Trophy.

If we open the official website of BCCI and If you try to find about BCCI and its history, Surprisingly and stupidly you will only Office bearers and an administrative team. Nothing more !!!!!

In the context of above and popularity of 20-20 cricket, one question has raised in my mind. How much money does BCCI pay to the Indian Tax Authorities.

I have come across the Wikipedia article. BCCI is registered as a society. There is no question of payment of taxes. So, how much BCCI is earning and accumulating over the period of 82 years since it's inception.

Nobody know how much the BCCI is earning and accumulating. If you look into the composition of the board members, you fill mostly either politicians or industrialists.

There seems to be one motive for BCCI : making money as much as possible.
Since it is registered as a society, it's income and expenses need not be in public domain. I am wondering what the Regional Commissioner's of Societies are monitoring all these days.

Does BCCI is promoting cricket domestically ? We all know how much money or percentage of income BCCI is channeled into domestic cricket. negligible.

I hope some day Income Tax Authorities will send a notice to BCCI regarding the payment of Tax on it's income.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

small theory about humans …..

0 comments
I think we are no different from nature. Our earth destroys and creates life on an ongoing basis, i don't know for how more centuries. We, human beings are more on the path of self-destruction than creating.

We divided ourselves based on the customs. I always thought that when we were early stages of development of mind created chaos and anarchy. Our fore-fathers have seen what we might become and created traditions for everybody in their area. Since people were living in small groups and rarely meeting each other, every group has created their own customs.

Then we were started to migrate to other places and in the process we have picked various customs whichever we felt good. This process has led to the birth of new customs and consequently, may the birth of ethnic groups.

We have become aware of the fire. The life of us has changed forever. We want more and we have started to think very radically. By the time we have almost developed full intelligence, we are able to talk, the most destructive of all five senses.

We are killing and quarrelling among ourselves for regions and its territories. But, I would like to make an observation here. Lion, King of Jungle, defends it's territory. It and it's members kill to satisfy their hunger and preserve for worst times. It never kills any other animal for pleasure or fun. We want more, always not satisfied with what we have. This clearly set us apart from other living things.

Kings have come into existence. So the domination of the religion. Religious leaders gained prominence and power under the kings. At one pint of time, Religious leaders are able to control King. According to whims and wishes of religious leaders, the court of kings have corrupted to some extent. Agenda and Propaganda of Religious persons have become indispensable to Kings. Very few resisted and most of them did not stood what is right.

We did not stop at religion, we have started to further divide. Sects are born at micro level of religion. In India, Hindus are divided upon the basis of income and educational levels. Hindu's compromise castes [ group of people pursuing certain profession ].

Many countries are born due to the thirsty conquest of Kings for power and natural resources. The absolute power and their inability to control large regions led to the downfall of the kingdoms.

Many countries have divided among themselves on the basis of language, religion,etc. Even after many countries have got independence, we are still fighting for natural resources, supremacy of military, etc.

We did fought 2 world wars officially. We are waging 3rd world war which might not end in centuries. Religious extremism and ethnic cleansing are the two dominant tools used by various individuals and countries. The key to win third world war is intelligence. We should be able to pacify, listen and take action for public issues in a cohesive manner. We should be able to stop issues of extremism before they are created or we should be able to frustrate the plans at various stages. To make this possible, every part of the Government and it's citizens work together on real-time basis.

I don't know where I read or heard this :

Information not shared is just raw data, and it is mostly useless.
when Information is shared, it becomes knowledge.
When Knowledge is shared, it becomes Wisdom.

I hope we all become wise human beings one day.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

south by southwest

0 comments
south by southwest is a private company based in Austin, Texas. It is established in 1987 and since then there is no looking back. It is popularly known as SXSW. It has released the music torrents performed in the festival. It has released it's own music torrents in the years 2005 -2007.

The release of music torrents has made popular among the music loving community. It has become an inspiration for music performers. Whether the band has 10 followers or a million, their hopes and dreams are not limited. It is indeed an opportunity for everyone to showcase their talent and leaving the results to audience.

SXSW has set an example for record labels about how to monetize the festival without compromising on the quality. It has managed to rope in at least a dozen sponsors, for example Pepsi and Microsoft.

The record labels are crying foul over file sharing community. I think they can also follow in the foot steps of SXSW. If SXSW is able to stay afloat with only one festival that lasts not for more than one month, then why not record labels cannot stay afloat with their huge collection of albums.

It defies the basic logic of common sense and business sense. SXSW has made available the music performed at the festival is free of cost to the public with no strings attached. It also organises movie festival and I hope one day it will eventually release the films also to the general public.

Why do people prefer to share music files using bit torrents. The primary reason might be there is not enough money to buy all the music they wanted. Before, iTunes has come into existence, record labels are selling albums but not individual tracks. There are very few albums in which you might like all the tracks. I have purchased hundreds of albums over a decade. I like more than dozen of albums and I like only a single to couple of tracks in an album. If you like it more than 3 tracks in an album, there is no meaning in buying the whole album since the cost of 3 tracks will be inflated.

From the record labels point of view distribution of tracks through online was difficult around three years back. But now the situation has changed and the technology is promising. The primary reason for the record labels to distribute the tracks is the cost of the track.

How do record labels determine the price of price of a track ? This question raises a lot of questions about the pricing of tracks. The cost of the album varies with the artist and their demand in public. European Commission has ordered an enquiry against Apple iTunes service in 2008. Apple has given several reasons behind the pricing of it's tracks. The case has clearly demonstrated the difficulty in pricing the tracks across the various nations.

Instead of focusing on the ways to distribute music they are focusing on the file sharing community. Record labels are trying to protect their manufacturers of cd/dvd/label providers and the ancillary industry depending on them.

In the online age, pricing is an issue. For example a track is priced at $1. It might be cheap in US or Uk. The pricing of one dollar might be costly for people living in other countries. The purchase of tracks in dollar or euro currency purely depends on the current exchange rate of the buyer's currency. If the buyer is shelling out around 70 or 80 in local currency and the price might seem to the buyer too steep.

The pricing of the track should be in local currency and it should be affordable as in US or EU. Apple has already set a clear example about how to control the buyer purchase by redirecting to his home country website and the buying is solely on the basis of credit card buyer's origin.

The money invested by the record labels in attorney's for filing suits against file sharing persons and ISP's should be diverted to market research for each country to determine the popular artists and albums. There are several surveys which clearly demonstrated that file sharers are actually purchasing the music. There are several multinational companies have invested a lot of money in various countries solely for the pricing issue and to understand the market. Many of the MNC's are successful and they are selling products of the same kind and quality with different countries and pricing.

We can assume the following :

[1] record labels are concentrating on the established territory rather than exploring new territories.

[2] record labels are not investing in market research in many countries.

[3] record labels are not willing to sell their tracks individually.

[4] record labels marketing teams and their strategists are defunct.

[5] record labels are not trying to reach the audience. Instead they are thinking the opposite.

Unless record labels do not change their attitude towards consumers through out the globe, file sharing seems to be unavoidable.

Least but not the last, the tracks released by the SXSW is created into torrents by Greg Hewgill and Ben Stolt. The links to their respective torrents are here and here.

I hope record labels will not come after me for providing the links here.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.