Skip to content

Instantly share code, notes, and snippets.

Cong-Xin Cynthia Qiu ozooxo

Block or report user

Report or block ozooxo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ozooxo
ozooxo / gist:7568836
Created Nov 20, 2013
The ``smlnj`` package cannot be located by simply doing ``sudo apt-get install smlnj`` in ubuntu 12.04. It can be installed by running the following code.
View gist:7568836
beta@landmark:~$ sudo add-apt-repository ppa:hrzhu/smlnj-backport
beta@landmark:~$ sudo apt-get update
beta@landmark:~$ sudo apt-get install smlnj
beta@landmark:~$ sml
Standard ML of New Jersey v110.75 [built: Tue Aug 20 07:15:06 2013]
-
@ozooxo
ozooxo / gist:7811145
Last active Dec 30, 2015
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…
View gist:7811145
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 Dec 17, 2013
Repair ubuntu 12.04 X Window booting system
View gist:8009646

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 Dec 24, 2013
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.
View gist:8118784
sudo update-alternatives --config javac
sudo update-alternatives --config java
@ozooxo
ozooxo / gist:8962140
Created Feb 12, 2014
Run matlab in Ubuntu terminal: (Top one) quicker, but some plot-related functions seem not fully supported. (Bottom one) fully supported, but slower.
View gist:8962140
matlab -nojvm
matlab -nodesktop
@ozooxo
ozooxo / gist:8969388
Created Feb 13, 2014
merge two pdf files
View gist:8969388
pdftk HW1_word.pdf HW1_photo.pdf cat output HW1.pdf
@ozooxo
ozooxo / gist:9280304
Last active May 15, 2019
MPI always gives rank=0, size = 1
View gist:9280304

I accidentally installed multiple versions of MPI's (openmpi, mpich2, ...) in my Ubuntu 12.04 machine. I removed them all, and installed openmpi again; however, after fixing that (I never try before that), my MPI always gives rank=0, size = 1. The reason is that the removal process is incomplete, hence causes file sharing conflict. It can be seen from the following test

beta@landmark:~$ whereis mpicc
mpicc: /usr/bin/mpicc.mpich2 /usr/bin/mpicc.openmpi /usr/bin/mpicc
/usr/bin/X11/mpicc.mpich2 /usr/bin/X11/mpicc.openmpi /usr/bin/X11/mpicc
/usr/share/man/man1/mpicc.1.gz

It turns out that the packages libmpich2-3 and libmpich2-dev failed to be removed. So after apt-get remove libmpich2-3 libmpich2-dev, everything goes fine.

@ozooxo
ozooxo / gist:9350235
Created Mar 4, 2014
Add matlab mime.types
View gist:9350235

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 Aug 29, 2015
Install gnome glib (ubuntu 12.04)
View gist:9927789
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:9959489
Last active Sep 29, 2017
clean up ubuntu disk space
View gist:9959489
sudo apt-get clean # cleaning up of the apt cache. it gives me roughly 500MB cache
sudo apt-get purge linux-image-3.5.0-37-generic # roughly 100MB per removed kernal. kernal list is in /boot/.
You can’t perform that action at this time.