Skip to content

Instantly share code, notes, and snippets.

View mid9commander's full-sized avatar

Han Qiu mid9commander

  • Click Therapeutics
  • New York
View GitHub Profile
@mid9commander
mid9commander / x300
Created October 13, 2011 03:39
thinkpad x300 mouse left click
ThinkPad x300 trackpoint mouse left click ceased to work intermittently after waking up. To fix this, use the trackpad mouse left click and then the trackpoint mouse left click starts working. weird.
@mid9commander
mid9commander / tcpdump, wireshark
Created January 23, 2011 05:59
tcpdump, wireshark
TCPDUMP can capture packet info, if you capture the hex info (headers and datagrams) you will need a GUI tool to see it easily. Wireshark = ethereal would be what you are looking for.
sudo apt-get install wireshark
@mid9commander
mid9commander / MBP1,1 touchpad in Linux Ubuntu 10.10
Created January 19, 2011 19:48
MBP1,1 touchpad in Linux Ubuntu 10.10
install gpointing-device-setting 1.5.3 from
http://packages.debian.org/squeeze/i386/gpointing-device-settings/download
and
Enable tapping, for some weird reason, enabling tapping makes 2 finger clicking behave like it should. It was moving too much before.
I just love Ubuntu more and more.
@mid9commander
mid9commander / gist:732922
Created December 8, 2010 05:14
Make Command act like Meta in Iterm
Set Option key to +ESC in both global and xterm.
@mid9commander
mid9commander / Oracle instant client set up in Ubuntu
Created November 9, 2010 21:43
the low down on oracle, database adapter, rails oracle connectivity
yes, I am unfortunately enough to have to connect to an Oracle database from Rails, and I hate the gut of it. But here are the steps of making it work. These steps are for Ubuntu Lucid
These instructions are for ruby-oci8 > 2.03, if you have to use an older version of oci8 you are in for some major grief
1. install oracle instant client, grab the basic, sql, devel rpm here
http://www.oracle.com/technetwork/topics/linuxsoft-082809.htmlhttp://www.oracle.com/technetwork/topics/linuxsoft-082809.html
2. apt-get install libaio1 apt-get install libaio1
3. install alien, which converts a rpm file into a .deb file
apt-get install alien apt-get install alien
4. convert the rpm into debian package
alien oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
@mid9commander
mid9commander / change Fn key mod in ubuntu for MBP
Created November 9, 2010 15:56
fn key mode in ubuntu for MBP
Change Function Key behavior
This section of the document describe how to change the behavior of 'fn' key to better match what user expect. (See #201711, #162083)
Here a description of each behavior :
0 = disabled : Disable the 'fn' key. Pressing 'fn'+'F8' will behave like you only press 'F8'
1 = fkeyslast : Function keys are used as last key. Pressing 'F8' key will act as a special key. Pressing 'fn'+'F8' will behave like a F8.
2 = fkeysfirst : Function keys are used as first key. Pressing 'F8' key will behave like a F8. Pressing 'fn'+'F8' will act as special key (play/pause).
Ubuntu 9.04 and Newer
Temporarily
All you need to do is install pommed and it will work.
~/project $ git init
~/project $ git add .
~/project $ git commit -m "first commit"
~/project $ cd ~/Dropbox/git
~/Dropbox/git $ mkdir project.git
~/Dropbox/git $ cd project.git
~/Dropbox/git $ git init --bare
~/Dropbox/git $ cd ~/project
It is great to be able to run Linux on OSX in headless mode, this serves me very well because I have no choice but to use a Mac at work,
and there are many occasions where I need to have a Linux machine.
There are a couple reasons I don't like running virtual machines in regular mode.
1. It consumes way too much memory and CPU than I am willing to give up
2. It consumes way too much "attention" than I am willing ti give, for example, when you tab into your VM,
your mouse and keyboard gets captured and you have to hotkey out of it, it is just disruption to my work flow.
Headless mode comes in handy and solves the problems above because
1. It consumes about half of the memory and CPU because it does not handle monitor,
mouse and keyboard so the system resources are dedicated to the core functionality.