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:10600945
Last active November 7, 2016 21:06
Set up honeyd (ubuntu 12.04)
# installation
sudo apt-get install honeyd
sudo apt-get install nmap #(supported software for port scanning)
# check my eth0 address
ifconfig
### eth0 Link encap:Ethernet HWaddr 00:26:2d:f9:db:be <-----------------use this one
### inet addr:192.168.0.103 Bcast:192.168.0.255 Mask:255.255.255.0
### inet6 addr: fe80::226:2dff:fef9:dbbe/64 Scope:Link
@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.

@ozooxo
ozooxo / gist:9b655b8ccf383bbd8836
Last active August 29, 2015 14:05
在中国大陆境内安装配置ruby on rails

基本上按照 https://gorails.com/setup/ubuntu/14.04 的安装方法是可以的。

第一个遇到的问题是 gem install rails 报错

ERROR: Could not find a valid gem 'watir' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)
@ozooxo
ozooxo / gist:299ab37080bba24b8c0e
Created October 9, 2014 04:06
Setup CImg in ubuntu 14.04
$ sudo apt-get install libx11-dev
$ sudo apt-get install cimg-dev cimg-doc cimg-examples
$ cat >lena.cpp <<EOL
#include "CImg.h"
using namespace cimg_library;
int main() {
CImg<unsigned char> image("lena.jpg"), visu(500,400,1,3,0);
const unsigned char red[] = { 255,0,0 }, green[] = { 0,255,0 }, blue[] = { 0,0,255 };
image.blur(2.5);
@ozooxo
ozooxo / gist:cfca2c531824b6925260
Created November 5, 2014 11:03
Use ImageJ as a third party java library
wget "http://imagej.nih.gov/ij/download/linux/ij148-linux64.zip"
unzip ij148-linux64.zip
cd ImageJ
jar -xvf ij.jar # simply do
# $ javac -classpath '.:ij.jar' Algorithm.java
# $ java Algorithm
# will cause run time error for not finding some particular classes
# (which are actually in the .jar file). Reason unknown.
cd ..
mv ImageJ/ij ij