Skip to content

Instantly share code, notes, and snippets.

View zjuchenyuan's full-sized avatar

ChenYuan zjuchenyuan

View GitHub Profile
@gubatron
gubatron / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Last active March 12, 2024 07:34
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

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.

@quark-zju
quark-zju / gdb-trace.py
Last active December 31, 2023 14:14
Trace all function calls using gdb
#!/usr/bin/env python
try:
import gdb
inside_gdb = True
except ImportError:
inside_gdb = False
if inside_gdb:
@chichunchen
chichunchen / wget 中文亂碼
Created January 26, 2015 18:40
用 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
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@mgeeky
mgeeky / vm-auto-snapshot.sh
Last active July 24, 2022 20:15
Script to manage auto-snapshots for specified VirtualBox VM. Able to rotate snapshots, create, restore and delete ones.
#!/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:
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active April 30, 2024 17:02
Hyperlinks in Terminal Emulators
// 程序启动器[win32]
// 一个小玩意,作用就是读取与 exe 同名的 .config 文件,并逐条并行执行,不显示窗口
// 以 # 打头的行忽略
// 用于开机挂载一些自带 cmd 窗口的程序
// 自用 vs2017 编译测试通过
// ver 1.1
// 一个新语法:@命令 可以等待此命令结束后再继续运行
// 例如 @ping 127.1 -n 3 等待3秒
@fzls
fzls / batch_exchange.py
Last active May 8, 2019 14:43
cc98上发帖批量散魔力值的辅助脚本
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"
@magisterquis
magisterquis / demoshell.go
Last active April 1, 2024 12:12
Beaconing shell, useful for demos. Catch it with netcat.
// 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
*/
@ImSingee
ImSingee / jack.py
Created April 15, 2018 10:53
「加减大师」游戏攻略
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')