Skip to content

Instantly share code, notes, and snippets.

View albertofwb's full-sized avatar

Albert Wang albertofwb

View GitHub Profile
@albertofwb
albertofwb / VerifyRepeatedMd5.py
Last active June 14, 2017 13:37
为什么应该放弃或减少使用MD5
# MD5 在现实中已经被发现有相当多的数据都可能导致冲突。举例而言,如下两段数据的MD5哈希值就是完全一样的
# ref: blog.jianguoyun.com/?p=481
# date: 2012-09-20
import os
from hashlib import md5
def save_strs2bin(text, file_name):
if not isinstance(text, str):
@albertofwb
albertofwb / restart.bat
Created August 9, 2017 07:30
put this script in "C:\windows\system32" then you can simply type "restart AppName" to restart windows softwares
@echo off
set App=%1
set SleepSeconds=2
set PingIP=127.0.0.1
if "%App%" == "" (
goto usage
)
@albertofwb
albertofwb / pkill.bat
Created August 11, 2017 00:39
模仿linux下的pkill 命令实现。 将该脚本放入 PATH 中。关闭任何程序只需要 pkill ProcessName. 比如关闭 Chrome.exe 只需要 pkill chrome
@echo off
set App=%1
if "%App%" == "" (
goto usage
)
if "%App:~-3%" neq "exe" (
set App=%App%.exe

Git 常用命令总结

在使用git进行团队开发工作中,有些常用命令频繁使用,也有关于git的一些使用技巧。
在这里做一个记录分享给大家。如果有人能从这个文档里得到帮助,我会感到很开心o(* ̄▽ ̄*)ブ。
下面的总结都是本人在实际使用过程中的心得,如果有什么纰漏,请协助我完善这个文档

版本控制

给指定提交打上标签
@albertofwb
albertofwb / shadowsocks-server.service
Created January 7, 2018 05:39 — forked from guyskk/shadowsocks-server.service
shadowsocks server systemd service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/ss-config.json
Restart=on-abort
[Install]
WantedBy=multi-user.target
@albertofwb
albertofwb / make_commits.py
Last active April 18, 2018 05:49
使用脚本模拟多次提交记录,主要是为了练习 git 二分法定位bug (git bisect) ,参见博客:http://www.oschina.net/translate/letting-git-bisect-help-you
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time : 2017/4/30 12:00
# Author : Albert
# Email : albertofwb@gmail.com
# Site : http://cnblogs.com/albertofwb
# File : make_commits.py
# Editor : PyCharm
@albertofwb
albertofwb / bing_wallpapper.py
Last active April 26, 2018 06:09
every time you execute this script will set your wallpaper to a random picture from bingwallpaper.com
#! /usr/bin/env python3d
import requests
from bs4 import BeautifulSoup
import os
import sys
import datetime
import random
import hashlib
@albertofwb
albertofwb / Program.cs
Last active July 6, 2018 02:11
test call File.Replace() multiple times check if that will cause file locke by kernel
using System;
using System.IO;
using System.Text;
namespace TestDemo
{
public class Atomic
{
private readonly object _lock = new object();
@albertofwb
albertofwb / crack.py
Created October 1, 2018 04:13
python hack attack visual affects
#! /usr/bin/env python
# encoding: utf-8
# Edit time: 2018-06-05 20:32
# This scripts print some hack attack affect
# Just makes ordinary people think about we are hacking an account
import sys
from time import sleep
import random
import string
@albertofwb
albertofwb / SimpleHTTPServerWithUpload.py
Created October 18, 2018 06:33 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""