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 / remote-login.md
Last active August 29, 2015 14:17
Install MongoDB etc for "MongoDB University M101J" course in Ubuntu 14.04
beta@landlubber:~$ uname -a
Linux landlubber 3.13.0-46-generic #79-Ubuntu SMP Tue Mar 10 20:06:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
beta@landlubber:~$ java -version
java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)
beta@landlubber:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
[sudo] password for beta:
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.OFXWl1OKUd --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/minecraft-installer-peeps-minecraft-installer.gpg --keyring /etc/apt/trusted.gpg.d/webupd8team-java.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
@ozooxo
ozooxo / screenshot.png
Last active August 29, 2015 14:17
Change Eclipse Java version
beta@landlubber:/usr/lib/java$ update-alternatives --get-selections | grep java # java jvm location can be found using this command
appletviewer manual /usr/lib/jvm/java-7-oracle/bin/appletviewer
ControlPanel manual /usr/lib/jvm/java-7-oracle/jre/bin/ControlPanel
extcheck manual /usr/lib/jvm/java-7-oracle/bin/extcheck
idlj manual /usr/lib/jvm/java-7-oracle/bin/idlj
itweb-settings auto /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/itweb-settings
jar manual /usr/lib/jvm/java-7-oracle/bin/jar
jarsigner manual /usr/lib/jvm/java-7-oracle/bin/jarsigner
java manual /usr/lib/jvm/java-7-oracle/jre/bin/java
javac manual /usr/lib/jvm/java-7-oracle/bin/javac
@ozooxo
ozooxo / ubuntu+codeblocks.md
Last active August 29, 2015 14:18
openCV miscellaneous

linux這邊就沒有事先被compile好的版本,具體compile可以follow這個link

cd ~/opencv
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install
@ozooxo
ozooxo / gist:34339af4ea960e233d35
Last active August 29, 2015 14:19
Solve consistency between apt-get and dpkg tree

Cause

I face this problem because I accidentally try to install MongoDB 3.0.x (from http://repo.mongodb.org/apt/ubuntu) while actually a MongoDB 2.6.8 (provided by ubuntu) is already installed in the same computer. Therefore, both mongod and mongo commands are still point to the old version (which doesn't work actually). Since the official installation document said that "You cannot install this package concurrently with the mongodb, mongodb-server, or mongodb-clients packages provided by Ubuntu", this just cannot work.

A better way is to first completely uninstalled the older version before install the new one, but I already missed that time. So

sudo apt-get purge mongodb mongodb-clients mongodb-server mongodb-dev
sudo apt-get purge mongodb-10gen

cannot remove it completely (not sure whether that's the exact case), and \usr\bin\mongo and ``\usr\bin\mongo

@ozooxo
ozooxo / gist:1de91f79228885f881c1
Last active August 29, 2015 14:20
Setup Github Page, Jekyll, and Jekyll Bootstrap

My original plan is to setup a good viewing environment for markdown files (analyzing results produced by some template engine). No blog functions are needed. However, it turns out to be tedious and not as useful as expected.

To setup Ruby, basically following this link is fine. Note that rails (or at least node.js) is needed. Pure ruby is not enough.

To setup Jekyll, following this link. After installation, running

$ bundle exec jekyll serve
@ozooxo
ozooxo / gist:f87c5cb4d3028cc1bdf7
Last active August 29, 2015 14:23
Setup Tomcat7 + Eclipse Luna (ubuntu 14.04)

Tomcat7

Setup tomcat7 is easy. Just do

sudo apt-get install tomcat7

and http://localhost:8080/ will work already. The default source files are in /usr/share/tomcat7, while the default path is in /var/lib/tomcat7/webapps/ROOT.

@ozooxo
ozooxo / gist:7811145
Last active December 30, 2015 09:39
Tools like highlight.js can help detecting the name of a programming language from a piece of code. The set up in ubuntu is as follows. You can further decrease the number of programming languages by commenting the potential languages in line 641--707 of highlight.js file. It can increase the speed a little bit, but it's still to slow for a huge…
beta@landmark:~/Downloads$ sudo apt-get install nodejs
beta@landmark:~/Downloads$ sudo apt-get install npm
beta@landmark:~/Downloads$ npm install highlight.js
beta@landmark:~/Downloads$ node
> var hljs = require('highlight.js');
undefined
> hljs.highlightAuto("<p>abc</p>").language;
'xml'
@ozooxo
ozooxo / gist:8009646
Created December 17, 2013 18:01
Repair ubuntu 12.04 X Window booting system

After trying to repair the touch-pad of my Ubuntu 12.04, the system cannot boot from X Window. It turns out that xserver-xorg is accidentally removed by sudo apt-get autoremove process after I installed xserver-xorg-input-synaptics. To repair it, just go to the recovery mode and

sudo apt-get install xserver-xorg
sudo dpkg-reconfigure xserver-xorg
@ozooxo
ozooxo / gist:8118784
Created December 24, 2013 23:30
Ubuntu 12.04 in my laptop cannot my own "magnetar" game. The reason is that the default java version is too old. It works after I manually changed it from openjdk-6 to openjdk-7.
sudo update-alternatives --config javac
sudo update-alternatives --config java
@ozooxo
ozooxo / note.md
Created August 11, 2015 09:22
Setup PostgreSQL

Basically follow this link will work.

To give access of remote users using postgresql-client, one need to add the following line in /etc/postgresql/9.3/main/pg_hba.conf.

host    all             all             0.0.0.0/0               md5