This is an example to paginate with bottlepy. To run this,
- install
bottle
andbottle_sqlite
- run
python db_init.py
- run
python bottle_pagination.py
"""UDP proxy server.""" | |
import asyncio | |
class ProxyDatagramProtocol(asyncio.DatagramProtocol): | |
def __init__(self, remote_address): | |
self.remote_address = remote_address | |
self.remotes = {} |
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" ;; |
@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) |
#!/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 | |
} |
#!/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 |
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) | |
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) |
{ | |
"arguments": { | |
"fields": [ "id", "name", "percentDone", "totalSize", "rateDownload", "rateUpload" ] | |
}, | |
"method": "torrent-get" | |
} |