Skip to content

Instantly share code, notes, and snippets.

View IanSmith123's full-sized avatar
🎯
Focusing

Les1ie IanSmith123

🎯
Focusing
View GitHub Profile
@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 / 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 / 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 / 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