Skip to content

Instantly share code, notes, and snippets.

View jwhitcraft's full-sized avatar
🏠
Working from home (always)

Jon Whitcraft jwhitcraft

🏠
Working from home (always)
View GitHub Profile
@sems
sems / setuplinkaggregationunraid.md
Last active February 28, 2024 12:53
Setup guide link aggregation(802.3ad) Unraid with Ubiquiti

Setup guide link aggregation Unraid with Ubiquiti

Introduction

I am writing this guide becuase I coudn't find a proper one online which contained all the information I was searching for. I will try to guide you through the process of enabling link aggregation (802.3ad) with your Ubiquiti hardware and your Unraid server. Note: not all of Ubiquiti's hardware supports link aggregation (LAG). As of the time of writing Ubiquiti states the following.

Applicable to all UniFi Switch models excluding the USW-Flex and USW-Flex-Mini.

Source: Ubiquiti

@zish
zish / terraform_bash_completion.sh
Last active December 7, 2023 09:24
Better Terraform Bash Completion
# Bash Terraform completion
#
# Originally adapted from
# https://gist.github.com/cornfeedhobo/8bc08747ec3add1fc5adb2edb7cd68d3
#
# Author: Jeremy Melanson
#
# Features of this version:
# - Uses built-in bash routines for text processing, instead of external tools
# (awk, sed, grep, ...).
@michaeljoy
michaeljoy / percona-toolkit-my.cnf
Last active November 18, 2019 14:24
pt-heartbeat systemd init script example - percona tookit systemd examples
[mysql]
host=localhost
socket=/var/run/mysqld/mysqld.sock
[client]
host=localhost
socket=/var/run/mysqld/mysqld.sock
@ftclausen
ftclausen / Jenkinsfile
Created April 13, 2017 05:36
Jenkins pipeline - An approach to get all commits since the last successful build.
// -*- mode: groovy -*-
// vim: set filetype=groovy :
node( 'some_node' ) {
stage( "Phase 1" ) {
sshagent( credentials: [ 'some_creds' ] ) {
checkout scm
def lastSuccessfulCommit = getLastSuccessfulCommit()
def currentCommit = commitHashForBuild( currentBuild.rawBuild )
if (lastSuccessfulCommit) {
@vrivellino
vrivellino / ec2_cloud.groovy
Last active January 20, 2022 11:11
Jenkins EC2 Plugin Configuration via Groovy
/*
* Configure the Jenkins EC2 Plugin via Groovy Script
* EC2 Plugin URL: https://wiki.jenkins-ci.org/display/JENKINS/Amazon+EC2+Plugin
*/
import hudson.model.*
import jenkins.model.*
import hudson.plugins.ec2.*
import com.amazonaws.services.ec2.model.InstanceType
@markan
markan / vpncfix.md
Created August 21, 2015 17:52
shimo/vpnc "ERROR: can't send packet: Can't assign requested address"

The problem

I've frequently been bit by failures restarting my vpn on my Mac. The connection may appear to start up in Shimo (the menu icon will change) but it looks like vpnc can't connect.

Looking at the log, we see the connection gets stuck

ERROR: can't send packet: Can't assign requested address

This has plagued me for a while, and my only fix has been to restart the machine. I hate restarting my machine. So I finally made time to dig in and find a better solution

@Godefroy
Godefroy / backup-mysql.sh
Created August 21, 2015 09:19
Instant backup of a MySQL database with LVM snapshot
#! /bin/bash
## Instant backup of a MySQL database with LVM snapshot
## Author: Godefroy de Compreignac (@Godefroy)
## License: Beerware
# Instructions:
# - MySQL Data on DB server must be an logical LVM partition
# - Backup server must have ssh root access to DB server
# - Master status is saved at the exact moment of snapshot to allow restoration of master-slave replication
@leolara
leolara / debounce.go
Last active July 25, 2022 09:25
Golang port of underscore.js
func debounceChannel(interval time.Duration, output chan int) chan int {
input := make(chan int)
go func() {
var buffer int
var ok bool
// We do not start waiting for interval until called at least once
buffer, ok = <-input
// If channel closed exit, we could also close output
@chicks
chicks / DB2_Install_Steps.sh
Last active December 8, 2018 13:04
Sugar and DB2 on CentOS 6.4
# Disable SELinux
echo 0 > /selinux/enforce
perl -pi -e 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# Install required packages
yum install pdksh compat-libstdc++-33 compat-libstdc++-33.i686 libaio libaio.i686 \
pam-1.1.1-17.el6.x86_64 pam-1.1.1-17.el6.i686 nfs-utils openssh-clients \
numactl
# Update Kernel Parameters (http://ibm.co/1czEKb4)
@jvandyke
jvandyke / .gitconfig
Last active January 27, 2023 08:11
Use PHPStorm/WebStorm for git diff and merge tools
# ~/.gitconfig
# Add this to your global git configuration file
# Change phpstorm to webstorm, if you use that.
# Diff and merge tool changes
# Run `git difftool <directory/file>...` or `git mergetool <directory/file>...`
[merge]
tool = phpstorm
[diff]
tool = phpstorm