Skip to content

Instantly share code, notes, and snippets.

View jsoref's full-sized avatar
🤕
concussions are awful things would not recommend

Josh Soref jsoref

🤕
concussions are awful things would not recommend
View GitHub Profile
@jsoref
jsoref / indent-exim4-conf.pl
Created October 13, 2017 19:06
indent exim conf if else endif
#!/usr/bin/perl -n
# argument: /path/to/exim.conf
if (/^\s*\.else/) {
$spaces=" "x($level-1);
print $spaces.$_; next;
}
if (/^\s*\.if/) {
$spaces=" "x$level;
print $spaces.$_;
@jsoref
jsoref / SMTPRedirector
Last active November 1, 2017 19:13 — forked from sivachandran/SimpleTcpRedirector.py
Redirector for localhost driven SMTP based on a simple TCP redirector in python
#!/usr/bin/env python
# SMTP client ip tunneler
#
# ./SMTPRedirector 0.0.0.0 LISTENPORT SMTPHOST SMTPPORT
#
# Based on https://gist.githubusercontent.com/sivachandran/1969859/raw/f834e72c27488c279166a53ce1623b7f2f79e70c/SimpleTcpRedirector.py
import socket
import threading
import select
@jsoref
jsoref / Jenkins auto-shudown-agents job
Last active December 19, 2017 01:24 — forked from fotinakis/Jenkins auto-shudown-slaves job
Auto-managed Jenkins slaves on Google Compute Engine
#!/bin/bash
. ~/jenkins-google-auth/bin/activate
~/bin/agent.py list 2>/dev/null | grep '.' | while read agent; do
#echo
#echo "Checking status of $agent..."
# 1. Check to see if there is such a host in DNS.
# 2. check if we can SSH into the host. If we can, then check the process and maybe shut down.
# This makes sure that we don't consider an SSH failure to be reason to shut down the node.
https://github.com/mozilla/mozregression/blob/4ad1545405c364ccf1c2104314450c10956e650c/mozregression/test_runner.py#L110
This line is bad.
It hints that one can enter "broken", but it doesn't actually accept that.
@jsoref
jsoref / # pyenv-virtualenv - 2018-05-17_14-36-46.txt
Created May 17, 2018 20:00
pyenv-virtualenv on macOS 10.13.4 - Homebrew build logs
Homebrew build logs for pyenv-virtualenv on macOS 10.13.4
Build date: 2018-05-17 14:36:46
@jsoref
jsoref / Debian_Mail_Server_with_Anti-Virus.md
Last active May 25, 2018 00:32 — forked from taotao/Debian_Mail_Server_with_Anti-Virus.md
Debian Exim4 mail server with Clamav support.

Environment

  • Debian: Jessie
  • Mail Server: Exim
  • Anti-Virus: Clamav

Install packages

  1. apt-get install clamav clamav-daemon exim4-daemon-heavy

Configuration of Clamav

  1. adduser clamav Debian-exim
@jsoref
jsoref / stick.js
Last active October 8, 2018 19:46 — forked from kmaher9/stick.js
function Stick() {
this.pos = createVector(width/2, height) // the position of the stick
this.vel = createVector() // the velocity of the stick
this.acc = createVector() // the acceleration rate of the stick
this.dna = new dna() // one strand of DNA to last the lifespan of the stick
this.applyForce = function(force) {
this.acc.add(force) // this allows for movement
}
class Foo {
// this is a complicated definition that I haven't finished parsing
typedef std::function<
int(
const ComboAddress& ip,
const DNSName& qdomain,
int qtype,
bool doTCP,
bool sendRDQuery,
int EDNS0Level,
@jsoref
jsoref / gist:07beed504e05495f11d8d8fd1712a9ff
Created August 27, 2019 04:30 — forked from magopian/gist:6128849
Local git mirror of github used by private Jenkins
So I've installed a dead simple backup, in /home/USER/git_backup/:
git clone --mirror git@github.com:USER/PROJECT.git
update.sh (launched every 5 minutes by cron):
#/bin/sh
cd /home/USER/git_backup/PROJECT.git
LINES=`git remote update 2>&1 | wc -l`
@jsoref
jsoref / gist:861d5584b4b1af9c7248884d5d51ddf2
Last active August 27, 2019 04:31 — forked from magopian/gist:6128849
Local git mirror of github used by private Jenkins
So I've installed a dead simple backup, in /home/USER/git_backup/:
git clone --mirror git@github.com:USER/PROJECT.git
update.sh (launched every 5 minutes by cron):
#/bin/sh
cd /home/USER/git_backup/PROJECT.git
LINES=`git remote update 2>&1 | wc -l`