Skip to content

Instantly share code, notes, and snippets.

Xiuyu Li nickleefly

Block or report user

Report or block nickleefly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nickleefly /
Last active Jul 22, 2019
shadowsocks v2ray-plugin nginx with docker-compose
export CF_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
export CF_Email=""
~/ --issue -d '' -d '*' --dns dns_cf -k ec-256
~/ --issue --dns dns_cf -d
nickleefly / Freenode
Created May 21, 2019 — forked from yeyewangwang/Freenode
Freenode Nickserv Commands
View Freenode

Freenode IRC




nickleefly /
Last active Jan 10, 2019
从服务器检索信息时出错 [DF-DFERH-01]

login to openwrt ssh

sed -i '$a conf-dir=/etc/dnsmasq.d' /etc/dnsmasq.conf
mkdir /etc/dnsmasq.d/
cat >>/etc/dnsmasq.d/custom.conf<<EOF

restart dnsmasq

nickleefly /
Last active Dec 19, 2018
nginx google ngx_http_google_filter_module
# create nginx user
sudo adduser --system --home /nonexistent --shell /bin/false --no-create-home --disabled-login --disabled-password --gecos "nginx user" --group nginx
sudo chown nginx:nginx /var/log/nginx/access.log /var/log/nginx/error.log
# check if neccesary files exist
cat /etc/systemd/system/
cat /etc/logrotate.d/nginx
cat /etc/init.d/nginx
ls -l /etc/nginx/
nickleefly / karabiner.json
Last active May 14, 2019
karabiner elements ~/.config/karabiner/karabiner.json
View karabiner.json
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
"profiles": [
"complex_modifications": {
"parameters": {
nickleefly /
Created Dec 20, 2017 — forked from jamesramsay/
Gmail: delete old emails automatically

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
    • LABEL_TO_DELETE: the label that should be have old messages deleted
nickleefly /
Created Dec 10, 2017 — forked from tamzinblake/
How to get npx shell auto fallback working on OSX bash

OSX ships with bash 3 by default, but you need bash 4 to use npx shell auto fallback. Using homebrew:

(instructions borrowed from

brew update && brew install bash
# Add the new shell to the list of allowed shells
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
# Change to the new shell
chsh -s /usr/local/bin/bash
nickleefly / initialize_basic_user.yml
Created Sep 11, 2017
ansible playbook setup user
View initialize_basic_user.yml
- hosts: linode
remote_user: root
NORMAL_USER_NAME: 'yourusername'
- name: Make sure we have a 'wheel' group
name: wheel
state: present
nickleefly / Ansible-Vault
Created Sep 7, 2017 — forked from tristanfisher/Ansible-Vault
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.
View Ansible-Vault

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

View invert.js
function invert(tree) {
if (!(tree instanceof Array) || tree.length === 1) return tree;
var ret = [];
var inverted = tree.reverse();
for(var cur in inverted) {
if(!inverted.hasOwnProperty(cur)) continue;
ret.push(inverted[cur] instanceof Array ? invert(inverted[cur]) : inverted[cur]);
You can’t perform that action at this time.