Tuesday, September 12, 2006
Recover more space with localepurge
Well my friends, you are in the right place.
After discovering the amazing capabilities of those two tools, I kept looking for something more and got localepurge.
Ever got annoyed to see those localized man pages we usually find in /use/share/doc that you never read? It's time to get rid of those.
#apt-get install localepurge
This will install localepurge in your system and prompt you to select the locale (preferably en_us and/or your own locale) for the man pages you want to keep in your system. After that, localepurge will automatically search the whole system for localized man pages and delete those.
In my case I was able to recover and huge 332 MB in the first run (Your mileage may vary). Sweet, huh!
Another sweet thing is, localepurge will automatically remove localized man pages when you install new packages in your system.
swapon
Suppose, you have recently installed a program in your unix box that needs at least 1GB of swap space but you only allocated 256MB for your swap partition when you installed your unix distro, or you even forgot to allocate a swap partition during the installation process because you were in a hurry and now your favourite programme slows down frequently. Thinking about reinstallation?
Well, think again!
There is a handy tool in unix called swapon that can solve your problem in a few seconds.
Here is how I added a 512MB extra swap space in my debian system:
- First I calculated the file size in KB. 512 * 1024 = 524288
- Then I ran these in root shell (This creates the swap file):
#mkswap swapfile -L linux_swap
- Then I instructed my debian to use that swap file:
Walla! My system suddenly appears to have 512MB of extra swap space!
Now, one single step is missing. You don't wanna write swapon in shell every time your system boots, do you?
Just add #swapon swapfile to your system's startup scripts.
And if don't wanna use that swap file for some reason, #swapoff swapfile and delete that file (and don't forget to remove that startup script if you have added that)
Friday, September 08, 2006
deborphan and debfoster
Deborphan finds 'orphan'ed packages in your system. It detects those packages that aren't being depended on by any other packages. So, if one doesn't want them, they are safe to remove.
#deborphan
This showed me those redundanat packages; I could've removed them one by one but I chose to remove them all at once by this command:
#deborphan | xargs apt-get -y remove --purge
[Note: I find it's always a good idea to keep a backup, just in case for if things get messed up. So I ran "#deborphan > change_list" to keep the name of the packages into change_list file, so that I reinstall them if I needed so.]
Debfoster, the other package does similar thing but in reverse manner, it checks those packages that are holding other packages installed as it depends on them. It then prompts the user whether he wants to keep or deinstall those packages with dependencies one by one.
#debfoster
kdegames is keeping the following 32 packages installed:
kasteroids katomic kbackgammon kbattleship kblackbox kbounce
kdegames-card-data kenolaba kfouleggs kgoldrunner kjumpingcube klickety
klines kmahjongg kmines knetwalk kolf konquest kpat kpoker kreversi ksame
kshisen ksirtet ksmiletris ksnake ksokoban kspaceduel ktron ktuberling
kwin4 lskat
Keep kdegames? [Ynpsiuqx?], [H]elp:
I chose N to remove those.
Using these two commands I have recovered a lot of disk space that was otherwise reserved by the programmes I never use.
Thursday, September 07, 2006
allbn2unicode
This project has following objectives:
- Create a C based multiplatform converter that will convert from bijoy, alpona, etc encoded files to unicode format.
- Upon completion of the first objective, create a GTK based GUI for unix platform and MFC based GUI for windows platform.
- Upon completion of the second objective, extend support for doc, odt, rtf, etc file formats.
- a command line version that inputs a file and outputs in another
- a simple plug in system that enables the possibility to convert between any formats
Additional Notes:
- The project is codenamed 'Rebirth"
- Our team members have contribited in the following parts:
- Salahuddin created the base structure of the programme, the I/O system, the base algorithm of wide character I/O.
- Lavluda created the plugin system, added structured data manupulation and various refinements.
- Zaher (me) revised the basic alogorith, introduced the dynamic memory allocation system, reworked the plugin system, improved the searching algorithm, and various speed impvovements.
Installed ATI fglrx driver succesfully in Debian 'etch'
Everybody knows that installing ati's closed source driver fglrx in
unix is a bit hairy. I know several people who have smoked their box
in the process (that also includes me!). (debian unstable now includes
the fglrx driver, but i find it better 2 install the latest driver from
the card manufaturer)
Well after a lot of fiddling (or should i say a few crashes!) I was
able to install it withput any problem.
Here is the procedure I followed:
1, downloaded the latest version from ati's website. (8.27.10-1)
2. #sh /tmp/ati-driver-installer-8.27.10-x86.run --buildpkg Debian/etch
3. #dpkg -i fglrx-driver_8.27.10-1_i386.deb
fglrx-control_8.27.10-1_i386.deb fglrx-kernel-src_8.27.10-1_i386.deb
4. #apt-get install module-assistant
5. #module-assistant prepare
6. #module-assistant update
7. #module-assistant build fglrx
8. #module-assistant install fglrx
9. #depmod -a
10. #aticonfig --initial
11. #aticonfig --overlay-type=Xv
12. #mkdir -p /usr/X11R6/lib/modules/dri
13. #ln -s /usr/lib/dri/fglrx_dri.so /usr/X11R6/lib/modules/dri
the driver installation was complete by now.
I checked if the driver installation was successfull by doing a reboot
and #fglrxinfo in the terminal.
I also ran #fgl_glxgears; i saw three gears spinning.
Burnitup
The main attraction of the script is that it supports 'digital mastering', a feature long been used by audio cd manufactures. This is really a hidden feature of cdrecord, but many people does not know about it. In order to use the feature, your burner must support it, of course. To my knowledge, only Yamaha's writers support this feature currnetly; but i believe most other manufactures will incorporate this feature into their burners soon.
I have created two versions of the script: burnitup_norm and burnitup_ultra. the norm version first creates an image in the current folder and then burns the image thus proving you an opportunity to reuse the image (.iso) file. On the other hand the ultra version writes to cd from source folder, does not created any image or tempory file. Use this one if you dont have enough extra space in your hard drives.
[Note: 1. You have 2 call the script with '-burn' switch to write 2 the cd, otherwise it wont write anything, just do a simulation. This is a safety feature.
2. The ultra version has some minor gliches, (it needs you to manually input track size in sao mode) i'll automate that part when i have free time.
3. Currently it can write only one track per session.
]
#code starts here
#!/usr/bin/perl
#use to get options
use Getopt::Long;
#specify your default options here
$device_default = "/dev/ide/host0/bus1/target0/lun0/cd"; #my cd writer's id
$mode_default = "tao"; #default writing mode
$driveropts_default = "burnfree"; #default driver options
$type_dafault = "data"; #default cd type
#end of default settings
#specify the options
GetOptions( "help" => \$help,
"master" => \$master,
"mode=s" => \$mode,
"speed=i" => \$speed,
"type=s" => \$type,
"source=s" => \$source,
"multi" => \$multi,
"tracksize=s" => \$tracksize,
"burn" => \$burn,
"device=s" => \$device);
if ($help){
print "Welcome to burnig world with Burn It Up\n";
print "\n";
print "You should specify these options:\n";
print "--help :shows this help\n";
print "--device :specify the cd-recorder eg /dev/hdc\n";
print "--mode :this can be tao(track at once, sao(disk\n";
print " at once) or raw96r\n";
print " Note: choose sao for digital mastering\n";
print "--master :use digital mastering\n";
print " Note: 700mb cd becomes 595mb\n";
print "--speed :set writing speed 1-50\n";
print "--type :this is either data or audio\n";
print "--source :the path of the source dir\n";
print "--multi :choose if you want to create a multisession disk\n";
print "--tracksize :needed for sao(disk at once) mode.\n";
print "--burn :this will really burn the cd otherwise, it writes\n";
print " in simulation(dummy) mode.\n";
exit;
}
if($device eq ""){
$device = $device_default;
}
if ($source eq ""){
print "Burn It Up: No sourec dir specied. Please enter the source dir path\n";
exit;
}
if ($speed == 0){
print "Burn It Up: No writing speed specified. Please specify the wrinting speed 1-48x\n";
exit;
}
if ($mode eq ""){
$mode = $mode_default;
print "Burn It Up: No writing mode specified. Using primarily tao mode.\n";
}
if ($master){
$driveropts = "burnfree,audiomaster";
$mode = "sao";
print "Burn It Up: Digital mastering enabled. Switching to sao mode.\n";
}
else{
$driveropts = $driveropts_default;
}
if ($mode eq "sao"){
print "Burn it up: You must specify the track size using the --tracksize paramater.\n";
print " You can retrive the tracksize value from below:\n";
print " write as this --tracksize XXXXs\n";
$status = system("mkisofs -R -J -q -print-size $source");
if($tracksize){
$tsize = "tsize=$tracksize";
}
else{
$tsize = "";
#exit;
}
}
if ($type eq ""){
print "Burn It Up: No cd type specified. Writing data cd.\n";
$type = $type_dafault;
}
if ($multi){
$opt1 = "-multi";
}
else{
$opt1 = "";
}
if ($burn){
$dummy = "";
}
else{
$dummy = "-dummy";
}
$status = system("rm -f temp.iso && mkisofs -r -R -J -o temp.iso $source && cdrecord -v -$mode $dummy $opt1 speed=$speed driveropts=$driveropts dev=$device -$type $tsize temp.iso && rm -f temp.iso");
die "Writing CD failed. cdrecord exited with Status Code $?" unless $status == 0;
#code ends here
#code starts here:
#!/usr/bin/perl
#use to get options
use Getopt::Long;
#specify your default options here
$device_default = "/dev/ide/host0/bus1/target0/lun0/cd"; #my cd writer's id
$mode_default = "tao"; #default writing mode
$driveropts_default = "burnfree"; #default driver options
$type_dafault = "data"; #default cd type
#end of default settings
#specify the options
GetOptions( "help" => \$help,
"master" => \$master,
"mode=s" => \$mode,
"speed=i" => \$speed,
"type=s" => \$type,
"source=s" => \$source,
"multi" => \$multi,
"tracksize=s" => \$tracksize,
"burn" => \$burn,
"device=s" => \$device);
if ($help){
print "Welcome to burnig world with Burn It Up\n";
print "\n";
print "You should specify these options:\n";
print "--help :shows this help\n";
print "--device :specify the cd-recorder eg /dev/hdc\n";
print "--mode :this can be tao(track at once, sao(disk\n";
print " at once) or raw96r\n";
print " Note: choose sao for digital mastering\n";
print "--master :use digital mastering\n";
print " Note: 700mb cd becomes 595mb\n";
print "--speed :set writing speed 1-50\n";
print "--type :this is either data or audio\n";
print "--source :the path of the source dir\n";
print "--multi :choose if you want to create a multisession disk\n";
print "--tracksize :needed for sao(disk at once) mode.\n";
print "--burn :this will really burn the cd otherwise, it writes\n";
print " in simulation(dummy) mode.\n";
exit;
}
if($device eq ""){
$device = $device_default;
}
if ($source eq ""){
print "Burn It Up: No sourec dir specied. Please enter the source dir path\n";
exit;
}
if ($speed == 0){
print "Burn It Up: No writing speed specified. Please specify the wrinting speed 1-48x\n";
exit;
}
if ($mode eq ""){
$mode = $mode_default;
print "Burn It Up: No writing mode specified. Using primarily tao mode.\n";
}
if ($master){
$driveropts = "burnfree,audiomaster";
$mode = "sao";
print "Burn It Up: Digital mastering enabled. Switching to sao mode.\n";
}
else{
$driveropts = $driveropts_default;
}
if ($mode eq "sao"){
print "Burn it up: You must specify the track size using the --tracksize paramater.\n";
print " You can retrive the tracksize value from below:\n";
print " write as this --tracksize XXXXs\n";
$status = system("mkisofs -R -J -q -print-size $source");
if($tracksize){
$tsize = "tsize=$tracksize";
}
else{
$tsize = "";
exit;
}
}
if ($type eq ""){
print "Burn It Up: No cd type specified. Writing data cd.\n";
$type = $type_dafault;
}
if ($multi){
$opt1 = "-multi";
}
else{
$opt1 = "";
}
if ($burn){
$dummy = "";
}
else{
$dummy = "-dummy";
}
$status = system("mkisofs -r -R -J $source | cdrecord -v -$mode $dummy $opt1 speed=$speed driveropts=$driveropts dev=$device -$type $tsize -");
die "Writing CD failed. cdrecord exited with Status Code $?" unless $status == 0;
#code ends here
Back to Blogging
After a failed attempt last year to get back to blogging, I'm trying it again this year. I really wanted to get back, but got busy will...
-
For my Univ project, I need 2 use graphics.h. Everyone knows graphics.h is not in C's standard library. Only Turbo C supports it and for...
-
Make sure you have grub installed in the same partition as the Ubuntu, not in MBR. Now boot into any linux Live CD and do this: $sudo dd if=...
-
Normally, when we are coding java in Eclipse , we do not see any javadoc help when we hover over a keyword. This is because by default, ecli...