Skip to content

Instantly share code, notes, and snippets.

ChenYuan zjuchenyuan

View GitHub Profile
View syncgithub.py
"""
say you have a private repo, which is not suitable for push to github
but you want github to show your activity for this repo
so, this script will help you sync commit message to `githubrepo`, using empty commits
used commands:
git log --all '--pretty=format:%ad|%s'
git commit -m "message" --date "Sun Jun 17 12:48:07 2018 +0800" --allow-empty
"""
@ImSingee
ImSingee / jack.py
Created Apr 15, 2018
「加减大师」游戏攻略
View jack.py
import re
import json
from mitmproxy import ctx
from urllib.parse import quote
from pprint import pformat
def response(flow):
path = flow.request.path
if path == '/index/index_one_nine_two/make_question':
ctx.log.info('Start')
@magisterquis
magisterquis / demoshell.go
Last active Jul 13, 2020
Beaconing shell, useful for demos. Catch it with netcat.
View demoshell.go
// demoshell is a nifty beaconing shell useful for demos
package main
/*
* demoshell.go
* Simple reverse shell used in demos
* By J. Stuart McMurray
* Created 20180331
* Last Modified 20180331
*/
@francisfeng
francisfeng / things-you-should-ask-hr.md
Last active Jan 20, 2020
Things You Should Ask HR
View things-you-should-ask-hr.md

Things You Should Ask HR

说明

为了尽量避免入职后才发现公司有不合意的地方,我根据经验,写下此 gist,包含「必问问题」、「工作相关」、「生活相关」三个列表。

「必问问题」是为保障求职者的自身权益而制定,你应该知道这个列表的所有答案。

「工作相关」是为了帮助求职者了解未来的工作内容而定,这里的问题你可挑选感兴趣的来问。

「生活相关」和「工作相关」类似,主要是为了方便入职后的生活,这里的问题可挑选提问。

@fzls
fzls / batch_exchange.py
Last active May 8, 2019
cc98上发帖批量散魔力值的辅助脚本
View batch_exchange.py
import re
import requests
from bs4 import BeautifulSoup
# 赠送的网址(post)
exchange_url = "http://www.nexushd.org/mybonus.php?action=exchange"
# 98的帖子网址
cc98_url = "http://www.cc98.org/dispbbs.asp"
View 无声启动器.c
// 程序启动器[win32]
// 一个小玩意,作用就是读取与 exe 同名的 .config 文件,并逐条并行执行,不显示窗口
// 以 # 打头的行忽略
// 用于开机挂载一些自带 cmd 窗口的程序
// 自用 vs2017 编译测试通过
// ver 1.1
// 一个新语法:@命令 可以等待此命令结束后再继续运行
// 例如 @ping 127.1 -n 3 等待3秒
@mgeeky
mgeeky / vm-auto-snapshot.sh
Last active Jul 11, 2020
Script to manage auto-snapshots for specified VirtualBox VM. Able to rotate snapshots, create, restore and delete ones.
View vm-auto-snapshot.sh
#!/bin/bash
# vim: ts=4 sw=4 et
#
# Auto-snapshotting script intended to be cron'ed,
# taking automatic snapshots of particular VM, logging that actions,
# and providing means of restoring specific snapshots.
# Included with functionality of rotating them (like logrotate).
#
# Example cron entry for this script:
@chichunchen
chichunchen / wget 中文亂碼
Created Jan 26, 2015
用 wget 从服务器下载文件经常遇到中文文件名变成乱码的问题。
View wget 中文亂碼
reference: http://m13253.blogspot.tw/2013/04/solve-corrupted-chinese-filename-for-wget.html
其实不必要像那样修改源代码,wget 的 man 页面里就有解决方法。
正解是参数 --restrict-file-names=nocontrol
Update: +筱百合 提供了他的 ~/.wgetrc 文件,方便大家借鉴:
# 不要乱转义中文
--restrict-file-names=nocontrol
# 使用重定向后的文件名
--trust-server-names=on
@quark-zju
quark-zju / gdb-trace.py
Last active Apr 13, 2020
Trace all function calls using gdb
View gdb-trace.py
#!/usr/bin/env python
try:
import gdb
inside_gdb = True
except ImportError:
inside_gdb = False
if inside_gdb:
@gubatron
gubatron / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Last active Jul 14, 2020
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent
View multiple-deploy-keys-multiple-private-repos-github-ssh-config.md

How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.

You can’t perform that action at this time.