Skip to content

Instantly share code, notes, and snippets.

View ETiV's full-sized avatar
🛥️
船迟又遇打头风

ETiV

🛥️
船迟又遇打头风
  • Shanghai, China
  • 21:58 (UTC +08:00)
View GitHub Profile
// ==UserScript==
// @name CleanComments
// @namespace ForBetterJanDan
// @description 眼不见心不烦, 删除煎蛋多说"吐槽"中某些人的评论
// @include http://jandan.net/*
// @version 1
// ==/UserScript==
document.addEventListener('DOMNodeInserted',function(){
// 屏蔽关键字列表, 内容为多说的UserID
// ==UserScript==
// @name CleanComments
// @namespace ForBetterJanDan
// @description 眼不见心不烦, 删除煎蛋多说"吐槽"中某些人的评论
// @include http://jandan.net/pic*
// @include http://jandan.net/ooxx*
// @version 2
// ==/UserScript==
if ($ != undefined) {
@ETiV
ETiV / aria2.conf
Created June 26, 2013 15:02
my aria2 config file. start by command: /usr/local/bin/aria2c --conf-path=/etc/aria2.conf -D
#开启RPC 远程访问
enable-rpc=true
#rpc-listen-port=16800
rpc-listen-all=true
rpc-allow-origin-all=true
rpc-passwd=i-am-http-auth-password
rpc-user=i-am-http-auth-user
event-poll=epoll
log=/var/aria2/logs
@ETiV
ETiV / google_result_directly.js
Last active December 19, 2015 00:09
去掉 Google 搜索结果页的跳转
// ==UserScript==
// @name 去掉Google搜索跳转
// @namespace ETiV
// @include https://www.google.co*
// @include http://www.google.co*
// @grant GM_setValue
// @version 1
// ==/UserScript==
document.addEventListener('DOMNodeInserted',checksearch,false);
@ETiV
ETiV / LiveEdit-Enabler-for-JetBrains-IDEs.md
Last active December 18, 2015 16:29
JetBrains IDEs (IntelliJ/WebStorm/PySharm etc.) LiveEdit Enabler. Fix Port "63342" Listening Issue.

Example environment is on Windows. You may need to fix paths to fit your operating system.

  1. Open file <WebStorm_Installed_Dir>/bin/WebStorm.exe.vmoptions
  2. Add one line, here I'm using port 53342, you may choose any other ports you like, but shouldn't higher than 62000, that's the reason why the origin LiveEdit can't be used:
-Drpc.port=53342
  1. Restart the IDE. Configure the Chrome JB Plugin, change the port you've chosen.
  2. If that port is not using by any other applications, the Chrome JB plugin can be use now.
@ETiV
ETiV / random_string.js
Created June 5, 2013 09:44
JavaScript Generate Random String
// get random string by length `len`
function _getRandomString(len) {
len = len || 32;
var $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYAabcdefghijklmnopqrstuvwxyz0123456789_'; // string set
var maxPos = $chars.length;
var pwd = '';
for (i = 0; i < len; i++) {
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
@ETiV
ETiV / nginx.conf
Created June 4, 2013 17:24 — forked from leon/nginx.conf
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@ETiV
ETiV / CentOS-Install-gitlab_ci.sh
Last active March 11, 2021 15:28
Install gitlab-ci on CentOS. I've installed on CentOS 6.4 64bit.
#!/bin/sh
rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
curl -L https://get.rvm.io | bash -s stable
rvm install 2.0.0
rvm use 2.0.0@global --default
# for chinese user, if you have a wonderful speed ignore this part
# to have a faster download speed
# switch gem source to ruby.taobao.org
@ETiV
ETiV / OptionHandlerFactory.cc
Created June 3, 2013 16:31
aria2 server connection unlimit.
/**
* vim OptionHandlerFactory.cc
* /PREF_MAX_CONNECTION_PER_SERVER
* change the next line `1, 16,` to `1, -1`
* :wq
*/
// then make
@ETiV
ETiV / build_md5_for_directory.sh
Last active December 17, 2015 05:39
要点: find 的 -exec 可以出现很多次. 并依出现次序执行命令
#!/bin/sh
cd "$1"
#find * -type f -print0 | xargs -0 $DIR/digest.sh
find * -name "*" -type f -exec stat --printf='%s ' '{}' \; -exec md5sum '{}' \;
cd - > /dev/null