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: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: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
@ozooxo
ozooxo / gist:05dc8ffa81d390fd8ef4
Created November 7, 2014 03:55
Convert several png's to one pdf
sudo apt-get install imagemagick
convert *.png output.pdf
@ozooxo
ozooxo / gist:7a23dd1c280b0a21f43d
Created November 9, 2014 04:50
Git synchronizing one repo in different computers
$ git remote add alt https://github.com/ozooxo/Schemannian.git
$ git remote update
$ git pull alt master
$ git add *
$ git commit -m "push from a different computer"
$ git push alt master
@ozooxo
ozooxo / gist:72be35811471785e2f86
Last active August 29, 2015 14:10
Setting up multiple versions of JVM & switching (tested in ubuntu 14.04 64bit)
# Setting up multiple versions of JVM & switching
beta@landslide:~$ sudo add-apt-repository ppa:webupd8team/java
beta@landslide:~$ sudo apt-get update
beta@landslide:~$ sudo apt-get install openjdk-6-jre openjdk-6-jdk icedtea-6-plugin
beta@landslide:~$ sudo apt-get install openjdk-7-jre openjdk-7-jdk icedtea-7-plugin
beta@landslide:~$ sudo apt-get install oracle-java7-installer
beta@landslide:~$ sudo apt-get install oracle-java8-installer
@ozooxo
ozooxo / gist:ae847e2414d28befa8e7
Created December 10, 2014 07:22
Set up frequencies for dual monitors
$ xrandr
Screen 0: minimum 320 x 200, current 3600 x 1080, maximum 32767 x 32767
VGA1 connected 1680x1050+1920+30 (normal left inverted right x axis y axis) 477mm x 268mm
1920x1080 60.0 +
1680x1050 60.0*
1280x1024 75.0 60.0
1440x900 59.9
1280x960 60.0
1152x864 75.0
1024x768 75.1 70.1 60.0
@ozooxo
ozooxo / gist:e52422288d3212e1f52f
Last active August 29, 2015 14:12
繁體中文windows配置eclipse+maven心得

Windows 7專業版(非旗艦版或企業版)除非買別的語言的重灌,不能安裝或改變顯示語言,所以如果本來是中文版就不能靠修改設置變英文版的。

從oracle.com下載java jdk(SE或EE)安裝,並沒有什麼問題。但是oracle java安裝過程中沒任何地方可以選擇使用非系統語言(比如選英文)。不過安裝好之後cmd如果java -help之類的會一堆『???????』,結果是因為我之前想全變英文,把windows設置的『非unicode程式的語言』改了。改回『繁體中文』就正常顯示,所以下面就是熟悉台灣cs專業詞彙的問題了。

eclipse基本下載了免安裝copy過去就好。不要忘了去『系統-控制台-系統及安全性-系統-進階系統設定-環境變數』裡面把$JAVA_HOME$Path改了。

maven安裝後,要照著 http://maven.apache.org/download.cgi#Installation 去修改一堆『環境變數』。

eclipse運行時如果java報錯,顯示的也是中文(其實又是『???????』)。這邊去eclipse->window->preferences->General->workspace->Text file encoding那裡,從defaultCp1252改成UTF-8,錯誤信息就能正常顯示啦(比如『錯誤:找不到或無法載入主要類別 com.micareo.engine.AnalysisEngine』)。

@ozooxo
ozooxo / gist:edc9f92d1a737b2aa507
Created January 16, 2015 03:08
Start/Stop Riak
# There seems a Erlang build in in this package. To actually run Erlang environment,
# you need to ``sudo apt-get install erlang`` and ``erl`` but that's a too old version.
beta@landslide:~$ curl https://packagecloud.io/install/repositories/basho/riak/script.deb | sudo bash
beta@landslide:~$ sudo apt-get install riak=2.0.0-1
beta@landslide:~$ sudo -s
root@landslide:~# ulimit -n 65536
root@landslide:~# riak start
root@landslide:~# riak stop
ok
@ozooxo
ozooxo / gist:7ea98a96f44bd46e4234
Created February 13, 2015 09:55
Ubuntu .desktop files position
/usr/share/applications
@ozooxo
ozooxo / gist:0479325e58c3652a19f5
Created March 20, 2015 11:41
Install Mamba in Ubuntu 14.04
$ python --version # check python version, >= 2.6 needed
Python 2.7.6
$ sudo apt-get install python-pip
$ pip search Pillow
Pillow - Python Imaging Library (Fork)
INSTALLED: 2.3.0
LATEST: 2.7.0
pilbox - Pilbox is an image processing application server
built on the Tornado web framework using the
Pillow Imaging Library