Skip to content

Instantly share code, notes, and snippets.

View lemon-li's full-sized avatar

Le Li lemon-li

  • KingSoft
  • Beijing
  • 22:47 (UTC +08:00)
View GitHub Profile
@lemon-li
lemon-li / gist:b0b0ab0243c7d922e22b96b6c4c4547a
Created December 2, 2020 12:02 — forked from nateware/gist:3915757
Start Mac VNC server from command line
# Step 1: Set priveleges
$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all
Starting...
Setting allow all users to YES.
Setting all users privileges to 1073742079.
Done.
# Step 2: Allow VNC clients
@lemon-li
lemon-li / README.md
Created November 16, 2020 01:39 — forked from zhiguangwang/README.md
Use Nomad "spread" Scheduler

Read Scheduler Config

curl -s --header "X-Nomad-Token: $NOMAD_TOKEN" "$NOMAD_ADDR/v1/operator/scheduler/configuration" | jq

Sample Output

{
@lemon-li
lemon-li / openssl.md
Created November 14, 2020 08:09 — forked from zhiguangwang/openssl.md
Common OpenSSL Commands with Keys and Certificates

Common OpenSSL Commands with Keys and Certificates

Generate RSA private key (2048 bit)

openssl genrsa -out private.pem 2048

Generate a Certificate Signing Request (CSR)

openssl req -sha256 -new -key private.pem -out csr.pem
@lemon-li
lemon-li / terminal-git-branch-name.md
Created June 21, 2020 10:53 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
@lemon-li
lemon-li / README.md
Created April 27, 2020 05:57 — forked from zhiguangwang/README.md
Installing and running shadowsocks on Ubuntu Server

Installing and running shadowsocks on Ubuntu Server

16.10 yakkety and above

  1. Install the the shadowsocks-libev package from apt repository.

     sudo apt update
     sudo apt install shadowsocks-libev
    
  2. Save ss.json as /etc/shadowsocks-libev/config.json.

#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="lemon-li"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
#bin/sh
ssh-tunnel() { nohup ssh -o ServerAliveInterval=15 -f -N -L ${1}:${2} ${3} > /dev/null 2>&1; }