Skip to content

Instantly share code, notes, and snippets.

@minimal
minimal / post.md
Last active May 26, 2023 08:52
Event monitoring post

At Skimlinks up until about 20 months ago our service monitoring consisted mostly of Icinga/Nagios checks that only ran about every 5 minutes. The Icinga dashboard was displayed on our monitor wall. While readying the release of a new version of SkimWords we thought we needed some monitoring closer to real-time. Since the API was CPU bound and latency sensitive we needed more insight into the state of the system, especially during new releases and traffic spikes.

As Clojure fans, we had recently come across

@felipe-prenholato
felipe-prenholato / pre-commit
Created January 6, 2015 12:34
Basic pre-commit hook for avoid commit code with pdb/ipdb
#!/bin/bash
# based on http://www.snip2code.com/Snippet/165926/Check-for-ipdb-breakpoints-git-hook
pdb_check=$(git grep -E -n '[ ;]i?pdb')
if [ ${#pdb_check} -gt 0 ]
then
echo "COMMIT REJECTED: commit contains code with break points. Please remove before commiting."
echo $pdb_check
exit 1
else
@crusat
crusat / gulpfile.js
Last active October 16, 2019 03:52
Gulp Example
// npm i -g gulp
// npm i gulp gulp-uglify gulp-rename gulp-concat gulp-header gulp-minify-css gulp-watch
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
header = require('gulp-header'),
pkg = require('./package.json'),
minifyCSS = require('gulp-minify-css'),
watch = require('gulp-watch');

Small bag / wearing

  • Passport (+I-797B)
  • Hoodie
  • Bluetooth headphones
  • Surface
  • 3DS/Vita (+games for 3DS)
  • Nexus 9
  • Kindle
@zachcp
zachcp / trim_adaptors.py
Created December 12, 2014 17:45
Trim Adaptor Script Modified for Parallel Processing using the Multiprocessing module
#!/usr/bin/env python
"""
Modified from:
https://github.com/chapmanb/bcbb/blob/master/align/adaptor_trim.py
See Also:
https://bcbio.wordpress.com/2009/08/09/trimming-adaptors-from-short-read-sequences/
Trim adaptor sequences from reads; designed for short read sequencing.
Allows trimming of adaptor sequences from a list of SeqRecords produced
@ipmb
ipmb / ratelimit.nginxconf
Last active July 21, 2024 05:37
Nginx reverse proxy with rate limiting
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active May 11, 2024 17:43
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@bjorgvino
bjorgvino / yosemite ntfs read+write.txt
Last active December 2, 2021 03:58
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@jdoconnor
jdoconnor / gist:32ef0314cecb80157c4e
Created September 26, 2014 21:38
Update mtimes based off commit time
#!/bin/bash -e
####
# based on https://gist.github.com/jeffery/1115504
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# simples fabfile para aplicar o patch para o bug CVE-2014-6271
__author__ = 'juliomelo'
from fabric.api import *
from fabric.decorators import hosts
import re
env.use_ssh_config=True
@hosts('host_foo', 'host_bar')
@task