Skip to content

Instantly share code, notes, and snippets.

View adolli's full-sized avatar
:octocat:
vacation

adolli adolli

:octocat:
vacation
  • Canton, China
View GitHub Profile
@adolli
adolli / .vimrc
Created November 15, 2019 08:11
.vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" call vundle#begin('~/some/path/here')
"
" let Vundle manage Vundle, required
@adolli
adolli / use_type.py
Created October 12, 2019 07:03
Generic types in python
class New(object):
def __init__(self):
super(New, self).__init__()
self._type = None
def __lt__(self, t):
self._type = t
return New2(t)
__lshift__ = __lt__
@adolli
adolli / heapsort.py
Last active October 11, 2019 11:25
algorithms
# coding=utf-8
import sys
import math
def left(i):
return 2 * (i + 1) - 1
def right(i):
@adolli
adolli / main.md
Last active September 30, 2019 09:37
permutation/combination

permutation与combination

没事随手瞎写的,性能明显不是最好的,而且也没有完全使用生成器

# coding=utf-8

import itertools 
@adolli
adolli / 如何使用python3逃逸沙箱,获得进程上下文权限提升.md
Last active November 15, 2024 13:27
如何使用python3逃逸沙箱,获得进程上下文权限提升

如何使用python3逃逸沙箱,获得进程上下文权限提升

最近突发奇想,想对所掌握的python知识进行总结一下,目前其实还停留在python层面如何使用,还没有深入到虚拟机部分,如果下面有哪些错误,欢迎指出。

背景

OJ(Online judge, 在线编程测评提交代码到后台运行检查)网站一般都允许各种各样的代码提交,其中很有可能包含python3,于是决定尝试通过python3的代码执行,进行沙箱逃逸,以及绕过各种限制。

我随便找了一个OJ网站,这个站点的python3有如下限制

@adolli
adolli / 给k8s集群手动更新tls证书.md
Last active September 6, 2019 01:41
renew certs for k8s components after expiration

给k8s集群手动更新tls证书

如果集群内所有components的证书都还没有过期时,更新证书很容就一个命令

kubeadm alpha certs renew all

然后他会自动在/etc/kubernetes/pki目录下把所有证书都更新一遍。但是如果过期的话,那我就不知道了,不过可以通过手动签发证书来生成

@adolli
adolli / create_secret.bash
Last active August 3, 2018 12:05
Wordpress+mysql example with persistent storage.
kubectl create secret generic mysql --from-literal=password=YOUR_PASSWORD
@adolli
adolli / guestbook-ingress.yaml
Last active August 7, 2018 02:56
guestbook k8s deplotment example. a simple example with classic website and session storage by redis. no persistent volumns.
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: lbc-guestbook
spec:
rules:
- host: lbc-guestbook.default.10.202.15.4.xip.io # change the hostname to yours
http:
paths: