Skip to content

Instantly share code, notes, and snippets.

View zilongshanren's full-sized avatar
🎯
Focusing

子龙山人 zilongshanren

🎯
Focusing
View GitHub Profile
使用 git svn clone 更新仓库,然后使用下面的命令重写commit历史去除大文件。
然后再push到远程仓库。
1. git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | awk '{if($3>524288000) print$1}')" > large-files.txt,将所有大于500M的提交文件列出来
2. cat large-files.txt| awk '{print $2}' | tr '\n' ' ' > large-files-inline.txt
3. git filter-branch -f --prune-empty --index-filter "git rm -rf --cached --ignore-unmatch `cat large-files-inline.txt`" --tag-name-filter cat -- --all
@zilongshanren
zilongshanren / arch_vbox.md
Created November 10, 2018 06:26 — forked from dannycastonguay/arch_vbox.md
Installing Arch Linux on VirtualBox in Windows 10 for beginners

Installing Arch Linux on VirtualBox in Windows 10

I recently upgraded to a new system, and instead of running Arch Linux natively I've decided to run it inside VirtualBox on Windows 10. Below I note down the steps I took, which closely follow the excellent wiki pages of archlinux. But along the way, I also noted a few other steps steps I took to make this system very comfortable, which you'll have to figure out for yourself if you like them or not!

Setting up Windows 10 to be ready

There isn't much of preparation required, given that I started from scratch, but I did have to setup my windows environment a little bit.

  1. Install the windows package manager chocolatey
  2. Install qBittorrent (which will be used to download an iso copy of arch) by running the following command from the command line choco install qbittorrent (recommended to run the command line as an adm
@zilongshanren
zilongshanren / upgrade-linux-kernel
Created January 22, 2017 15:21
阿里云 Ubuntu 14.04 升级 Linux 内核到 4.9
1. 下载 linux 4.9 debian 镜像
```
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.5/linux-image-4.9.5-040905-generic_4.9.5-040905.201701200532_amd64.deb
```
2. 安装镜像
```
dpkg -i linux-image-4.9.5*.deb
@zilongshanren
zilongshanren / inference.md
Created December 13, 2016 02:00 — forked from swannodette/inference.md
Externs Inference

Externs Inference

Integrating third party JavaScript libraries not written with Google Closure Compiler in mind continues to both be a source of error for users when going to production, and significant vigilance and effort for the the broader community (CLJSJS libraries must provide up-to-date and accurate externs).

In truth writing externs is far simpler than most users imagine. You only need externs for the parts of the library you actually intend to use from ClojureScript. However this isn't so easy to determine from Closure's own documentation. Still in the process of writing your code it's easy to miss a case. In production you will see the much dreaded error that some mangled name does not exist. Fortunately it's possible to enable some compiler flags :pretty-print true :pseudo-names true to generate an advanced build with human readable names. However debugging missing externs means compiling your production build for each missed case. So much time wasted for such simple mistakes damages our sen

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@zilongshanren
zilongshanren / spidermonkey.patch
Created October 31, 2016 06:06
Spidermonkey 45 compile patch
diff --git a/js/src/moz.build b/js/src/moz.build
index 591d7a6..5cb2cc5 100644
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -66,7 +66,12 @@ CONFIGURE_SUBST_FILES += [
'js.pc',
]
-if not CONFIG['JS_STANDALONE']:
+if CONFIG['JS_STANDALONE']:
@zilongshanren
zilongshanren / planck-dependency.md
Created August 4, 2016 02:12 — forked from borkdude/planck-dependency.md
Fast REPL session with a cljs library using Planck

Get a fast starting REPL session with a ClojureScript library using Planck.

This is a draft of what will be eventually a blog post. Feedback is welcome.

It started by asking this question on StackOverflow. A good answer turned out to be Planck. This is how you solve it with Planck.

First, decide what dependencies Planck needs to load. This is easily done with boot like this:

$ boot --dependencies org.clojars.micha/boot-cp        ; load with-cp task that helps exporting minimal classpath to file

--dependencies com.andrewmcveigh/cljs-time:"0.4.0" ; load dependency you actually want to try

@zilongshanren
zilongshanren / renew-certs
Created July 30, 2016 08:40 — forked from jonaharagon/renew-certs
Auto Renewal Script for Let's Encrypt and Discourse (@ DigitalOcean)
#!/bin/bash
web_service='nginx'
config_file="/opt/letsencrypt/settings.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
@zilongshanren
zilongshanren / Clojure_on_RaspberryPi_OSX.md
Created June 20, 2016 08:20 — forked from akiatoji/Clojure_on_RaspberryPi_OSX.md
Running Clojure on Raspberry Pi with OS X

Clojure on Raspberry Pi with OS X

"Clojure running on Raspberry Pi" sounded so cool that I just had to give it a try.

Install JDK

  • Download ARM JDK from Oracle and instlal on Raspberry Pi
  • Change visudo to contain the following
(setq configuration-layer--elpa-archives
'(("melpa-cn" . "https://elpa.zilongshanren.com/melpa/")
("org-cn" . "https://elpa.zilongshanren.com/org/")
("gnu-cn" . "https://elpa.zilongshanren.com/gnu/")))
;; https://github.com/syl20bnr/spacemacs/issues/2705
;; (setq tramp-mode nil)
(setq tramp-ssh-controlmaster-options "-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no")