Skip to content

Instantly share code, notes, and snippets.

Simon Kuang simonkuang

  • Chengtu, P.R.China
Block or report user

Report or block simonkuang

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
@simonkuang
simonkuang / retrieve_rpm.sh
Created Aug 12, 2019
Retrieve rpm packages for offline yum repo using docker.
View retrieve_rpm.sh
#!/bin/bash
_DIR=$(cd "$(dirname "$0")";pwd)
cd $_DIR
## ============== retrieve rpms and prepare repo meta data
yum install -y createrepo
_ID=$(docker run --rm centos:7.2.1511 /bin/bash -c "sleep 10800")
export _ID
@simonkuang
simonkuang / pyenv.sh
Created Aug 9, 2019
Install pyenv in CentOS
View pyenv.sh
#!/bin/bash
yum install -y epel-release
yum install -y gcc gcc-c++ glibc glibc-devel curl git \
libffi-devel sqlite-devel bzip2-devel bzip2 readline-devel
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | /bin/bash
cat <<EOF >> $HOME/.bashrc
# Load pyenv automatically by adding
# the following to ~/.bash_profile:
export PATH="/root/.pyenv/bin:\$PATH"
@simonkuang
simonkuang / find-windows-names.sh
Last active Jul 29, 2019
to resolve the windows names of PCs in local network
View find-windows-names.sh
#!/bin/bash
# Only for MacOS
brew install nmap
for i in $(nmap -p3389 192.168.1.0/24 | grep -B5 "3389/tcp open" | grep "report for" | awk "{print \$5}"); do
echo $i: $(smbutil status $i | awk '!(NR%3){print $2}')
done
View windows CMD命令大全及详细解释和语法
windows CMD命令大全及详细解释和语法
引用:
http://letle.iteye.com/blog/169045
http://www.cppblog.com/kyelin/archive/2007/04/21/22540.aspx
windows批处理程序中的特殊字符
批处理介绍
纯以dos系统而言,可执行程序大约可以细分为五类,依照执行优先级由高到低排列分别是:
DOSKEY宏命令(预先驻留内存)
@simonkuang
simonkuang / package.json
Last active Apr 11, 2019
a whole new webpack env
View package.json
{
"name": "qiuzhi-chrome-extension",
"version": "1.0.0",
"main": "webpack.config.js",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch",
"start": "webpack-dev-server --open",
"build": "webpack"
View gist:3db67b09aad2100b7d95f74c4a754495
var require = function (file, cwd) {
var resolved = require.resolve(file, cwd || '/');
var mod = require.modules[resolved];
if (!mod) throw new Error(
'Failed to resolve module ' + file + ', tried ' + resolved
);
var res = mod._cached ? mod._cached : mod();
return res;
}
@simonkuang
simonkuang / openresty_conf.lua
Last active Oct 10, 2018
sort files by date in nginx autoindex page
View openresty_conf.lua
local c = '\
<html>\
<head><title>Index of /software/</title></head>\
<body bgcolor="white">\
<h1>Index of /software/</h1><hr><pre><a href="../">../</a>\
<a href="GeoIP-1.4.8/">GeoIP-1.4.8/</a> 10-Nov-2017 07:01 -\
<a href="GraphicsMagick-1.3.27/">GraphicsMagick-1.3.27/</a> 21-Dec-2017 03:50 -\
<a href="abseil-cpp/">abseil-cpp/</a> 28-Aug-2018 02:58 -\
<a href="curl-7.54.0/">curl-7.54.0/</a> 13-Nov-2017 03:37 -\
<a href="ffmpeg-4.0.2/">ffmpeg-4.0.2/</a> 30-Aug-2018 05:40 -\
View gist:a07cefd12c43a921db03eb9ce3bc2f66
#!/bin/bash
yum install -y unzip curl java-1.8.0-openjdk
if [[ -d /dev/shm ]]; then
TMP_DIR=/dev/shm
else
TMP_DIR=/tmp
fi
@simonkuang
simonkuang / index.ios.js
Last active Sep 8, 2017 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation Example
View index.ios.js
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
View gist:d15cd2da87ada94214c92ee152abcc77
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache
You can’t perform that action at this time.