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 / 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`
@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 / 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
}
@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 / 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.
@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