Skip to content

Instantly share code, notes, and snippets.

@Fizzadar
Fizzadar / gist:72337c3b548f7eef8d45
Last active Oct 3, 2017
Why Ansible is shit (1.8.2)
View gist:72337c3b548f7eef8d45
playbook -i inventories/development playbook.yml --extra-vars 'ansible_ssh_private_key=files/insecure_private_key' -vvv
PLAY [all] ********************************************************************
TASK: [Ensure /opt/bin directory] *********************************************
...
fatal: [192.168.255.12] => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue
fatal: [192.168.255.10] => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue
fatal: [192.168.255.11] => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue
fatal: [192.168.255.13] => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will e
@Fizzadar
Fizzadar / collect.py
Created Jul 27, 2015
Querying 50k Gameservers in 100 lines of Python
View collect.py
from gevent import monkey
monkey.patch_all()
import logging
from collections import deque
from gevent.pool import Pool
from valve.source.master_server import MasterServerQuerier
from valve.source.a2s import ServerQuerier, NoResponseError
from valve.source.messages import BrokenMessageError
View ghetto_readability_v1.js
window.readable =function(loops) {
function isDescendant(parent, child) {
var node = child.parentNode;
while (node != null) {
if (node == parent) {
return true;
}
node = node.parentNode;
}
return false;
@Fizzadar
Fizzadar / pyclean.sh
Last active Jan 9, 2016
Recursively removes pyc files with no matching py file in the current directory
View pyclean.sh
#!/bin/sh
# PyClean
# Remove .pyc files with no matching py file
FILES=`find . -name "*.pyc"`
for PYC_FILE in $FILES; do
PY_FILE=${PYC_FILE/.pyc/.py}
if [ ! -f "$PY_FILE" ] || [ "$1" = "--all" ]; then
@Fizzadar
Fizzadar / mypage.html
Created Jul 15, 2014
Alternative to flask-webassets w/ autogenerated outfiles via simple jinja2 global
View mypage.html
This is a page.
/* Some JS assets */
{{ assets(
'js/test.js', 'js/device.js',
filters='jsmin', extension='js') }}
/* Some CSS assets */
{{ assets(
'css/blah.css', 'css/print.css',
@Fizzadar
Fizzadar / table_to_file.lua
Last active Jan 20, 2016
Lua table => Lua Code
View table_to_file.lua
local testconf = {
test = 'hi',
test2 = {
hi = 'ho',
what = true,
fuck = function() return 'hello' end
}
}
@Fizzadar
Fizzadar / mod_daemon.php
Last active Oct 3, 2015
PHP Daemon Class
View mod_daemon.php
<?php
/*
file: app/lib/daemon.php
desc: daemon class
*/
class mod_daemon {
private $jobs = array();
private $threads = array();
private $dbfunc;