Skip to content

Instantly share code, notes, and snippets.

Jimmy Xu Jimmy-Xu

Block or report user

Report or block Jimmy-Xu

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
@Jimmy-Xu
Jimmy-Xu / logrus_hooks.go
Created May 22, 2019 — forked from miguelmota/logrus_hooks.go
Golang Logrus show filename and line number
View logrus_hooks.go
package logger
import (
"fmt"
"path"
"runtime"
"github.com/sirupsen/logrus"
)
View Simple vsock setup for QEMU.md

Simple vsock setup for QEMU

Configuration

Host Kernel: rawhide 4.13.0-0.rc6.git4.2.fc28.x86_64 (on Fedora 24)

QEMU is mainline built from sources: QEMU emulator version 2.10.50 (v2.10.0-105-g223cd0e)

Guest: clear-17460-kvm.img (which has vsock support)

@Jimmy-Xu
Jimmy-Xu / ssh_config
Created Apr 16, 2019 — forked from rbenaley/ssh_config
GitHub ssh access via HTTP Proxy
View ssh_config
host github.com
user git
hostname ssh.github.com
port 443
proxycommand socat - PROXY:<hostname>:%h:%p,proxyport=<port>
@Jimmy-Xu
Jimmy-Xu / yamux-exmaple.go
Created Apr 12, 2019 — forked from fatih/yamux-exmaple.go
A simple working yamux example
View yamux-exmaple.go
package main
import (
"fmt"
"log"
"net"
"time"
"github.com/hashicorp/yamux"
)
View gist:d7cdde841f93ccdaa28b992d86ef80c0
package main
import (
"fmt"
"log"
"time"
"golang.org/x/sys/windows/registry"
)
@Jimmy-Xu
Jimmy-Xu / lambda-basic-auth.js
Created Jan 17, 2019 — forked from lmakarov/lambda-basic-auth.js
Basic HTTP Authentication for CloudFront with Lambda@Edge
View lambda-basic-auth.js
'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';
View gist:c226d20ee5d90078cc9cb729fa4adeba
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
View install-ebook-convert.md

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 Nov 13, 2018 — forked from hilezi/.screenrc
Mac OS X Terminal .screenrc
View .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 / get-vendor.sh
Last active Nov 1, 2018
get vendor of repo
View get-vendor.sh
#!/bin/bash
# env
github_api_token=$1
owner=$2
# clean
ls -d */ | xargs -i rm -rf {}
rm -rf repo.txt
You can’t perform that action at this time.