Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Monday, November 12, 2012

Handle ZIP Archives with non-ASCII Filename

The workhorse is lsar/unar from The Unarchiver project.
http://code.google.com/p/theunarchiver/

Installation (Ubuntu 12.04 or above):

sudo apt-get install unar

Usage:

# Try list files first 
# Filename encoding will be automatically detected
lsar foo.zip
# If filename is already correct, unarchive
unar foo.zip

# If automatic detection fails
# Manually specify a encoding and check the result
lsar -e ENC foo.zip
# Once correct encoding is found, unarchive
unar -e ENC foo.zip

Reference: 

http://manpages.ubuntu.com/manpages/precise/en/man1/lsar.1.html
http://manpages.ubuntu.com/manpages/precise/en/man1/unar.1.html

Saturday, November 3, 2012

Install Ubuntu 12.04 on MacBook Pro 8.1

Description:

My origin environment is solely OS X 10.7.
I install Ubuntu 12.04 as another OS, i.e., the result is dual-boot.

Disclaimer:

My MBP has Intel graphic only. If yours has Nvidia graphic, things may be totally different.

Prerequisite:

1. Free space allocated for Ubuntu 12.04.
Disk Utility in OS X 10.7 can help you. Hold option to enable its hidden partition feature.

2. Direct (no VPN, etc.) wired Internet connection.

Procedure:

1. Install rEFIt to OSX:
http://refit.sourceforge.net/

2. Install ELILO
http://sourceforge.net/projects/elilo/
You may follow "Starting Linux with elilo" section below.
http://refit.sourceforge.net/doc/c2s2_startos.html
To be sure, you can reboot and try load ELILO without a elilo.conf, it should show some stupid error messages.

3. Download Ubuntu net install kernel and create elilo.conf
Download the following file:
http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/netboot.tar.gz
And extract "initrd.gz" and "linux" file to the directory where ELILO is installed.
Create elilo.conf like the following:
image=linux
initrd=initrd.gz
label=Ubuntu


4. Reboot and launch Ubuntu 12.04 installer through ELILO
The installation process should be easy to follow.
When asked to partition, choose a option that use all unused space. (The guided option seems to lack the chance of review. If you want to a scheme different from single / and swap, you should use manual. )

5. Install Firmware for WiFi
My WiFi chip is BCM4331, check yours using the following command:
lspci -vvnn | grep 14e4
For BCM4331, "firmware-b43-installer" package won't work since its postinst script is slightly outdated.
http://pad.lv/912941
So we do the following:
Install "b43-fwcutter" package.
Manually  download  and extract firmware following b43 upstream's instruction below:
http://linuxwireless.org/en/users/Drivers/b43#If_you_are_using_the_b43_driver_from_3.2_kernel_or_newer:

6. Re-enable rEFIt
For unknown reasons, GRUB installed by Ubuntu cannot boot Mac OS X correctly. So we need some additional steps:
6.1 Hold option key and power on the MacBook Pro.
6.2 Select the volume different from Recovery
6.3 Select OS X in rEFIt menu
6.4 Open Terminal in OSX and do the following:
cd /efi/refit
./enable.sh
6.5 (Optional) You may want to remove ELILO stuff installed before so it won't pollute your rEFIt menu later.
6.6 (Optional) You may want to remove Mac OS X entries in GRUB's menu, do the following in Ubuntu's Terminal:
sudo chmod -x /etc/grub.d/30_os-prober
sudo update-grub

Optional Steps:

0. As a reminder, two-finger click on Trackpad become right-click.

1. Enable two-finger scrolling
System Settings => Mouse and Touchpad => Touchpad
Change "Scrolling" to "Two-finger scrolling".
The direction seems to opposite to that OS X 10.7's. I don't know whether this is changable.

2. Install Ubuntu Tweak
http://ubuntu-tweak.com/
It contains some tweak options that otherwise require text file editing to change.
( I'm absolutely fine with CLI and text file editing, but a sane GUI environment should not depends on such stuff too much. ) 
It may crash from time to time, just relaunch it.

3. Disable Overlay scrollbars:
If you find overlay scrollbars insane like me, disable it.
Ubuntu Tweak =>
Tweaks =>
Miscellaneous =>
"Overlay scrollbars:" => Off
Better to logout and re-login so all the application would have sane

scrollbars.

4. Install restricted crap, e.g., MP3
As a reminder, MP3 support is needed for Ubuntu One Music Store to work.
"ubuntu-restricted-extras" should be suffice for most cases.
https://help.ubuntu.com/community/RestrictedFormats
I personally don't like Microsoft fonts and Adobe Flash though.
You can avoid Microsoft fonts by reject its EULA.
Adobe Flash can be removed by removing "flashplugin-installer" package.

5. Install Google Chrome
http://www.google.com/chrome/
My favorite browser remains Firefox.
But I use Google Chrome whenever I'm forced to use Adobe Flash.

Wednesday, August 8, 2012

Why I prefer Ubuntu to Fedora (and other distros)

Being a "beginner" is not bad.

Vim and Emacs are awesome. However, why can't I just enjoy Gedit which is much better than TextEdit.app and Notepad? I don't mind people call me beginner because I have very limited Vim knowledge. I change configuration files with Gedit, I program with Gedit, I'm happy with Gedit.

Similar story happens with my selection of distro.

Note: Do be a ninja if you want to contribute to FOSS directly. And a ninja should have experience with multiple distros.

Ubuntu has a friendlier installer.

Ubuntu's installer comes with the desktop CD won't ask questions that only make sense to system administrator. For example, the installer won't ask for root password.

Note: Ubuntu installer would configure selected timezone's country mirror as software source. And it would try to download updates and language packs at the end of installation. This often leads to poor installation experience since country mirrors may not work well. I don't like the concept of language packs itself.


It is easier to install restricted components in Ubuntu.

Jockey in Ubuntu can help users to install restricted drivers. The driver installation experience is even better than Windoze since there is no need to download drivers manually.

"ubuntu-restricted-extras" meta-package covers almost all non-free crap like MP3 and Flash. Most people just need them.

Note: Do avoid non-free stuff whenever possible. And be aware that Jockey may fail on some hardware. Bug reporting should be the best way to help Jockey.


Ubuntu has a Software Center

I think the main reason why Linux desktop fails to gain many users is its complicated software installation process. The huge software repository of Debian/Ubuntu mitigates the problem a lot. However, package is still a concept too advanced. App, on the other hand, is common concept today. Software Center is the easiest portal for normal users.

Note: dpkg/apt, the infrastructure behind Software Center, is not very robust in my opinion, there would be cases where CLI troubleshooting is required. So the experience is not as good as iOS's App Store. The Software Center itself is also somehow buggy. I find myself more convenient with apt-get(8). 

Non-rolling, time-based nature of Ubuntu releases makes sense to most people.

Always having latest version of software is cool. Without smooth upgrading process like that of iOS, however, upgrading becomes really annoying. LTS version of Ubuntu is really fit for people want a stable environment. Ubuntu 10.04 LTS contains GNOME 2 is still supported while Fedora and Arch Linux already forced their users to use GNOME Shell.

Note: Due to the dynamic nature of open source world, important bug fixes only comes to latest version and seldom backported. If you find youself using many PPAs to get latest software, it's a good time to upgrade Ubuntu version or switch to a rolling release distro.

Tuesday, August 7, 2012

《笨兔兔的故事》点评——我的说明

《笨兔兔的故事》是Ubuntu 10.04 LTS的入门书,可以在以下网址免费下载:
http://forum.ubuntu.org.cn/viewtopic.php?t=267518

该书讲的是日常的桌面应用和简单的编程开发,基本不涉及服务器架设的内容。

Ubuntu 10.04 LTS桌面版的官方支持期将在2013年4月结束,从今天(2012年8月7日)开始算还有1年不到。但我依然建议初学者从Ubuntu 10.04 LTS开始尝试GNU/Linux,因为Ubuntu 10.04 LTS包含较为成熟的GNOME 2桌面(Ubuntu从11.04开始转向了还在发展中的Unity桌面)。

想学习Ubuntu 10.04 LTS的朋友,除了可以阅读《笨兔兔的故事》外,还可以参考《Ubuntu桌面培训》:
http://people.ubuntu.com/~happyaron/udc-cn/
其中“Lucid HTML/PDF 版本”是针对Ubuntu 10.04 LTS的,而“Karmic HTML/PDF 版本”则是针对已过时的Ubuntu 9.10的。

《笨兔兔的故事》采用故事的形式解释清楚了从Windoze迁移到Ubuntu所必须了解的许多概念。但我在阅读的过程中,发现部分信息存在过时或失误的问题,所以我打算写一系列博客,指出这些问题。