This file contains hidden or 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
// | |
// gclone.c | |
// clone only git client using libgit2 | |
// ignores all cert errors - unsafe! | |
// usage: glone <url> <path> | |
// links: | |
// sample clone: https://libgit2.github.com/docs/guides/101-samples/#repositories_clone_simple | |
// based on examples/network/clone.c: https://github.com/libgit2/libgit2/blob/master/examples/network/clone.c | |
// license: public domain | |
// |
This file contains hidden or 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 json | |
import os | |
import platform | |
import sys | |
i = {} | |
for m in [os,platform,sys]: |
This file contains hidden or 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
#!/opt/python/current/bin/python | |
# working meta_yaml.py: | |
# mde="$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')/markdown/extensions" | |
# test -e ${mde} && mkdir -p ${mde} | |
# wget -P ${mde} https://raw.githubusercontent.com/teoric/python-markdown-yaml-meta-data/master/meta_yaml.py | |
# sed -i 's/>meta/<normalize_whitespace/g' ${mde}/meta_yaml.py | |
# | |
# apache conf: | |
# Action rendermd /cgi-bin/rendermd.cgi |
This file contains hidden or 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
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino | |
//needed for library | |
#include <DNSServer.h> | |
#include <ESP8266WebServer.h> | |
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); |
This file contains hidden or 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
#include <stdio.h> | |
#include <linux/version.h> | |
#include <sys/utsname.h> | |
/* | |
* from rhel7's linux/version.h: | |
* #define LINUX_VERSION_CODE 199168 | |
* #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | |
*/ |
This file contains hidden or 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 fileinput | |
import json | |
from dicttoxml import dicttoxml | |
jsonin = "" | |
jsondict = "" | |
jsonxml = "" |
This file contains hidden or 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
#1 0 * * * wget -q -O - 'http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=0' | sed '/<pre>/,/<\/pre>/!d' | grep -v 'pre>' > /etc/hosts.adservers | |
1 0 * * * wget -q -O - 'http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext' > /etc/hosts.adservers |
This file contains hidden or 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 | |
mkdir -p out | |
for i in $(cat advertisers_to_block.txt) ; do | |
{ | |
echo '{ "'${i}'" : [' | |
twurl -d "screen_name=${i}" /1.1/blocks/create.json | jq -M . | |
echo ' ] }' | |
} | tee out/${i}.json >/dev/null 2>&1 |
This file contains hidden or 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
function myexpt(x, y) { | |
var expt = 1; | |
if (x < 0) { | |
// XXX - need to check Number.isFinite(parseFloat(y)) and cast for modulus via parseInt | |
if (y % 2 != 0) { | |
expt = -1 * myexpt(Math.abs(x), y); | |
} else { | |
expt = myexpt(Math.abs(x), y); | |
} | |
} else { |
This file contains hidden or 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
/* | |
* via http://stackoverflow.com/questions/15720822/how-to-get-names-of-classes-inside-a-jar-file | |
*/ | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.util.Iterator; | |
import java.util.List; |