Skip to content

Instantly share code, notes, and snippets.

View IanSmith123's full-sized avatar
🎯
Focusing

Les1ie IanSmith123

🎯
Focusing
View GitHub Profile
@IanSmith123
IanSmith123 / cowroot.c
Created October 27, 2016 08:12 — forked from rverton/cowroot.c
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (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
@IanSmith123
IanSmith123 / backup.sh
Last active June 12, 2017 07:37
自动备份mc服务器
#!/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/
@IanSmith123
IanSmith123 / download_bing_wallpaper.py
Created August 17, 2017 10:14
download bing wall paper for recent 7 days
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()
@IanSmith123
IanSmith123 / calc.py
Created August 19, 2017 11:04
计算1-9不重复填入九宫格,横竖斜相加和相等
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):
@IanSmith123
IanSmith123 / index.js
Created April 3, 2018 03:55 — forked from edokeh/index.js
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@IanSmith123
IanSmith123 / ng.cpp
Created May 2, 2018 03:20
裴波那契数列
// 新裴波那契数列
/*
Time Limit: 1000ms
Memory Limit: 64M
Description:
@IanSmith123
IanSmith123 / png2mp4.py
Created July 12, 2018 09:35
from png/jpg to mp4 use ffmpeg,
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"
@IanSmith123
IanSmith123 / 51cto.js
Last active January 12, 2019 05:17
51cto关闭全屏广告
// ==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==
@IanSmith123
IanSmith123 / v2ex_catch_fish.py
Last active January 22, 2019 14:24
v2ex 摸鱼 刷dau脚本
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'
黄污亮的爸爸是宇宇
宇宇的儿子是黄污亮
黄污亮的爸爸是谁
宇宇的儿子是谁
宇宇的儿砸
宇宇的傻儿砸
2019-3-25 10:26:57 编辑于gist