Skip to content

Instantly share code, notes, and snippets.

@dansimau
dansimau / ldif-to-csv.sh
Created November 12, 2010 15:14
Shell script that reads LDIF data from STDIN and outputs as CSV.
#!/bin/bash
#
# Converts LDIF data to CSV.
# Doesn't handle comments very well. Use -LLL with ldapsearch to remove them.
#
# 2010-03-07
# dsimmons@squiz.co.uk
#
# Show usage if we don't have the right params
@rmcgibbo
rmcgibbo / github_comment_on_commit.py
Created August 23, 2012 07:22
Jenkins setup to automatically comment on github commits with build status
// Using the Jenkins Groovy Post build plugin to execute the following after every build
// https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin
// It would be nice not to have to specify these here... the repo name should be available within the hudson
// api somehow, but I didn't know how to get it. The access token should maybe be saved in a config file, and
// read in at runtime?
GITHUB_REPO_NAME = 'myusername/myreponame'
GITHUB_ACCESS_TOKEN = 'my_github_api_v3_access_token'
@visnup
visnup / gist:3669200
Created September 7, 2012 20:05
awesomium clickonce publishing doesn't quite work: use an afterpublish target to copy the right files to the right place.
<Target Name="AfterPublish">
<ItemGroup>
<AwesomiumFiles Include="Awesomium\Awesomium.Core.XML" />
<AwesomiumFiles Include="Awesomium\Awesomium.Windows.Forms.XML" />
<AwesomiumFiles Include="Awesomium\Awesomium.dll" />
<AwesomiumFiles Include="Awesomium\AwesomiumProcess" />
<AwesomiumFiles Include="Awesomium\en-US.dll" />
<AwesomiumFiles Include="Awesomium\icudt42.dll" />
</ItemGroup>
<Copy SourceFiles="@(AwesomiumFiles)" DestinationFiles="@(AwesomiumFiles-&gt;'$(PublishDir)Application Files\$(ProjectName)_$(PublishVersion.Replace('.', '_'))\%(Filename)%(Extension).deploy')" />
@leifg
leifg / Vagrantfile
Last active November 12, 2023 08:31
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
@infotroph
infotroph / git-MSOffice-diff
Last active December 17, 2015 02:28
A quick and dirty approach to make git-diff on MS Office documents use the decompressed XML instead of treating them as binary. Known bugs: Complains on empty components (notably including the always-present [Content_Types].xml), and actually shows all changes to the XML (so good luck finding meaningful changes to an Excel file under all the dis…
# /usr/local/bin/xmlzip.sh:
#!/bin/bash
for i in `unzip -Z -1 "$1"`; do
echo "$i"
unzip -a -p "$1" "$i" | xmllint --format -
done
# ~/.gitconfig:
[diff "xmlzip"]
@mbrevoort
mbrevoort / LogstashUDP.js
Created June 24, 2013 06:55
A simple Logstash UDP logger for Winston.
// Really simple Winston Logstash UDP Logger
var dgram = require('dgram'),
util = require('util'),
os = require('os'),
winston = require('winston');
var LogstashUDP = module.exports = function (options) {
winston.Transport.call(this, options);
options = options || {};
@jpetazzo
jpetazzo / gist:6127116
Created July 31, 2013 23:21
Debian/Ubuntu containers protips, thanks to @spahl
# this forces dpkg not to call sync() after package extraction and speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
# we don't need and apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@p120ph37
p120ph37 / ip-up
Created June 30, 2014 16:27
PPP VPN split-network/split-DNS script for OSX
#!/bin/sh
####################################################
## ##
## PPP VPN split-network/split-DNS script for OSX ##
## by Aaron Meriwether ##
## ##
## installation: ##
## sudo cp thisfile /etc/ppp/ip-up ##
## sudo chmod 755 /etc/ppp/ip-up ##
## ##
#!/bin/bash
JQPATH=$(which jq)
if [ "x$JQPATH" == "x" ]; then
echo "Couldn't find jq executable." 1>&2
exit 2
fi
set -eu
shopt -s nullglob