Tuesday, December 29, 2009

Mount disk in non-root account

If you want to mount a device, ordinarily, you have to have a root privilege to mount and access the device by root account. But in daily use, login in by root account is danger and unnecessary. You can use sudo to access root privilege and don't need to endure the stake of damaging your computer. But it's the same situation that you need a root privilege to read/write the device. There is other way to do it. Use merely mount.

Edit /etc/fstab:
device mountpoint mounttype option ....
modify the option:
user: If you set option to user, then you can use non-root account to mount the device. To set to users means you can umount the device by other account
group: every account which have a group matching the group of the device can mount the device. So you need to use root account to change the group ownership of the device.
chown -R :group mountpoint

Friday, December 25, 2009

Openbox windows manager

Openbox windows manager is a lightweight X11 windows manager. It is high-configurable. I use it for an alternative for fluxbox. It seems to use less cpu power. I would use it with wmii because wmii is not convenient and awkward to run applications like VirtualBox and wine-related. (Or the floating style in wmii seems to work. Press MOD-Space or MOD-SHIFT-Space to handle the classical way instead of tiling managed way. Read more...)

Install: sudo apt-get install openbox

Configure:
cp /etc/xdg/openbox/rc.xml, /etc/xdg/openbox/autostart.sh to ~/.config/openbox/

edit ~/.config/openbox/autostart.sh
VirtualBox &
(sleep 5 && xterm -e screen) &
google-chrome &
Use xprop WM_CLASS to check the name and class of applications that you want to custom their behaviors after executing. Then edit ~/.config/openbox/rc.xml in applications part

Useful commands:
Alt + Tab:switch windows
Win + (F1 - F4): switch to desktop 1 - 4
Ctrl + Alt (<- ->): switch desktops sequentially
Alt + F4: close window

Reference:

窗口管理器 Openbox 入门指南


Thursday, December 17, 2009

Reconstruct MBR by GRUB

When you install Windows after the installation of Linux, Windows would install its own boot loader on MBR and it would ignore other system in your computer. If you previously install your boot loader of Linux on MBR, your boot loader of Linux would be replaced and you can't boot your Linux system. The following are some solutions.

(Method 2, 3 seem to fail in Windows 7, the alternative way is use other grub substitute for Windows 7, then edit manually to retrieve Linux system. For my computer, when entering the grub menu of grub windows-substitute, press e or c, then edit
root (hd0,2)
kernel (hd0,2)/boot/vmlinuz-... root=/dev/hda3 ro
initrd (hd0,2)/boot/initrd-...img
boot
then press b to boot. It will boot Linux system. Use root privilege to reinstall grub boot loader on MBR.
$ grub
grub > root (hd0,2)
grub > setup (hd0)

I didn't test Method 1 because my Debian CD failed to be loaded by my computer. Ubuntu DVD failed by that Ubuntu installation DVD recognize HD partition as SCSI partition. I don't know how to do it for GRUB.


Method 1:
  1. Use a debian installation CD to boot computer
  2. Select install option
  3. After entering the installation menu, use Ctrl+F2 to access the shell
  4. chroot your Linux environment
  5. Use grub-install /dev/hda (or grub-install --root-directory=prefix '(hd0)' )
  6. Restart computer
Method 2
  1. Download GRUB for DOS
  2. Uncompress and copy grldr and grub.exe in C root drive
  3. Edit C:boot.ini (in CMD, msconfig -> choose boot.ini)
  4. Add C:grldr="grub" in the last line

Method 3
  1. Download wingrub
  2. After finishing installation, install grub -> boot.ini, drive: C: -> install
  3. Restart computer
  4. There are two options in the boot menu: windows, mygrub
  5. Entering mygrub, choose YourLinuxSystemLabel, press c
  6. Edit GRUB: grub>root (hdX,Y); grub>setup (hd0)

Wednesday, December 16, 2009

Useful wget commands

Useful wget commands

$wget -r http://example.com/packages/
Download all files in the directory of packages and fabricate all the structure of the site, http://example.com

$wget -r -np -nd http://example.com/packages/
The same as above, but don't recursive for parent directory (-np), don't reconstruct directory structure in local machine (-nd)

$wget -i filename.txt
filename.txt includes all needed download address, then wget would automatically download all file

wget -c http://example.com/really-big-file.iso
the option -c means wget would resume last download process in the case the last download didn't finish

wget -m -k (-H) http://www.example.com/
mirror a site, and convert the links in the mirror automatically. -H enable across site recursive retrieving

Tuesday, December 15, 2009

Cloud operating system for Netbook



Linux Instructions for installing Chromium OS to USB.

Extract ChromeOS-Cherry.img and run the following command in the same directory as the file, where X is the device name of your USB drive.
sudo dd if=ChromeOS-Cherry.img of=/dev/X bs=4M
Once the command finishes, you can then boot from the USB drive.






Create a Jolicloud USB key
  1. Open a Terminal and go to the directory where you downloaded the file: cd /the/path/to/your/directory
  2. Change the script permissions: chmod a+x jolicloud-usb-creator-1.2.0.sh
  3. Run the program (at this stage you will be asked to enter your administrator password): ./jolicloud-usb-creator-1.2.0.sh
  4. Connect your USB key to your computer.
  5. In the Jolicloud USB Creator window, click <em>Browse</em> to find and select the <em>jolicloud-robby-alpha2c-live.iso</em> in your system.
  6. Select your target device: The USB key you have inserted should be automatically detected.
  7. Click <em>Create</em> to create your Jolicloud USB.

Monday, December 14, 2009

Remember The Milk

the best way to manage your tasks

username: XXXXXXXXX
Inbox email address: XXXXXXXXX+a01402@rmilk.com (anything email this will become a task in Remember The Milk Inbox)


a handy guide to getting started with Remember The Milk at: http://www.rememberthemilk.com/help/guide/

Friday, October 30, 2009

Amaya - W3C's Editor/Browser

Home Page: http://www.w3.org/Amaya/

Vendor: W3C

Screenshot for Amaya

W3C's Amaya browser displays Presentation MathML, and lets a Web page author edit equations directly. The software gives multiple views of a document so that its internal structure can be displayed as well as a WSYSIWYG interface. Web editor, a tool used to create and update documents directly on the Web. Browsing features are seamlessly integrated with the editing and remote access features in a uniform environment. This follows the original vision of the Web as a space for collaboration and not just a one-way publishing medium.

Monday, October 5, 2009

Firefox 3.7 theme mockup

Firefox_3_7_Mockup_Redux_2_5_by_Bon.png
Step 1

First download the theme using following link:

Download Mozilla Firefox 3.7 Theme

Its a ZIP file. Extract it using WinRAR or 7-Zip (both can be found in our "Downloads" section). You'll get a .ZAR file which contains the actual theme. Drag-n-drop this file to "Add-ons" window in Firefox and it'll install the theme.

Step 2

You'll also need to install the "All Glass Firefox" add-on to get the Glass effect which can be found here.

Step 3

Install Personal Menu

It'll add the "Tools" button near searchbox. Now right-click on empty area near addressbar or searchbox and select "Customize" option. Now drag "Bookmarks" button between searchbox and Tools button.

Now go to "Tools -> Add-ons -> Extensions" menu and select "Personal Menu" from the list. Click on "Options" button and go to "Advanced" Tab. Enable "Hide Drop-Marker" option. Also enable "Hide Menus Toolbar" and "Show temporarily by pressing ALT key" options to hide menubar.

Step 4

Chrome-like tab on the top. Install Stylish addons. Install Stylish

Install Firefox Tabs at The Top!! (Chrome Like) v2



Monday, September 28, 2009

SMALL STEP TO BIG GOAL

Hey everyone,

Most of you know that I'm committed to solving the climate crisis.  If you're like me, you're convinced about the urgency of this problem, but don't know what you can do that will make a real difference.  That's why I'm writing you today.

I just watched a really cool video from the crew at www.350.org. It's about new global campaign focused on making sure the world takes the kind of big, bold, fast action that we need to solve this crisis--check it out: http://www.350.org/video

I think you'll agree that it's beautiful--I've included the link so you can pass it on to your friends!

Monday, August 31, 2009

Xplanet in Debian 5.0

  1. aptitude install xplanet xplanet-images
  2. edit .xplanet/config: because the night earth image that provided by package "xplanet-images" seems fixed, in order to cancel the display of night image, add the line below default item: shade=100. Then add 'cloud_map=~/.xplanet/clouds_2048.jpg' below earth item.
  3. use download_clouds.py or download_clouds.pl to download cloud image
  4. write the script, startxplanet.sh:
python ~/.xplanet/download_clouds.py ~/.xplanet/clouds_2048.jpg
xplanet -body earth -latitude $LATITUDE -longitude $LONGITUDE -quality 100 -geometry 1600x1200 -config ~/.xplanet/config
 

Sunday, August 9, 2009

sudo + mount in Debian 5.0

aptitude install sudo
visudo: (man sudoers)

opera debian=(PASSWD): /bin/mount, /bin/umount
(username hostname=(NOPASSWD\PASSWD\noexec): command)
(for sudo works well, need to configure hostname properly)
configuring network:
edit /etc/hostname:
debian
edit /etc/hosts:
127.0.0.1 localhost
192.168.0.1 debian
(it seems to cause some problem if written as 127.0.0.1 localhost debian)
edit /etc/network/interfaces:
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
add alias to ~/.bashrc:
alias mount='sudo /bin/mount -o umask=000'
alias umount='sudo /bin/umount'

Saturday, August 8, 2009

Listen Podcast in Linux (Debian) - hpodder

http://debaday.debian.net/2007/10/07/hpodder-a-podcast-client-that-just-works/

subscribe new podcast:
 $ hpodder add http://yourfavouritesite.com/podcastfeed.xml
Hpodder will handle any valid podcast feed, even if it is not the traditional .xml address —including feeds extracted from an OPML export of iTunes podcasts. Once you have your list of podcasts you wish to download, simply type:
 $ hpodder update
$ hpodder download

Or, if you want to make life easy:

 $ hpodder fetch
to download only the most recent episode, you can do this by typing:
 $ hpodder catchup
$ hpodder fetch
to delete a podcast type:
 $ hpodder rm ID

Where ID is the podcast's ID number (else you risk deleting them all!).


Downloading the actual episode of your podcast is handled by cURL and is fast, efficient and if interrupted for whatever reason, can be picked up later on without having to start the download from the beginning.

If you want to make hpodder fetch on a regular basis, you can add it to your cron jobs and set it to run as frequently as you like.

If you want a full list of the commands and more subtle features available to hpodder users you can download the manual in PDF format, or read it online.

Debian 5.0 + wmii

Debian GNU/Linux 5.0 ("Lenny")

Wmii (Windows Manager Improved)
  1. apt-get install xserver-xorg xterm xinit
  2. apt-get install wmii

acceptable xterm appearance:
  1. use fontsel to select wanted font: -dejavu-*-*-*-.... or http://levien.com/type/myfonts/inconsolata.html
  2. edit ~/.wmii-3.5/wmiirc: WMII_TERM='xterm -font -dejavu-*-*-*-....' (edit ~/.Xresources: xterm*font:-dejavu-*-*-*-...)
  3. edit /etc/vim/vimrc: uncomment syntax=on

HotKey Shortcut

add the line to ~/.wmii-3.5/wmiirc:
Key $MODKEY-n
iceweasel &


Monday, June 15, 2009

Analysis textbook

昨天聽了Jie Xiao的演講,課後去找他,他推薦了
  1. "Measure Theory and Fine Properties of Functions", by Lawrence Craig Evans, Ronald F. Gariepy
  2. "Analysis", by Elliott H. Lieb and Michael Loss