Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name GoogleKingKong
// @namespace http://userstyles.org
// @description 改善 Google 的搜索结果界面,提高阅读效率
// @version 5.6
// @author SUCCESS
// @include http://www.google.*/search*
// @include http://www.google.*/*#*
// ==/UserScript==
/* 更新记录 ***********************************************************************
@d0zingcat
d0zingcat / installChaCha20.sh
Created May 9, 2016 05:02
Install ChaCha20 Encryption for Shadowsocks On CentOS
yum install m2crypto gcc -y
wget -N --no-check-certificate https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar zfvx libsodium-*.tar.gz
cd libsodium-*
./configure
make && make install
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

Keybase proof

I hereby claim:

  • I am d0zingcat on github.
  • I am d0zingcat (https://keybase.io/d0zingcat) on keybase.
  • I have a public key ASDXr5ClrnFbfQHQ-d9Gl6YuqX7ohz8IH-nlE46FjVSc3Qo

To claim this, I am signing this object:

@d0zingcat
d0zingcat / wechat-ofobicyclehacker-app.py
Last active August 14, 2016 17:04
The main feature of one python based back side for wechat official account (Powered by LeanEngine)
# This code is for my post: Using Flask and LeanCloud to build a backend of Wechat Official Account
# welcome to visit the post: https://blog.d0zingcat.xyz/2016/07/24/Python/Using%20Flask%20and%20LeanCloud%20to%20build%20a%20backend%20of%20Wechat%20Official%20Account/#more
# coding: utf-8
from datetime import datetime
from flask import render_template, Flask, request, make_response, jsonify, abort
from flask_sockets import Sockets
from views.todos import todos_view
import xml.etree.ElementTree as ET
@d0zingcat
d0zingcat / picpatch.py
Created March 30, 2017 13:23
This is a py-program to patch JPEG Photos to prevent auto-rotate in markdown files.
from PIL import Image
import os, argparse, pexif
def picProcessing(picPath, isForce=False):
try:
img = pexif.JpegFile.fromFile(picPath)
https://www.google.com.hk/search?newwindow=1&q=compile+nginx&oq=compile+nginx&gs_l=psy-ab.3...391087.392005.0.392239.7.6.0.0.0.0.288.288.2-1.1.0....0...1.1.64.psy-ab..7.0.0.LWGlKWnAerY | compile nginx - Google Search
https://www.nginx.com/resources/admin-guide/installing-nginx-open-source/ | How to Install NGINX Open Source | NGINX
https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-16-04-server | How To Configure Nginx as a Web Server and Reverse Proxy for Apache on One Ubuntu 16.04 Server | DigitalOcean
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04 | How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 16.04 | DigitalOcean
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04 | How To Install Nginx on Ubuntu 16.04 | DigitalOcean
https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtua
@d0zingcat
d0zingcat / java notes.md
Last active December 1, 2017 05:03
java notes

单例模式

单例模式的主要作用是保证在Java程序中,某个类只有一个实例存在。一些管理器和控制器常被设计成单例模式。

单例模式有很多好处,它能够避免实例对象的重复创建,不仅可以减少每次创建对象的时间开销,还可以节约内存空间;能够避免由于操作多个实例导致的逻辑错误。如果一个对象有可能贯穿整个应用程序,而且起到了全局统一管理控制的作用,那么单例模式也许是一个值得考虑的选择。

Maven

@d0zingcat
d0zingcat / mess notes.md
Last active December 20, 2017 16:21
mess notes

Docker notes

  1. docker Network differenece between EXPOSE and PUBLISH: Exposing ports is a way of documenting which ports are used, but does not actually map or open any ports. Exposing ports is optional.

Best practives in [?]nix

command line proxy: proxychains

@d0zingcat
d0zingcat / linux notes.md
Last active December 18, 2017 08:22
linux notes

Without other narrates, this note is only intended for Debian or Ubuntu.

command function usage
update-alternatives multi-version runnable program preference management
test -x ${file} test if ${file} exists and granted with executable permission
if [ -f ${file} ] test if this file is a regular file
set -e cause the shell to exit if any subcommand or pipeline returns a non-zero status
@d0zingcat
d0zingcat / git notes.md
Last active December 20, 2017 16:24
git notes
commands scope common user cases
git reset Commit Discard commits in a private branch or throw away uncommited changes
git reset File Unstage a file
git checkot Commit switch between branches or inspect old snapshot
git checkout File Discard changes in the working directory
git revert commit Undo commits in a public branch
git revert File 不支持
git push -u origin master persistence on next push, "origin master" can be ommitted.