Enable Internal Speaker in Ubuntu Saucy on Mac

Run the command in shell

hda-verb /dev/snd/hwC1D0 0x1 set_gpio_data 1

And place it into /etc/rc.local

Posted in linux, opensource | Tagged , , , | Comments Off on Enable Internal Speaker in Ubuntu Saucy on Mac

How to Share a VPN from VM on Mac

Because our OpenConnect VPN from company provides a very poor connection for Mac, I switch to share an AT&T Global Network (AGN) VPN running in a Ubuntu VM inside of Mac OS. Here are the steps

  • On Mac Install VirtualBox on Mac and install Ubuntu 12.04 32bit VM in VirtualBox.
  • Launch Ubuntu and install AGN. Login your AGN account.
  • In Ubuntu VM, in /etc/sysctl.conf, turn on ip_forward
    net.ipv4.ip_forward=1
  • Make this change effective
    sudo sysctl -p
  • Enable POSTROUTING chain by IPTables. Assume your home network is 192.168.1.0/24
    iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o tun0 -j MASQUERADE
  • On Mac OS, only 2 steps further
    sudo route delete default 192.168.1.1
    sudo route -nv add default 192.168.1.186

Notice: 192.168.1.186 is IP address of Ubuntu VM, which becomes a router

Posted in hypervisor, linux, opensource, security, virtualization | Tagged , , , , , , | Comments Off on How to Share a VPN from VM on Mac

Install Ubuntu Saucy on Macbook Pro

Writing this blog for sharing my experience. No guarantee at all. Got a brand new Macbook Pro (Retina, 8G ram, 500G SSD) when traveling to Hong Kong for OpenStack Summit. Spent 2 days to figure out installing Ubuntu Saucy 13.10 x86_64bit specifically for Mac (downloadable from http://releases.ubuntu.com/saucy/ and look for 64-bit Mac (AMD64) server install image) over it.

  1. (optional) Partition 2 disks. 250G each and use the 1st one to reinstall Mac OS from internet. Boot into internet recovery by holding “command” + “alt/option” + R and pressing “power” button. This isn’t a must. I just resized the partition to give another 256G to Ubuntu.
  2. After installing Mac OS, download and install “rEFInd“. You can refer to http://sourceforge.net/projects/refind/ . You’d install from the zip that you download by executing ./install.sh
  3. Insert Ubuntu live USB then boot into it. The partition layout looks like
    /boot 200M
    swap  8G
    /     20G
  4. Since network driver is not correctly loaded at this morning, I use tethered network from an Android device hooking to my Ubuntu box. Therefore I get the network to download packages.
  5. After Ubuntu boots up, you have to convert Ubuntu into EFI mode. Refer to https://help.ubuntu.com/community/UEFI#Converting_Ubuntu_into_EFI_mode
    As the above instruction, you’d install boot-repair (Install “Boot-Repair” (https://help.ubuntu.com/community/Boot-Repair). It takes a little bit time but just follow the instruction to convert grub boot in EFI.
  6. After restart Ubuntu, install the exact Wi- Fi driver. To figure out what wireless hardware installed in your Mac
    $ lspci -nn -d 14e4:
    03:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)

    Then install the particular driver

    apt-get install bcmwl-kernel-source
    modprobe wl
  7. Load audio driver for internal speaker
    hda-verb /dev/snd/hwC1D0 0x1 set_gpio_data 1

Thanks to the references that I got during writing this blog 🙂
http://www.miek.nl/s/37ebe31bd0/
https://help.ubuntu.com/community/UEFI#Converting_Ubuntu_into_EFI_mode
http://askubuntu.com/questions/315950/drivers-for-wireless-card-asus-pce-ac66

 

 

Posted in linux, opensource | Tagged , , , , , | Comments Off on Install Ubuntu Saucy on Macbook Pro

Enable Sametime in Pidgin

For some reason, Sametime plugin is removed off Pidgin. Here is the way to re- enable it

sudo dpkg -l | grep meanwhile
ii libmeanwhile1 2.0 all Blocks meanwhile to maintain some policy
sudo apt-get purge libmeanwhile1 pidgin
sudo apt-get install -t saucy libmeanwhile1 pidgin

-t is the key to make sure the Sametime library is installed from public Saucy repository

sudo dpkg -l | grep meanwhile
ii libmeanwhile1 1.0.2-4.1 amd64 open implementation of the Lotus Sametime Community Client protocol

 

Posted in opensource | Tagged , , , | Comments Off on Enable Sametime in Pidgin

Enable Developer Options @ Android 4.2.2

Go to Setting > About phone > Build number

Tap “Build number” about 10 times, you’d see “enable development settings”

Under “Setting”, you can see “Developer options”, check

  • Android debugging
  • ADB over network
Posted in android, linux, mobile | Tagged , | Comments Off on Enable Developer Options @ Android 4.2.2

Install Android Tools on Fedora 19

Install the package

sudo yum install android-tools

Edit /etc/udev/rules.d/51-android.rules

SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"

PS. 04e8 refers to Samsung device. For other vendors’ device, go to http://developer.android.com/tools/device.html#VendorIds

Change the permission

sudo chmod a+r /etc/udev/rules.d/51-android.rules

To check the attached device

[jeff@fedora19 rules.d]$ adb devices
List of devices attached 
4df1f07e75996f2d device

Get into the shell

adb root
adb shell

Change the file system

mount -o rw,remount /system

 

Posted in android, linux, shell | Tagged , , | Comments Off on Install Android Tools on Fedora 19

Detect Sparse Files

To create one sparse file

truncate --size 10MB sparse_file

To detect

ls -lks sparse_file

To view the stat

stat sparse_file

Reference: http://en.wikipedia.org/wiki/Sparse_file

Posted in linux, misc, opensource | Tagged , , , | Comments Off on Detect Sparse Files