Skip to content

Instantly share code, notes, and snippets.

View neerolyte's full-sized avatar

David Schoen neerolyte

View GitHub Profile
before_script:
# set up ssh key - it's defined under secret variables on
# https://***/*/*/settings/ci_cd
- mkdir /root/.ssh
- echo "Host example.net" > /root/.ssh/config
- echo "StrictHostKeyChecking no" >> /root/.ssh/config
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > /root/.ssh/id_rsa
- chmod 0700 /root/.ssh
- chmod 0600 /root/.ssh/*
@neerolyte
neerolyte / foo.md
Last active August 8, 2017 23:09
nginx too big header

Raising the buffers is the default reaction to the nginx error upstream sent too big header while reading response header from upstream with php-fpm and fcgi, but it doesn't solve the problem, just makes it harder to hit.

Put this in a .php file somewhere:

<?php
for ($i = 0; $i<$_GET['iterations']; $i++)
        error_log(str_pad("a", $_GET['size'], "a"));
echo "got here\n";
@neerolyte
neerolyte / Docker-dev.md
Last active March 20, 2020 17:29
Using Docker for development of memcached

This is not a complete, comprehensive guide, but it is meant to be a start in the right direction.

From the memcached working directory (where ever you cloned the repo):

$ docker run -it -v "$PWD:/memcached" --name "memcache-dev" ubuntu:artful bash

This creates a container named "memcache-dev" based on the artful tag of the ubuntu image from hub.docker.com.

@neerolyte
neerolyte / vssh
Last active November 16, 2016 23:24
vssh - significantly faster ssh for vagrant
#!/bin/bash -e
# vssh - significantly faster Vagrant SSHing
# Usage: vssh [vagrant host] [regular ssh arguments]
# find the .vagrant directory scanning up from $PWD
find_vagrant_dir() {
cdir="$PWD"
while ! [[ -d "$cdir/.vagrant" ]] && [[ "$cdir" != "/" ]]; do
cdir="$(dirname "$cdir")"
@neerolyte
neerolyte / google_sub_path_finder.php
Created March 3, 2014 04:40
quick and dirty php code to try to extract high level subpaths from google indexes
<?php
function docurl($url) {
$opts = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $url,
CURLOPT_HEADER => true,
);
$ch = curl_init();
curl_setopt_array($ch, $opts);
@neerolyte
neerolyte / gist:6899314
Last active December 25, 2015 01:59
Segfaulting php when using pcntl functions and postgres
<?php
$dbh = new PDO("pgsql:dbname=test;user=postgres");
if (pcntl_fork()) {
// give child a moment to shutdown
usleep(200000);
// do anything with the db... segfault!
$dbh->query("select version();");
}
@neerolyte
neerolyte / gist:6395381
Last active December 22, 2015 01:19
Quick and dirty php code to enumerate subdomains using Google dorks
<?php
function docurl($url) {
$opts = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $url,
CURLOPT_HEADER => true,
);
$ch = curl_init();
curl_setopt_array($ch, $opts);
@neerolyte
neerolyte / Guardfile
Last active December 14, 2015 23:39
First stab at getting guard to cleanly watch for inotify events outside of a Vagrant VM, send the event inside and report back on the outside again. See comments for more description.
require 'guard'
require 'guard/guard'
require 'guard/jasmine-node'
module ::Guard
class Guard
def vagrant_run_prefix()
prep_ssh_config
"ssh -F #{ssh_conf_file} default -- cd /vagrant\\;"
end
@neerolyte
neerolyte / gist:1644379
Created January 20, 2012 01:27
half baked print_r in lua
function pp (o)
local typ = type(o)
if typ == "boolean" or typ == "number" then
return o
elseif typ == "string" then
return string.format( "%q", o)
elseif typ == "table" then
local t = { "{"}
for k, v in pairs ( o ) do
local nice = "[" .. pp(k) .. "]" .. " = " .. pp(v) .. ";"