Skip to content

Instantly share code, notes, and snippets.

View lujiacn's full-sized avatar

JL lujiacn

  • earth
  • earth
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 / 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
package controllers
import (
"encoding/base64"
"errors"
"github.com/robfig/revel"
"net/http"
"strings"
)
@lujiacn
lujiacn / Go Revel nginx.conf
Created October 22, 2015 09:23 — forked from tim-peterson/Go Revel nginx.conf
Revel Framework nginx.conf to make Revel app work outside of localhost, i.e., on my live, personal-website.com
http{
index index.html;
server {
listen 80;
root /gocode/src/personalwebsiteapp;
server_name personal-website.com;
@lujiacn
lujiacn / install-tmux
Created October 18, 2015 05:29 — forked from rothgar/install-tmux
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local