This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'geoip' | |
geo = GeoIP.new('GeoLiteCity.dat') | |
get '/' do | |
begin | |
x = geo.country request.ip | |
puts x.inspect | |
unless x[:postal_code].empty? | |
"ZIP for #{request.ip}: #{x[:postal_code]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'pp' | |
require 'open-uri' | |
require 'sqlite3' | |
# set our filename and path names up | |
DBNAME = 'favdb.sqlite' # filename for SQLite DB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Kickass Add Button | |
// @namespace http://your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @author You | |
// @match https://kickass.tld/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPO_BASE_URL='ssh://git@repo.example.com:1234/some-project-space' | |
REPOS='foo bar baz quux' | |
echo -e "\e[1;95;102mStarted at $(date) \e[0m" | |
BASEDIR="${PWD}" | |
for repo in $REPOS; do | |
dirname="${repo}.git" | |
echo -e "Now processing \e[1;95m${dirname}\e[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import binascii, sys, json | |
import version, tnetstring, flow | |
from datetime import datetime | |
def create_har(flows): | |
return { | |
"log":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import valve.rcon | |
import requests | |
import json | |
import re | |
import http.client as http_client | |
# TODO update /home/tf2server/.local/lib/python3.6/site-packages/valve/rcon.py to set encoding=utf-8 so this will work | |
# CONFIG | |
min_players = 3 # min players to trigger a status post |
OlderNewer