Skip to content

Instantly share code, notes, and snippets.

MK kohenkatz

  • Silver Spring, MD
View GitHub Profile
@kohenkatz
kohenkatz / phpcs.xml
Created Aug 8, 2018
PHPCS config for a Laravel project that uses tabs
View phpcs.xml
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<description>PHP_CodeSniffer Standards</description>
<file>.</file>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
@kohenkatz
kohenkatz / check_dns_dig.go
Created Jun 14, 2018
A nagios `check_dns` alternative that uses dig instead of nslookup
View check_dns_dig.go
package main
import (
"bytes"
"fmt"
"os"
"os/exec"
"sort"
"strconv"
"strings"
@kohenkatz
kohenkatz / _README.md
Last active May 18, 2018
"PostBin" is a simple server that logs all requests to files in TEMP. Partially based on https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
View _README.md

How to run

php -S 0.0.0.0:3001 postbin.php
@kohenkatz
kohenkatz / _README.md
Created Apr 27, 2018
Git Flow introduction
View _README.md

How to set up git-flow

Installation - if using git on the command line

Linux

wget https://raw.githubusercontent.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh
sudo bash gitflow-installer.sh install stable
rm gitflow-installer.sh
@kohenkatz
kohenkatz / dslreports.scpt
Last active Nov 9, 2017
Mojo Wifi Testing
View dslreports.scpt
tell application "Safari"
-- if it is running then
-- quit
-- delay 5
-- end if
activate
open location "http://www.dslreports.com/speedtest"
delay 1
activate
@kohenkatz
kohenkatz / helpers.js
Created Oct 22, 2017
Cookie Clicker "Helpers"
View helpers.js
function makeCookie() {
Game.shimmerTypes.golden.time = Game.shimmerTypes.golden.maxTime;
}
function clickVisibleCookies() {
Game.shimmers.forEach(function(item) {
if (item.type === 'golden') {
item.l.click();
}
});
View RouteServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
View comcast-test.py
#!/usr/bin/python
import os
import sys
import csv
import datetime
import time
import twitter
def test():
@kohenkatz
kohenkatz / systemd-spawn-fcgi.sh
Last active Aug 28, 2017 — forked from stbuehler/systemd-spawn-fcgi.sh
How to run a FastCGI process as a service under Systemd, based on http://redmine.lighttpd.net/projects/spawn-fcgi/wiki/Systemd/2
View systemd-spawn-fcgi.sh
#!/bin/bash
set -e
if [ "${LISTEN_PID}" != $$ ]; then
echo >&2 "file descriptors not for us, pid not matching: '${LISTEN_PID}' != '$$'"
exit 255
fi
if [ "${LISTEN_FDS}" != "1" ]; then
@kohenkatz
kohenkatz / run.log
Created Sep 12, 2014
Successfully building and running Redis on my in-memory filesystem using bazil.org/fuse
View run.log
mmkatz@hyperion:/tmp/mmkatz/fuse-test/redis/src$ ./redis-server
13958:C 11 Sep 21:03:08.268 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
13958:M 11 Sep 21:03:08.270 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
13958:M 11 Sep 21:03:08.270 # Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
13958:M 11 Sep 21:03:08.270 # Current maximum open files is 1024. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 2.9.999 (f5efa9bb/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
You can’t perform that action at this time.