Skip to content

Instantly share code, notes, and snippets.

View lujiacn's full-sized avatar

JL lujiacn

  • earth
  • earth
  • 09:54 (UTC +08:00)
View GitHub Profile
@lujiacn
lujiacn / GzipStream.go
Created September 21, 2022 06:19 — forked from avelino/GzipStream.go
golang gzip stream
func GetGzip(path string) string {
println(path)
client := &http.Client{
Transport: &transport.Transport{
ReadTimeout: 10 * time.Second,
RequestTimeout: 15 * time.Second,
},
}
@lujiacn
lujiacn / jamf.md
Created December 2, 2020 14:00 — forked from a7ul/jamf.md
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@lujiacn
lujiacn / Monaco for Powerline.md
Created October 25, 2017 15:03 — forked from ymjing/Monaco for Powerline.md
Powerline-patched Monaco for Windows and OSX

Powerline-patched Monaco for Windows and OSX

This font is manually patched with Fontforge. It includes the glyphs from DejaVu Sans Mono for Powerline.

I recommend DirectWrite-patched VIM builds. I'm using KaoriYa's build (http://www.kaoriya.net/software/vim/)

Usage

Add the following lines to your .vimrc/_vimrc:

@lujiacn
lujiacn / sendMail.go
Created January 29, 2017 11:58 — forked from andelf/sendMail.go
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"
@lujiacn
lujiacn / current-dir-in-iterm-tab-title.sh
Created October 18, 2016 10:05 — forked from phette23/current-dir-in-iterm-tab-title.sh
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@lujiacn
lujiacn / gist:cc7f0115ec9db8c3ac6c94c6c6e3e5ea
Created October 16, 2016 12:01
show disk partition info
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
:%!python -m json.tool
@lujiacn
lujiacn / ubuntu lid close
Created September 5, 2016 02:42
make lid close do nothing
refer: http://askubuntu.com/questions/15520/how-can-i-tell-ubuntu-to-do-nothing-when-i-close-my-laptop-lid
accepted
For 13.10 - 16.04:
To make Ubuntu do nothing when laptop lid is closed:
Open the /etc/systemd/logind.conf file in a text editor as root, for example,
sudo -H gedit /etc/systemd/logind.conf
Add a line HandleLidSwitch=ignore (make sure it's not commented out!),
@lujiacn
lujiacn / start-rserve.sh
Last active August 9, 2016 02:51 — forked from erochest/start-rserve.sh
A simple shell script to start Rserve.
#without output
R -e 'library(Rserve); Rserve(args="--vanilla")' 2>&1 > /dev/null