Posts

Showing posts with the label Linux

Add new hard drive in Debian

Its unfortunely that my disk array (RAID 5 with 4 hard drive) degraded because of a hard drive failed. For data safty issue, I have to back up all data and rebuild it again! After rebuilt, I have to re-mount it again as new hard drive into my system. Here is the procedure for notes. At first, make sure the disk is the one I want to re-mount. $ sudo fdisk -l /dev/sdc Disk /dev/sdc: 1500.0 GB, 1499999502336 bytes 64 heads, 32 sectors/track, 1430511 cylinders, total 2929686528 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000  Disk /dev/sdc doesn't contain a valid partition table Its lucky I found it! And I'll create a new partition on it. $sudo cfdisk /dev/sdc Just follow those steps below... New -> Primary -> specify size in MB Write Quit After that, I can see following message when success! Disk has been changed.  WARNING: If you have created o...

Shrink qcow2 file with Windows guest

Remove unnecessary file and empty the recycle bin in windows guest. De-fragment your disk in windows guest. You may do it several times for good compact status. Free unused disk space in windows guest. sdelete -c c: Convert the disk image itself. qemu-img convert -c -O qcow2 win.qcow2 win-shrinked.qcow2

Convert Debian amd64 to multi-arch

Do following steps... sudo dpkg --add-architecture i386 sudo sed -i 's/deb\ /deb\ [arch=amd64,i386]\ /g' /etc/apt/sources.list sudo apt-get clean; sudo apt-get autoclean; sudo apt-get update After that you can install the packages that only support i386 such like skype. Enjoy it!

Restart networking service on Debian

Most Debian user should run into this problem before they find out a good way to restart networking service. Debian deprecated the restart option of /etc/init.d/networking script for security issue. Users will get following warning when they do restart: Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning). And their network won't be restart finally. How to restart the networking service? There are several ways to achieve that. (Login as root or sudo it) /etc/init.d/networking stop && /etc/init.d/networking start (You'd better run the command on console than remote it) inovke-rc.d networking restart Hope those helpful for you and me. :-)

[Note] Useful shortcuts for Awesome window manager

mod + shift + tag-number: move window to specified tag number. mod + ctrl + shift + tag-number: duplicate window to specified tag number. mod + shift + ,: move window to left/previous tag number. mod + shift + .: move window to right/next tag number.

Take screenshot with ImageMagick (CLI)

Take full screen screenshot with 3 seconds delay # import -pause 3 -window root screenshot.jpg Take selected area screenshot # import screenshot.jpg

Debian can not restart/reboot properly on Acer Aspire One D257

You have to make some changes with following steps $ sudo vim /etc/default/grub Replace GRUB_CMD_LINUX="" with GRUB_CMD_LINUX="reboot=eif" sudo update-grub You may restart your aod257 and it works properly now.

Resolution change manually on Ubuntu 10.04

Show current setting $ xrandr -q Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192 VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 338mm x 270mm 1024x768 60.0* 800x600 60.3 56.2 848x480 60.0 640x480 59.9 Get new mode line with new resolution $ cvt 1280 1024 60 # 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync Create a new mode for new resolution $ sudo xrandr --newmode "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync Add the new mode $ sudo xrandr --addmode VGA1 "1280x1024_60.00" Check if new mode exist? $ xrandr -q Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192 VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 338mm x 270mm 1024x768 60.0* 800x600 60.3 56.2 848x480 ...

NITDroid installation

I'm disappointed that NOKIA announced they will use WM for their new N9 series phone, and that makes me wanting to give up Maemo. I've used iPhone before. Its a good experience to use a smart phone. But it is too expensive for me. So, I want to migrate to Android based. For some reasons: Android had good integration with Google services, that's helpful to me. Android also has lots of applications on AppMarket. Android based phone is cheaper than iPhone. So, I tried to install NITDroid on my NOKIA N900. I want to thanks to the NITDroid project! Its very easy to install NITDroid on NOKIA N900 for now. The following is the notes I've been tried. Preparing a microSD card, and 2G size is recommended. Add a repo: extra-devel on Maemo's application manager. Install a package named nitdroid-installer on Maemo. Click the Application icon or run 'nitdroid' with superuser for automatic installation. After the installation, reboot the phone to entering the Android world...

LibreOffice installation with PPA on Ubuntu

I love to use LibreOffice on my linux desktop, so I always replace OpenOffice.org with LibreOffice when the desktop was newly installed. $ sudo add-apt-repository ppa:libreoffice/ppa $ sudo apt-get update && sudo apt-get install libreoffice Now I can use it!

equinox-theme installation on Ubuntu/Debian

Please follow steps below: Find equinox project on launchpad.net, then you can see the ppa path in the page. Install Ubuntu sudo add-apt-repository ppa:tiheum/equinox Debian sudo vim /etc/apt/sources.list Add a line: deb http://ppa.launchpad.net/tiheum/equinox/ubuntu lucid main sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4631BBEA sudo apt-get update sudo apt-get install equinox-theme faenza-icon-theme Open preference/appearence and change theme to Equinox Evolution Then, you can enjoy it!

UNetbootin installation on Ubuntu 9.10 (Karmic) and later

$ sudo add-apt-respository ppa:gezakovacs/ppa $ sudo apt-get update $ apt-cache search unetbootin --> To check if we can find unetbootin $ sudo apt-get install unetbootin

LaTeX installation with beamer class on Ubuntu

$ sudo apt-get install latex-cjk-chinese latex-beamer Then, you can create slide with LaTeX beamer class.

Rename folders from Chinese to English in Ubuntu/Debian

$ export LANG=en_US $ xdg-user-dirs-gtk-update A dialog will popup and change it. Non-empty folders will be keep. Move all files to new folders named in English from original folders. $ export LANG=zh_TW.UTF-8

Latex installation on Archlinux

Nowadays, if we want to use LaTeX, we have to install the texlive package for it. And it is very easy to install all of those needed packages on Archlinux. $ sudo pacman -S texlive-core texlive-langcjk texlive-latexextra texlive-pictures Then, you can enjoy it now!

My settings for X on ArchLinux

[shawn@arch2k5 ~]$ cat .xprofile #export LANG=zh_TW.utf8 export LC_CTYPE=zh_TW.utf8 export LANGUAGE=zh_TW.utf8 export GTK_IM_MODULE=ibus export XMODIFIERS=@im=ibus export QT_IM_MODULE=ibus ibus-daemon -d nm-applet & gnome-power-manager &

Convert nrg file to iso

There are 2 options on Debian/Linux: nrg2iso iat I tried nrg2iso at first, it told me the nrg file is already in ISO9660 format and did not covert. And I tried iat then that. It works fine! $ iat image.nrg image.iso Iso9660 Analyzer Tool v0.1.3 by Salvatore Santagati Licensed under GPL v2 or later Detect Signature ISO9660 START at 32768 Detect Signature ISO9660 END at 36864 Image offset start at 0 Sector header 0 bit Sector ECC 0 bit Block 2048 Done The outputed iso can be used with no wrong.

Dictionary files installation for stardict

After stardict installed, you may... Get dictionary files from sourceforge.net http://stardict.sourceforge.net/Dictionaries_zh_TW.php Extract files to dedicated path /usr/share/stardict/dic Restart stardict That works on Debian/Ubuntu, Enjoy it!

How to diable kernel module in Debian

OS: Debian 5 I want to disable module i2o_core to prevent unexpected exception/error. Create a conf file for i2o_core in /etc/modprob.d Edit its content with 'blacklist i2o_core' and then save it run 'depmod -ae' as root run 'update-initramfs -u' to re-create initrd After rebooting, you won't see i2o_core via 'lsmod'. You can reference to this wiki page .

Pure-FTPd installation on Debian

Install Pure-FTPd with following steps: # aptitude select and install pure-ftpd quit aptitude after install finished Add or modify or remove configurations in /etc/pure-ftpd/conf restart the daemon after configurations changed What items I've chnaged are... UnixAuthentication -> yes DontResolve -> yes ChrootEveryone -> yes