Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Friday, March 16, 2007

Slitting Linux

Six months ago, when I installed Linux, I let it be on a 20 GB partition. Now I discovered that it is not enough. Of course I could have used another partition (FAT) to store the data, but this wasn't what I wanted. I wanted a big partition to store data, programs and settings.

I thought about moving the /home directory to another partition, so I ran mkfs.ext3 on an empty 50 GB partition to convert it from FAT to ext3. Then I mounted it to /media/newp. After that I ran cp -a /home/* /media/newp. Then I ran mv /home /home-old. Then I ran umount /media/newp to unmount the 50 GB partition so I can remount it to /home. Done!

In short I just moved the data to the new ext3 partition then told Linux to find the /home folder there. No restarts involved! :D

Saturday, February 17, 2007

Beryl 0.2 RC1 + Vista theme :D

Notice the preview when hovering the window title in the taskbar. Also see the motion blur in the second image. The last image there, is a ring-like application switching. See that the taskbar and the gnome-bar are transparent? it is not a Beryl feature if you were wondering, it i s just a transparent PNG file set as the background. I forget to ask , do you like the Vista look ;-) ?



Monday, February 12, 2007

Download all?

If you faced a site with about hundreds files that you want to download you will know what is this about.

I've faced two of them today. A site containing the MDC pictures, and a site containing MP3s for the whole Qur'an by Mashari.

In the page that containing all the links, I could have passed on them link-by-link pressing 'save item as'. Alternatively I did the following.

I right clicked on the page, using Firefox, 'View page info'. In the 'media' tab, I selected all the images and saved the link list to a file called list.txt.

Then I created a new folder and put the file in it. And I wrote the following simple command and pressed enter:
for File in $(cat list.txt) ; do wget $File; done
And I let it download all the links mentioned in the file.

And about the MP3, I went to the 'links' tab and likewise put all the links in a files also called list.txt in another folder. But this time there were two links for each Sura, one in MP3 and one in Zip. I did that to get the zip links only:
cat list.txt | grep -i zip > list.txt
Then I issued the same command to start downloading. After that I did:
for File in $(ls); do unzip $File; rm $File; done
to unzip files and delete unzipped .zip files.

After that I did:
play *.mp3
to play them all :D ( yeah mp3 from the command line :D )

The final download script for the MP3s was
for File in $(cat list.txt)
do wget $File
File=$(basename $File)
unzip $File
rm $File
done
Like that once a file is downloaded it is unzipped and deleted automatically.

I am writing this to let people who use 'non-unix' know how simple and handy Linux can be.

Friday, January 12, 2007

Xgl/beryl part 2 + ImageMagick

This is version 0.1.4 of beryl, the older post was version 0.1.1.

I NEVER used to mouse to make this single image from the screenshots.
Using the command line, I did 4 edits in these images.
  1. Resize each picture to 25% of its original size.
  2. Reduce quality of each picture to 60% (to reduce it from 200 KB per image to only 20 KB per image).
  3. Convert from PNG image format to JPG image format.
  4. Assemble these 6 images into one big image.
All that is done using only 2 lines in the command line. The convert tool is part of the ImageMagick package.
$ for myfile in ./*.png do
convert $myfile -resize 25% -qualilty 60% $myfile.jpg
done

$ convert -size 512x615 xc:skyblue \
Screenshot.png.jpg -geometry +0+0 -composite Screenshot-1.png.jpg -geometry +256+0 -composite \
Screenshot-2.png.jpg -geometry +0+205 -composite Screenshot-3.png.jpg -geometry +256+205 -composite \
Screenshot-4.png.jpg -geometry +0+410 -composite Screenshot-5.png.jpg -geometry +256+410 -composite out.jpg