Skip to content

Instantly share code, notes, and snippets.

View bigretromike's full-sized avatar
🎩
.

BigRetroMike bigretromike

🎩
.
View GitHub Profile
@vxgmichel
vxgmichel / udpproxy.py
Created February 2, 2017 10:05
UDP proxy server using asyncio
"""UDP proxy server."""
import asyncio
class ProxyDatagramProtocol(asyncio.DatagramProtocol):
def __init__(self, remote_address):
self.remote_address = remote_address
self.remotes = {}
@matsub
matsub / README.md
Created December 14, 2016 14:36
An example to paginate with bottlepy.

about this

This is an example to paginate with bottlepy. To run this,

  1. install bottle and bottle_sqlite
  2. run python db_init.py
  3. run python bottle_pagination.py
@thedward
thedward / urlencode.sh
Last active August 26, 2016 12:11 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
local LANG=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
*) printf '%%%02X' "'$c" ;;
@xvitaly
xvitaly / remove_crw.cmd
Last active March 16, 2024 16:12
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@hrwgc
hrwgc / validate.sh
Created November 13, 2013 19:57
bash wget - check if file exists at url before downloading
#!/bin/bash
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
}
@robulouski
robulouski / gmail_imap_dump_eml.py
Last active April 10, 2024 12:58
Very simple Python script to dump all emails in an IMAP folder to files.
#!/usr/bin/env python
#
# Very simple Python script to dump all emails in an IMAP folder to files.
# This code is released into the public domain.
#
# RKI Nov 2013
#
import sys
import imaplib
import getpass
@0xAether
0xAether / 4chan.sh
Last active April 28, 2021 15:00
A bash function to download all the images in a 4chan thread
function 4chan() {
if [[ $# -ne 1 ]]
then
echo 'No URL specified! Give the URL to the thread as the ONLY argument'
return 1
fi
# This should look something like: g/thread/73097964
urlPrimative=$(grep -o '[0-9a-zA-Z]\{1,4\}/thread/[0-9]*' <<< $1)
@marazmiki
marazmiki / ffmpeg_runner.py
Created June 29, 2012 03:57
Runs the ffmpeg process and calculates convertation progress in real time
class FFMPegRunner(object):
"""
Usage:
runner = FFMpegRunner()
def status_handler(old, new):
print "From {0} to {1}".format(old, new)
runner.run('ffmpeg -i ...', status_handler=status_handler)
@jonfuller
jonfuller / status.json
Created January 20, 2011 14:48
Transmission RPC
{
"arguments": {
"fields": [ "id", "name", "percentDone", "totalSize", "rateDownload", "rateUpload" ]
},
"method": "torrent-get"
}