Skip to content

Instantly share code, notes, and snippets.

View zhonger's full-sized avatar
💭
I may be slow to respond.

Shengzhou Li zhonger

💭
I may be slow to respond.
View GitHub Profile
@zhonger
zhonger / dabblet.css
Created August 29, 2017 16:55
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, white);
min-height: 100%;
@zhonger
zhonger / git-mirror
Last active September 8, 2017 07:58
#!/bin/bash
#author:zhonger
#date:2017-09-08
#contact:zhonger@live.cn
echo "----------------------------------------------------------------------- "
echo "| Git-mirror | "
echo "| | "
echo "| Functions: This is a shell which mirror git from github to gitlab. | "
echo "| | "
@zhonger
zhonger / virt-install-centos
Created January 3, 2018 04:35 — forked from giovtorres/virt-install-centos
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
#!/bin/bash
Version=$(lsb_release -c --short)
Codename=$(lsb_release -r --short)
OSArch=$(uname -m)
Source="deb https://mirrors.shu.edu.cn/ubuntu/ ${Version} main restricted universe multiverse\n"
Source=${Source}"deb-src https://mirrors.shu.edu.cn/ubuntu/ ${Version} main restricted universe multiverse\n"
Source=${Source}"deb https://mirrors.shu.edu.cn/ubuntu/ ${Version}-security main restricted universe multiverse\n"
Source=${Source}"deb-src https://mirrors.shu.edu.cn/ubuntu/ ${Version}-security main restricted universe multiverse\n"
@zhonger
zhonger / ss.sh
Created January 23, 2018 10:59
shadowsocks-install copied from iMeiji
#! /bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#===============================================================================================
# System Required: CentOS 6,7, Debian, Ubuntu
# Description: One click Install Shadowsocks-Python server
# Author: Teddysun <i@teddysun.com>
# Thanks: @clowwindy <https://twitter.com/clowwindy>
# Intro: http://teddysun.com/342.html
#===============================================================================================
@zhonger
zhonger / common.sh
Last active September 7, 2022 15:24
Just for myself
#!/bin/bash
Version=$(lsb_release -c --short)
Codename=$(lsb_release -r --short)
OSArch=$(uname -m)
User=$(whoami)
# 设置 sudo 免密码
echo "$(whoami) ALL=(ALL) NOPASSWD : ALL" | sudo tee /etc/sudoers.d/nopasswd4sudo
@zhonger
zhonger / install_monaco_font.sh
Created August 30, 2018 00:57 — forked from rogerleite/install_monaco_font.sh
Install Monaco font in Linux
#!/bin/bash
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/
cd /usr/share/fonts/truetype/
#TODO: put validation if folder already exists
sudo mkdir ttf-monaco
@zhonger
zhonger / mac.sh
Last active November 19, 2018 08:50
Common Softwares Install for Mac
# Mirror
cd "$(brew --repo)"
git remote set-url origin https://mirrors.shu.edu.cn/mgit/brew
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.shu.edu.cn/mgit/homebrew-core
brew cask
cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.shu.edu.cn/mgit/homebrew-cask
@zhonger
zhonger / mysql.yml
Last active January 6, 2019 06:37
mysql.yml
version: '3'
services:
db:
image: mysql:5
container_name: db
restart: always
environment:
MYSQL_ROOT_PASSWORD: 'root'
ports:
- 3306:3306
@zhonger
zhonger / ssr.sh
Last active February 8, 2019 07:04
One-step install && manage ShadowsocksR Server
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================
# System Required: CentOS 6+/Debian 6+/Ubuntu 14.04+
# Description: Install the ShadowsocksR server
# Version: 2.0.38
# Author: Toyo
# Blog: https://doub.io/ss-jc42/