Skip to content

Instantly share code, notes, and snippets.

@SijmenHuizenga
SijmenHuizenga / main.go
Created April 8, 2020 22:57
Zip a directory in Golang with error handling, ignoring symlinks and file checking
func zipDirectory(zipfilename string) error {
outFile, err := os.Create(zipfilename)
if err != nil {
return err
}
w := zip.NewWriter(outFile)
if err := addFilesToZip(w, zipfilename, ""); err != nil {
_ = outFile.Close()
@yen3
yen3 / Caddyfile
Last active March 10, 2022 07:06
Example for https docker-gitlab under reversed proxy environment - Caddy http server
https://gitlab.example.com {
proxy / https://localhost:10443 {
insecure_skip_verify
transparent
}
tls {
dns gandiv5
}
}
import hudson.model.*;
import jenkins.model.*;
import hudson.plugins.ec2.*;
import com.amazonaws.services.ec2.model.InstanceType
import com.amazonaws.services.ec2.model.KeyPair
if ( Jenkins.instance.pluginManager.activePlugins.find { it.shortName == "ec2" } != null ) {
println "--> setting ec2 plugin"
EC2Cloud cloud = Jenkins.instance.clouds.find { it instanceof EC2Cloud }
@k33g
k33g / project-create.sh
Last active November 28, 2018 14:14 — forked from francoisromain/project-create.sh
A bash script to create a Git post-receive hook to deploy after a Git push
#!/bin/sh
# Call this file with `bash ./project-create.sh project-name [service-name]`
# project-name is mandatory
# service-name is optional
# This will creates 3 directories and a git `post-receive` hook.
# - $GIT: a git repo
# - $TMP: a temporary directory for deployment
# - $WWW: a directory for the actual production files
@Arnold1
Arnold1 / main.cpp
Last active January 12, 2019 21:40
screen recording
#include "ScreenCapture.h"
#include <algorithm>
#include <atomic>
#include <chrono>
#include <iostream>
#include <locale>
#include <string>
#include <thread>
#include <vector>
#include <queue>
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mondain
mondain / public-stun-list.txt
Last active May 5, 2024 18:13
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@glombard
glombard / jenkins-build-duration-graph.py
Last active July 5, 2022 02:04
Plot a graph of Jenkins job build durations over time
import logging
import datetime
import time
from dateutil import tz
import matplotlib.pyplot as plt
import pytz
import requests
logging.captureWarnings(True)
@danielpunkass
danielpunkass / XcodeBuildLogParser
Created January 16, 2015 14:29
Example configuration file for Jenkins's build log parser plugin, including some rules for Xcode quirks
# don't treat any of these as errors, warnings or info
ok /setenv /
# ignore TidyXML warnings
ok /line [0-9]+ column [0-9]+ - Error:/
ok /line [0-9]+ column [0-9]+ - Warning:/
ok /[0-9]+ warning.+ error.+ found!/
# ignore weird warnings about build variables in Info.plist:
# e.g. "warning: ignoring operator ':rfc1034Identifier' on 'RSWebClientCore' for macro 'PRODUCT_NAME'"
@josephholsten
josephholsten / sizeup.lua
Last active June 4, 2022 11:41
SizeUp in Hammerspoon
-- === sizeup ===
--
-- SizeUp emulation for hammerspoon
--
-- To use, you can tweak the key bindings and the margins
local sizeup = { }
--------------
-- Bindings --