Skip to content

Instantly share code, notes, and snippets.

View lujiacn's full-sized avatar

JL lujiacn

  • earth
  • earth
View GitHub Profile
@lujiacn
lujiacn / gist:8d8bddb699d4103d296bd68936ad9c37
Created July 30, 2016 08:23
generate 64 character key
date +%s | sha256sum | base64 | head -c 64 ; echo
! [remote rejected] master -> master (pre-receive hook declined)
solution:
git pull --rebase
refer to http://stackoverflow.com/questions/7986139/git-error-when-trying-to-push-pre-receive-hook-declined
sudo date -s "$(wget -S "http://www.google.com/" 2>&1 | grep -E '^[[:space:]]*[dD]ate:' | sed 's/^[[:space:]]*[dD]ate:[[:space:]]*//' | head -1l | awk '{print $1, $3, $2, $5 ,"GMT", $4 }' | sed 's/,//')"
@lujiacn
lujiacn / gist:520e3e8abfd1c1b39c30399222766ee8
Last active August 17, 2024 09:06
vundle work with neovim

after install neovim nvim config file folder ~/.config/nvim

$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.config/nvim/bundle/Vundle.vim

set nocompatible              " be iMproved, required
filetype off                  " required
" set the runtime path to include Vundle and initialize

set rtp+=~/.vim/bundle/Vundle.vim

@lujiacn
lujiacn / .Rprofile
Created May 11, 2016 14:07
Ali cran-r
local({r <- getOption("repos")
r["CRAN"] <- "http://mirrors.aliyun.com/CRAN/"
options(repos=r)}
)
@lujiacn
lujiacn / new_gist_file_0
Last active September 5, 2016 04:19
install git via ppa
http://keyserver.ubuntu.com
Search package name
save public key to local
sudo apt-key add save_pub_key_file
@lujiacn
lujiacn / gist:38be004aa5593c3a0fcc
Created March 19, 2016 13:11
mongodb authentication
link: http://ibruce.info/2015/03/03/mongodb3-auth/
不如
码农,程序猿,未来的昏析狮
ArchivesReadingAbout
Mar 3 2015
mongoDB 3.0 安全权限访问控制
MongoDB3.0权限,啥都不说了,谷歌百度出来的全是错的。先安装好盲沟,简单的没法说。
首先,不使用 –auth 参数,启动 mongoDB:
@lujiacn
lujiacn / gist:b1c9867ab61e06086ebb
Created February 16, 2016 10:02
docker with proxy
sudo http_proxy=http://host:port docker daemon &
sudo docker run -it url
@lujiacn
lujiacn / gist:20282bc504145f40c27f
Created November 27, 2015 09:34
add pub key to authorized_keys
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
@lujiacn
lujiacn / go client basic auth
Created November 20, 2015 09:25
go client basic auth
## from https://answers.callfire.com/hc/en-us/articles/205407787-Authentication
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)