Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active September 20, 2024 16:38
set -e, -u, -o, -x pipefail explanation
@sanderson
sanderson / apple-weights-line-protocol.txt
Created June 13, 2018 21:05
Percentage with Cumulative Total
weight apple_weight=0.11 1528113660000000000
weight apple_weight=0.42 1528113720000000000
weight apple_weight=0.83 1528113780000000000
weight apple_weight=0.07 1528113840000000000
weight apple_weight=0.19 1528113900000000000
weight apple_weight=0.43 1528113960000000000
weight apple_weight=0.67 1528114020000000000
weight apple_weight=0.24 1528114080000000000
weight apple_weight=0.74 1528114140000000000
weight apple_weight=0.03 1528114200000000000
variable "sdd_snapshot_description" {
description = "This is the description that will be used to identify the snapshots of our data volume. We will filter against this value."
default = "sdd-data-snapshot"
}
provider "aws" {}
// Get the latest version of our /dev/sdd snapshot
data "aws_ebs_snapshot" "sdd_snapshot" {
most_recent = true
@w0rd-driven
w0rd-driven / passwords.txt
Created November 18, 2016 20:19
BFG Repo-Cleaner --replace-text example
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default)
PASSWORD2==>examplePass # replace with 'examplePass' instead
PASSWORD3==> # replace with the empty string
regex:password=\w+==>password= # Replace, using a regex
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines
@jamtur01
jamtur01 / pre-commit
Created October 18, 2016 21:54
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
127.0.0.1 - - [22/Aug/2011:10:02:00 +0900] "GET / HTTP/1.1" 200 902 "-" "Python-urllib/2.7"
127.0.0.1 - - [22/Aug/2011:10:02:00 +0900] "GET / HTTP/1.1" 200 572 "-" "okhttp/2.4.0"
127.0.0.1 - - [22/Aug/2011:10:02:00 +0900] "GET /large.jpg HTTP/1.1" 200 714 "-" "okhttp/2.4.0"
127.0.0.1 - usera [22/Aug/2011:10:02:00 +0900] "GET /large.jpg HTTP/1.1" 200 926 "-" "Firefox/5.0"
127.0.0.1 - userb [22/Aug/2011:10:02:00 +0900] "GET / HTTP/1.1" 200 862 "-" "Firefox/5.0"
127.0.0.1 - - [22/Aug/2011:10:02:00 +0900] "GET / HTTP/1.1" 200 306 "-" "Firefox/5.0"
127.0.0.1 - - [22/Aug/2011:10:02:00 +0900] "POST / HTTP/1.1" 200 579 "-" "okhttp/2.4.0"
127.0.0.1 - - [22/Aug/2011:10:02:00 +0900] "POST / HTTP/1.1" 200 988 "-" "Python-urllib/2.7"
127.0.0.1 - - [22/Aug/2011:10:02:00 +0900] "GET /large.jpg HTTP/1.1" 200 115 "-" "Firefox/5.0"
127.0.0.1 - userb [22/Aug/2011:10:02:00 +0900] "GET / HTTP/1.1" 200 359 "-" "Firefox/5.0"
@nickbabcock
nickbabcock / graphite.conf
Last active December 6, 2019 06:18
Installs Graphite on CentOS 6
server {
listen 80;
root /opt/graphite/webapp/content;
location / {
# checks for static file, if not found proxy to app
try_files \$uri @app;
}
location @app {
@hernan604
hernan604 / gist:9515882
Created March 12, 2014 20:44
convert image to base64 with perl
perl -e 'use MIME::Base64 qw|encode_base64| ; use File::Slurp ; print encode_base64( read_file( $ARGV[0] ) )' /home/hernan/Downloads/quadrado_inclinado.png
@Cromeshnic
Cromeshnic / zbx_template_jmx_activemq.xml
Created August 23, 2013 07:31
Zabbix 2.0 template for ActiveMQ with JMX LLD for brokers and destinations. Feel free to contribute.
<?xml version="1.0" encoding="UTF-8"?>
<!--
by Semyon Koshechkin (c) 2013
https://github.com/Cromeshnic
Zabbix ActiveMQ monitoring template with LLD support for:
- Brokers
- Topics
- Queues