Skip to content

Instantly share code, notes, and snippets.

View vtta's full-sized avatar
🎯
Focusing

vtta vtta

🎯
Focusing
  • The Chinese University of Hong Kong
  • Hong Kong
View GitHub Profile
@buptczq
buptczq / detect.py
Last active January 30, 2022 06:39
QQ URL detect
import hashlib
import struct
import sqlite3
def md5hash(buf):
return hashlib.md5(buf.encode("utf-16")[2:]).digest()
def md5cmp(buf, postfix, a1, a2, a3, a4):
if len(buf) < postfix:
return False
@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active April 12, 2024 13:24
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

@resilar
resilar / execve.c
Created March 8, 2017 17:07
Linux x86(-64) - execve("/bin/sh", ["/bin/sh", 0], 0) shellcode (38 bytes)
/*
* Linux x86(-64) - execve("/bin/sh", ["/bin/sh", 0], 0) shellcode (38 bytes)
* 31c050488b1424eb105478065e5fb03b0f05595b40b00bcd80e8ebffffff2f62696e2f736800
*
* - offset - bytes 32-bit code 64-bit code
* 0x00000000 31c0 xor eax, eax xor eax, eax
* 0x00000002 50 push eax push rax
* 0x00000003 48 dec eax rex.w
* 0x00000004 8b1424 mov edx, dword [esp] mov rdx, qword [rsp]
* 0x00000007 eb10 jmp 0x19 jmp 0x19
@mauriciopoppe
mauriciopoppe / _README.md
Last active March 30, 2024 09:52
Generic Makefile example for a C++ project
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active May 14, 2024 02:51 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@papaeye
papaeye / mactex-uninstaller.sh
Created May 16, 2015 06:51
Generate MacTeX uninstall script
#!/bin/bash
# https://tug.org/mactex/uninstalling.html
echo "# Uninstall TeX"
echo "rm -rf /usr/local/texlive"
echo "# Uninstall GUI Applications"
echo "rm -rf /Applications/TeX"
@Earnestly
Earnestly / llpp.conf.xml
Last active February 22, 2022 10:20
Basic vi-like emulation using llpp's new keymapping. Also some other defaults and examples for custom fonts.
<llppconfig>
<ui-font size='18'>
<![CDATA[/home/earnest/.local/share/fonts/Fontin-Regular.otf]]>
</ui-font>
<defaults zoom='100'
auto-scroll-step='12'
horizontal-scroll-step='24'
case-insensitive-search='true'
uri-launcher='$BROWSER &quot;%s&quot;'
@chales
chales / ssh-config
Last active September 29, 2022 00:53
SSH Config - Sample file to show staff the common options to add to your '~/.ssh/config' file. This is just a text file and should have the same perms as the other files in ~/.ssh, usually 600 (read and write by user only).
#### Example SSH config file
# Host = a list of domains, IPs and personalized aliases that use this config
# entry. These alias names follow "Host" and are space delimited.
# e.g. Host 192.168.1.1 example.com example1 myalias1
# Hostname = the IP or real hostname
# e.g. Hostname 192.168.1.1
# User = the username
# e.g. User jdoe
# Port = if this is a non standard port, i.e. not 22
@skyscribe
skyscribe / .gdbinit
Created October 30, 2012 03:04
GDB init file to print STL containers and data members
#
# STL GDB evaluators/views/utilities - 1.03
#
# The new GDB commands:
# are entirely non instrumental
# do not depend on any "inline"(s) - e.g. size(), [], etc
# are extremely tolerant to debugger settings
#
# This file should be "included" in .gdbinit as following:
# source stl-views.gdb or just paste it into your .gdbinit file
@codebrainz
codebrainz / c99.l
Created June 14, 2012 23:49
C99 Lex/Flex & YACC/Bison Grammars
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E ([Ee][+-]?{D}+)
P ([Pp][+-]?{D}+)
FS (f|F|l|L)
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U))
%{
#include <stdio.h>