Skip to content

Instantly share code, notes, and snippets.

View bennythejudge's full-sized avatar

Benedetto Lo Giudice bennythejudge

View GitHub Profile
#!/bin/bash
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Lockable script boilerplate
@dch
dch / gist:4148379
Created November 26, 2012 14:07 — forked from ajohnstone/gist:4148292
graphite internal performance
Carbon relay - performance
alias(color(sumSeries(group(carbon.agents.*.updateOperations)), "blue"),"Updates")
alias(color(sumSeries(group(carbon.agents.*.metricsReceived)), "green"), "Metrics Received")
alias(color(sumSeries(group(carbon.agents.*.committedPoints)),"orange"),"Committed Points"))
alias(secondYAxis(color(sumSeries(group(carbon.agents.*.pointsPerUpdate)),"yellow")),"PPU")
alias(secondYAxis(color(averageSeries(group(carbon.agents.*.cpuUsage)),"red")),"CPU (avg)")
alias(secondYAxis(color(sumSeries(group(carbon.agents.*.creates)),"purple")),"Creates")
Metrics received
carbon.agents.*.metricsReceived
@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@lukaszraczylo
lukaszraczylo / delete-hipchat-history.rb
Last active July 13, 2021 15:43
Delete hipchat 1:1 history (WORKING)
#!/usr/bin/env ruby
# To make it work:
# - change account details to yours ( obviously ;) )
# - install mechanize gem in version 1.0.0 ( gem install mechanize -v '1.0.0' )
# - look for !!HERE!! comments in code in case you'd like to change default behavior
# - for best results run this script few times as hipchat / ruby openssl don't play together that well and
# there might be an exception thrown from time to time. Script should retry then but hey.. Nobody is perfect.
# .. and finally. Remember that other part should run this script as well to make history clean.
@GaryRogers
GaryRogers / VagrantCentOS.md
Last active February 8, 2020 20:32
Provisioning Vagrant CentOS hosts
@daniellevass
daniellevass / android_material_design_colours.xml
Last active March 26, 2024 15:48
Android Material Design Colours
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
#!/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
@jashkenas
jashkenas / semantic-pedantic.md
Last active November 29, 2023 14:49
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins