Skip to content

Instantly share code, notes, and snippets.

View Jimmy-Xu's full-sized avatar

Jimmy Xu Jimmy-Xu

  • Ant Group
  • Beijing, China
View GitHub Profile
@Jimmy-Xu
Jimmy-Xu / lambda-basic-auth.js
Created January 17, 2019 02:17 — forked from lmakarov/lambda-basic-auth.js
Basic HTTP Authentication for CloudFront with Lambda@Edge
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
tar -xzf libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure && make && sudo make install
# brew install 'https://raw.github.com/simonair/homebrew-dupes/e5177ef4fc82ae5246842e5a544124722c9e975b/ab.rb'
# brew test ab
curl -O https://archive.apache.org/dist/httpd/httpd-2.4.2.tar.bz2
tar zxvf httpd-2.4.2.tar.bz2

Install cask that extends the brew command :

brew install phinze/cask/brew-cask

Install calibre using cask :

brew cask install calibre
@Jimmy-Xu
Jimmy-Xu / .screenrc
Created November 13, 2018 14:04 — forked from aqzhyi/.screenrc
Mac OS X Terminal .screenrc
vbell off
autodetach on
startup_message off
shell -$SHELL
allpartial off
defc1 off
defencoding utf8
bind b encoding big5 utf8
bind u encoding utf8 utf8
@Jimmy-Xu
Jimmy-Xu / collapsible-markdown.md
Created October 25, 2018 08:05 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@Jimmy-Xu
Jimmy-Xu / gist:4446baa090209926e54a0f327477848e
Created September 26, 2018 05:56 — forked from gsong/gist:6321633
Bash script to generate SSL csr/key/crt
#!/bin/bash
# Usage:
#
# ssl_setup [--self] <name> <csr_config>
#
# This script is used to generate key and CSR for use HTTPS in Nginx.
#
# --self Generate self-signed certificate in addition to key and CSR.
# name Output files will be named as <name>.key and <name>.csr.
@Jimmy-Xu
Jimmy-Xu / demo.md
Created April 29, 2018 03:03 — forked from pwittrock/demo.md
apiserver-builder demo

apiserver-builder demo

Uses v0.1-alpha.21

boilerplate.go.txt

/*
Copyright 2017 The Kubernetes Authors.
@Jimmy-Xu
Jimmy-Xu / GitHub-Forking.md
Created April 27, 2018 04:42 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@Jimmy-Xu
Jimmy-Xu / install-proxychains-ng.sh
Created April 21, 2018 05:38 — forked from ifduyue/install-proxychains-ng.sh
Install proxychains-ng on Centos
#!/bin/sh
# Usage:
# wget -O- https://gist.githubusercontent.com/ifduyue/dea03b4e139c5758ca114770027cf65c/raw/install-proxychains-ng.sh | sudo bash -s
set -eu
version=4.12
wget https://github.com/rofl0r/proxychains-ng/archive/v$version.tar.gz
tar xf v$version.tar.gz
@Jimmy-Xu
Jimmy-Xu / watchPods.go
Created February 28, 2018 08:08 — forked from ctaggart/watchPods.go
Kubernetes watch pods
// some updates for https://rsmitty.github.io/Kubernetes-Events/
// and http://blog.ctaggart.com/2016/09/accessing-kubernetes-api-on-google.html
import (
"encoding/base64"
"fmt"
"log"
"net/http"
"time"