Skip to content

Instantly share code, notes, and snippets.

View Maecenas's full-sized avatar
👋
Hi

Xiang Li Maecenas

👋
Hi
View GitHub Profile
@Maecenas
Maecenas / Dockerfile
Last active November 26, 2023 01:07
My Connection Guide for CMU 14-741/18-631: Introduction to Information Security
FROM i386/ubuntu:18.04
WORKDIR /app
RUN apt-get update \
&& apt-get install -y \
build-essential \
binutils \
gdb \
gcc-multilib \

Keybase proof

I hereby claim:

  • I am Maecenas on github.
  • I am maecenasli (https://keybase.io/maecenasli) on keybase.
  • I have a public key whose fingerprint is 92B8 239D 3D8A 047E EFB9 96C8 4610 787D 5B22 FF2A

To claim this, I am signing this object:

@Maecenas
Maecenas / minikube-kubernetes-macos-proxy-setup.md
Last active December 11, 2018 12:17
How to start a single-node Kubernetes cluster with minikube on macOS under proxy

First set the local proxy to listen to address at 0.0.0.0 instead of 127.0.0.1 or localhost.

$ brew install Kubernetes-cli
$ brew cask install minikube
$ HYPERVISOR=`ifconfig en0 | grep 'inet ' | sed 's/^.*inet //g'| sed 's/ *netmask.*$//g'` && \
  PROXY="http://$HYPERVISOR:1087" && \
  minikube start \
    --docker-env HTTP_PROXY="$PROXY" \
 --docker-env HTTPS_PROXY="$PROXY" \
@Maecenas
Maecenas / README.md
Created August 10, 2018 09:28
一键脚本安装shadowsocks/shadowsocksR/V2Ray + 开启bbr
@Maecenas
Maecenas / hipython.conf
Created July 26, 2018 06:14
Jupyter (Lab) server setup guide. Using Anaconda as python distribution and package management tools, Nginx as reverse proxy, and Docker for distribution.
#/etc/nginx/conf.d/hipython.conf
upstream hipython {
server localhost:8888;
}
server {
listen 80;
server_name hipython.your.site;
@Maecenas
Maecenas / app.py
Created June 23, 2018 13:42
TimedRotatingLogger
#!/usr/bin/env python
# coding: utf-8
import logging.config
from logging.handlers import TimedRotatingFileHandler
from flask import Flask, request
app = Flask(__name__)
app.secret_key = "ecret_key"
@Maecenas
Maecenas / README.md
Created May 10, 2018 10:52
Remove .DS_Store from Git commit history
git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch /.DS_Store' --tag-name-filter cat -- --all

find . -name ".DS_Store" -print0 | xargs -0 rm -rf
@Maecenas
Maecenas / README.md
Created May 10, 2018 10:26
Generate SSL Cert
$ openssl s_client -connect gitlab.miotech.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt
$ echo "yes" | keytool -import -alias MTGitlab -keystore /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts -file /root/public.crt -storepass changeit
@Maecenas
Maecenas / data_processing.py
Last active May 3, 2018 02:25
Data Processing Using Python
# 时间索引
>>> import pandas as pd
>>> index = pd.date_range('20160503', periods=5)
>>> index
DatetimeIndex(['2016-05-03', '2016-05-04', '2016-05-05', '2016-05-06',
'2016-05-07'],
dtype='datetime64[ns]', freq='D')
# 数据显示