Skip to content

Instantly share code, notes, and snippets.

View lujiacn's full-sized avatar

JL lujiacn

  • earth
  • earth
View GitHub Profile
package controllers
import (
"encoding/base64"
"errors"
"github.com/robfig/revel"
"net/http"
"strings"
)
@lujiacn
lujiacn / Go Revel nginx.conf
Created October 22, 2015 09:23 — forked from tim-peterson/Go Revel nginx.conf
Revel Framework nginx.conf to make Revel app work outside of localhost, i.e., on my live, personal-website.com
http{
index index.html;
server {
listen 80;
root /gocode/src/personalwebsiteapp;
server_name personal-website.com;
@lujiacn
lujiacn / gist:1ac3f7e6cef446319476
Last active November 20, 2015 09:26
git connect-proxy
http://www.zeitoun.net/articles/ssh-through-http-proxy/start
Configure the client
I suppose you are on a Linux system (debian for example). First you have to compile the connect binary which will help your ssh client to use proxies (HTTPS in our case). Then you have to configure your ssh client to tell him to use HTTPS proxy when he tries to connect to your ssh server.
Install the connect software :
On debian system, just install the connect-proxy package :
sudo apt-get install connect-proxy
On other Linux systems, you have to compile it :
@lujiacn
lujiacn / install-tmux
Created October 18, 2015 05:29 — forked from rothgar/install-tmux
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
git clone https://github.com/lujiacn/dot-vimrc.git .vim
git clone https://github.com/lujiacn/tmux.git tmux
ln -s .vim/vimrc ~/.vimrc
ln -s tmux/tmux.conf ~/.tmux.conf
#vim vundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
:BundleInstal
@lujiacn
lujiacn / 0_reuse_code.js
Created October 16, 2015 06:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lujiacn
lujiacn / docker.sh
Created October 13, 2015 06:46 — forked from nsisodiya/docker.sh
Upgrade to Docker 1.8 on ubuntu box
sudo su
echo deb https://apt.dockerproject.org/repo ubuntu-`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d'=' -f2` main >> /etc/apt/sources.list.d/docker.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F76221572C52609D
apt-get update
apt-get purge lxc-docker*
apt-get purge docker.io*
apt-get install docker-engine
exit
@lujiacn
lujiacn / reflection.go
Created September 23, 2015 05:23 — forked from drewolson/reflection.go
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
= Few steps to enable Rserve daemon at startup of your Linux server =
# install [R] (tested with 2.9)
# install Rserve as user:
# create `Rserve.sh` startup script in `/home/user/R/x86_64-pc-linux-gnu-library/2.9/Rserve`:
{{{
#!/bin/bash
/usr/bin/R CMD Rserve --vanilla
}}}
# check that `Rserve.sh` is executable, try to launch it and verify Rserve is available (`ps -u user | grep Rserve` should return something, then kill Rserve)
/*Rserve go client */
package rservcli
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"net"
"strings"