Skip to content

Instantly share code, notes, and snippets.

View simonkuang's full-sized avatar

Simon Kuang simonkuang

  • Chengtu, P.R.China
View GitHub Profile
@simonkuang
simonkuang / README.md
Last active November 5, 2023 14:57
Basic Auth
  • cut: 取出user.txt的第二个字段(密码明文),将结果输出到stdout;
  • openssl: 将stdin中输入的数据(3条密码明文)使用SHA512形式进行hash,输出到stdout;
  • paste: 将user.txt中的原始内容与hash过的密码组合起来,输出到stdout;
  • tr: 去除可能出现的\r符号;
  • awk: 从stdin中提取出用户名、hash过的密码、注释字段,将结果输出到passwd.txt。

OpenSSL 的帮助命令可以看出当前的 openssl 命令支持哪些加密方式。

@simonkuang
simonkuang / .Cloud.md
Created October 23, 2023 16:28 — forked from imba-tjd/.Cloud.md
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@simonkuang
simonkuang / cdn-mirror.conf
Created October 11, 2023 16:20
代理 discord cdn 的 openresty 配置
server {
listen 8080;
resolver 8.8.8.8;
location ~* ^/cdn/discordapp/(.*)$ {
proxy_set_header Host 'cdn.discordapp.com';
proxy_set_header Accept-Encoding $http_accept_encoding;
proxy_pass https://cdn.discordapp.com/$1;
}
@simonkuang
simonkuang / install.sh
Last active September 1, 2023 14:03
install stable-diffusion-webui in Ubuntu
#!/bin/bash
mkdir -p /data/workspace
cd /data/workspace
env PYTHONDONTWRITEBYTECODE=1
apt-get -y install -qq aria2
apt-get -y install -qq libcairo2-dev
apt-get -y install -qq python3-dev
@simonkuang
simonkuang / gist:a07cefd12c43a921db03eb9ce3bc2f66
Created September 30, 2018 15:59
update-android-sdk-which-need
#!/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 / pyenv.sh
Created August 9, 2019 13:19
Install pyenv in CentOS
#!/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 / reveal.html
Created November 25, 2021 02:39
reveal.js online startup template
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>reveal.js</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/hakimel/reveal.js@master/dist/reset.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/hakimel/reveal.js@master/dist/reveal.css">
@simonkuang
simonkuang / docker-compose.yml
Created July 27, 2021 08:54
quickly deploy a mongo cluster with replicaset
version: '2'
services:
## Router
router01:
image: mongo:4.2
container_name: rydell-router-01
command: mongos --port 27017 --configdb rs-config-server/configsvr01:27017,configsvr02:27017,configsvr03:27017 --bind_ip_all
ports:
- 27117:27017
@simonkuang
simonkuang / init-composer-in-docker.sh
Last active April 28, 2021 06:59
Init composer environment in container.
yum install -y dnf dnf-core-plugins
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm
find /etc/yum.repos.d/ -name "remi*.repo" | xargs sed -i "s/#baseurl/baseurl/g"
find /etc/yum.repos.d/ -name "remi*.repo" | xargs sed -i "s/mirrorlist/#mirrorlist/g"
find /etc/yum.repos.d/ -name "remi*.repo" | xargs sed -i "s@http://rpms.remirepo.net@https://mirrors.tuna.tsinghua.edu.cn/remi@g"
dnf install -y php74-php php74-php-pear php74-php-cli php74-php-pecl-zip unzip \
php74-php-gd php74-php-dba php74-php-dbg php74-php-fpm php74-php-gmp php74-php-pdo \
php74-php-xml php74-php-imap php74-php-json php74-php-devel php74-php-bcmath \
php74-php-pgsql php74-php-sodium php74-php-xhprof php74-php-mysqlnd php74-php-process \
@simonkuang
simonkuang / remarkjs_with_MathJax.html
Created March 29, 2021 06:12 — forked from pinbo/remarkjs_with_MathJax.html
Remark.js+MathJax essentials
<!DOCTYPE html>
<html>
<head>
<title>My Presentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
.red { color: red }
</style>
</head>
<body>