This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* (un)comment correct payload first (x86 or x64)! | |
* | |
* $ gcc cowroot.c -o cowroot -pthread | |
* $ ./cowroot | |
* DirtyCow root privilege escalation | |
* Backing up /usr/bin/passwd.. to /tmp/bak | |
* Size of binary: 57048 | |
* Racing, this may take a while.. | |
* /usr/bin/passwd overwritten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
filename=$1 | |
new=mc-back-2017$filename.tar.gz | |
echo "start zip $new" | |
cd ~ | |
tar -czf $new mc/* | |
echo "finish $new" | |
echo "start scp $new" | |
mv $new ~/mc-back/ | |
scp ~/mc-back/$new root@xx.xx.xx:/root/backup_mc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
sample_api_url = "http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1" | |
# notice: add a num after "idx=", this is the count of day before today | |
api_url = "http://www.bing.com/HPImageArchive.aspx?format=js&n=1&idx=" | |
def get_pic_url(num): | |
r = requests.get(api_url+repr(num)) | |
con = r.json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count = 0 | |
for i in range(1, 10): | |
for j in range(1, 10): | |
a = [i, j, 15-i-j] | |
if len(set(a)) < 3 or 15-i-j<1: | |
count += 1 | |
continue | |
for k in range(1, 10): | |
for l in range(1, 10): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 新裴波那契数列 | |
/* | |
Time Limit: 1000ms | |
Memory Limit: 64M | |
Description: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
folders = os.listdir() | |
# folders = [f for f in listdir(mypath) if not isfile(join(mypath, f))] | |
for folder in folders: | |
if "store" in folder.lower(): | |
print("skip ", folder) | |
continue | |
try: | |
os.system( | |
f"ffmpeg -framerate 2 -i {folder}/{folder}_%d.png -c:v libx264 -r 30 -pix_fmt yuv420p after_{folder}.mp4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import json | |
import argparse | |
from time import sleep | |
from random import randint, shuffle | |
from selenium import webdriver | |
site_url = "https://www.v2ex.com" | |
driver_dumpfile = 'cookie.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port: 7890 | |
socks-port: 7891 | |
redir-port: 7892 | |
allow-lan: false | |
mode: Rule | |
log-level: info | |
external-controller: '127.0.0.1:9090' | |
secret: '' | |
cfw-bypass: | |
- localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 51cto 关闭全屏广告 | |
// @namespace https://gist.github.com/IanSmith123/5012b1c1c6ca3b7d19b2064e2c3a5bf4 | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Les1ie | |
// @match *://blog.51cto.com/* | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== |
OlderNewer