Tuesday, November 3, 2015

Git credential store

If your online git server does not allow ssh (like Microsoft Visual Studio Online), you can store git credentials in a file (not safe)

git config credential.helper store
see https://git-scm.com/docs/git-credential-store

Tuesday, September 29, 2015

plot multiple columns on the same graph in R with reshape2 and ggplot2

http://stackoverflow.com/questions/9531904/plot-multiple-columns-on-the-same-graph-in-r


s <- span=""> 
"A       B        C       G       Xax
0.451   0.333   0.034   0.173   0.22        
0.491   0.270   0.033   0.207   0.34    
0.389   0.249   0.084   0.271   0.54    
0.425   0.819   0.077   0.281   0.34
0.457   0.429   0.053   0.386   0.53    
0.436   0.524   0.049   0.249   0.12    
0.423   0.270   0.093   0.279   0.61    
0.463   0.315   0.019   0.204   0.23
"
d <- span=""> read.delim(textConnection(s), sep="")

library(ggplot2)
library(reshape2)
d <- span=""> melt(d, id.vars="Xax")

# Everything on the same plot
ggplot(d, aes(Xax,value, col=variable)) + 
  geom_point() + 
  stat_smooth() 

Wednesday, September 23, 2015

Removing services from system boot

sudo update-rc.d -f postgresql remove
sudo update-rc.d -f mysql remove

or

In the Upstart system:
create a file called sudo vi /etc/init/nginx.override
and put the word "manual" in it.


sudo systemctl disable apache2  (Does not work for 14.04. It's for newer Ubuntu releases)

Stopping/starting nginx web server under Ubuntu 14.04

sudo service nginx start
sudo service nginx stop
sudo service nginx restart

Friday, September 18, 2015

More git commands

git remote show origin
* remote origin
  URL: git://github.com/rails/rails.git
  Remote branch merged with 'git pull' while on branch master
    master
  Tracked remote branches
    1-2-stable 2-0-stable 2-1-stable 2-2-stable 3-0-unstable master

$ git ls-remote --heads origin
5b3f7563ae1b4a7160fda7fe34240d40c5777dcd  refs/heads/1-2-stable
71926912a127da29530520d435c83c48778ac2b2  refs/heads/2-0-stable

$git log --decorate=full
$git log --decorate=full --pretty=oneline

#If I made a hard reset to a previous commit (but I had already pushed last commit), then I have to make a forced push:

$git reset --hard a9355ba42f5418c
$git push origin HEAD --force  #Erases in the online server the last commit

Thursday, August 27, 2015

Adding source to an empty remote git account

Set up your local directory

Set up Git on your machine if you haven't already.
mkdir /path/to/your/projectcd /path/to/your/projectgit initgit remote add origin git@bitbucket.org:xxx/xxx.git

Create your first file, commit, and push

git commit -m 'Initial commit with contributors'git push -u origin master

Tuesday, May 19, 2015

rJava installation problem : libjvm.so: cannot open shared object file: No such file or directory


export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
or
export LD_LIBRARY_PATH=/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server

then 
R CMD javareconf
or
R CMD javareconf -e

from : http://askubuntu.com/questions/584529/libjvm-so-cannot-open-shared-object-file-no-such-file-or-directory

Thursday, March 12, 2015

git pulling the upstream changes (repo forked from Github)

First set the upstream repo (done only once)
git remote add upstream git://github.com/pjhyett/github-services.git
Then everytime you want to pull/fetch

git fetch upstream
or

git pull upstream


Sunday, February 15, 2015

Removing rows with NAs in R

http://stackoverflow.com/questions/4862178/remove-rows-with-nas-in-data-frame

Basically : use complete.cases() and na.omit()

Sunday, January 18, 2015

Eclipse luna crashes on new project in Kubuntu 14.04

http://askubuntu.com/questions/537216/eclipse-luna-crashes-on-new-project-in-kubuntu-14-04


2
down voteaccepted
As indicated in Eclipse auto shutdowns when creating new project one workaround to this bug is to change the GTK2 theme in System Preferences -> Application Appearance -> GTK (I personally useAurora: sudo apt-get install -y gtk2-engines-aurora).
Alternatively, a patch to oxygen is available here, and has been pushed to the active development branch of oxygen. oxygen-gtk2-1.4.6-1 should be OK but as of now oxygen-gtk2-1.4.5 is still the most recent stable version.