Skip to content

Instantly share code, notes, and snippets.

View ozooxo's full-sized avatar

Cong-Xin Cynthia Qiu ozooxo

View GitHub Profile
@ozooxo
ozooxo / gist:8962140
Created February 12, 2014 18:57
Run matlab in Ubuntu terminal: (Top one) quicker, but some plot-related functions seem not fully supported. (Bottom one) fully supported, but slower.
matlab -nojvm
matlab -nodesktop
@ozooxo
ozooxo / gist:8969388
Created February 13, 2014 03:44
merge two pdf files
pdftk HW1_word.pdf HW1_photo.pdf cat output HW1.pdf
@ozooxo
ozooxo / gist:9350235
Created March 4, 2014 16:46
Add matlab mime.types

My ubuntu just detects all .m files as Objective-C source code (text/x-objcsrc), so I'd like to add matlab mine.types to it. So I sudo gedit /etc/mime.types and add a line text/x-matlab m. If I want to automatically start matlab IDE, I should also add application/matlab m.

However, it seems not working at least in Ubuntu 12.04.

@ozooxo
ozooxo / gist:9927789
Last active August 29, 2015 13:58
Install gnome glib (ubuntu 12.04)
sudo apt-get install libglib2.0-dev
sudo apt-get install libgtk2.0-dev #optional
cat >hello.c <<EOL
#include <glib.h>
int main () {
return 0;
}
EOL
gcc `pkg-config --cflags glib-2.0` hello.c `pkg-config --libs glib-2.0` -o hello
@ozooxo
ozooxo / gist:11165252
Created April 22, 2014 04:19
Android Emulator doesn't work (ubuntu 14.04 64bit)
# Error looks like "Failed to start emulator: Cannot run program "/home/beta/
# Software/Android/sdk//tools/emulator": error=2, No such file or directory".
# As people suggested, it works after
beta@landlubber:~/Software/Android/sdk/tools$ mv emulator emulator.bak
beta@landlubber:~/Software/Android/sdk/tools$ ln -s emulator64-arm emulator
@ozooxo
ozooxo / gist:11165806
Created April 22, 2014 05:00
Add i386 architecture in 64 bit ubunbu 14.04
# ./adb in Android Emulator doesn't work. It turns out that that executable file is 32 bit.
# beta@landlubber:~/Software/Android/sdk/platform-tools$ ./adb
# bash: ./adb: No such file or directory
# To install 32 bit architecture in a 64 bit ubunbu 14.04 machine, do
sudo dpkg --add-architecture i386
sudo apt-get -qqy update
sudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386
./adb install ~/workspace/facebook-android-sdk-3.8.0/bin/FBAndroid-7.0.0.apk
# It works :-)
@ozooxo
ozooxo / gist:11166222
Created April 22, 2014 05:28
Manually put location data into Android Emulator
beta@landlubber:~/Software/Android/sdk/platform-tools$ ./adb devices
beta@landlubber:~/Software/Android/sdk/platform-tools$ ./adb -s emulator-5554 emu geo fix -93.24 44.98
@ozooxo
ozooxo / gist:11186985
Created April 22, 2014 17:07
Allow non-root users to capture packets from Wireshark (ubuntu 14.04)
beta@landlubber:~$ sudo apt-get install wireshark
beta@landlubber:~$ sudo dpkg-reconfigure wireshark-common # choose yes
beta@landlubber:~$ sudo usermod -a -G wireshark beta
beta@landlubber:~$ sudo reboot
@ozooxo
ozooxo / gist:eac810bd39f5db8c4d1b
Created May 4, 2014 01:59
Combine two png graphs
montage -geometry 800x600+0+0 a.png b.png a+b.png
@ozooxo
ozooxo / gist:df4a28f40e0f52ed2909
Last active August 29, 2015 14:05
setup apache2 server on ubuntu 14.04
beta@landlubber:~$ sudo apt-get install apache2
beta@landlubber:~$ sudo chown -R beta:beta /var/www/
beta@landlubber:~$ sudo chmod -R 777 /var/www/

beta@landlubber:~$ mkdir -p /var/www/dooqee

It seems that a local folder, e.g., /home/beta/Documents/localhost/rails doesn't work. I guess that's because apache2 doesn't have permission to read user files. I don't quite know how to set that up.