Skip to content

Instantly share code, notes, and snippets.

@markbirbeck
markbirbeck / ubuntu-from-scratch.md
Last active February 27, 2021 18:55
Setting up a new Ubuntu Laptop
# Update repos
#
sudo apt update
sudo apt install --only-upgrade -y \
  gcc-5-base \
  libstdc++6

# Tools
#
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active May 3, 2025 08:56
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@dbrandt
dbrandt / awsudo.py
Created July 22, 2016 10:33
Set AWS environment (key ID, secret key and token) from AWS CLI credentials
#!/usr/bin/env python
import os
import sys
import pickle
from datetime import datetime, timedelta, tzinfo
import boto3
import botocore
anonymous
anonymous / gist
Created June 20, 2016 21:04
#!/bin/bash
paste_command="/usr/bin/gist-paste $1"
#paste_command="/usr/bin/gist-paste -p --login $1"
#paste_command="/usr/bin/gist-paste --description=$2 $1"
#paste_command="/usr/bin/pastebinit"
black="\e[00;30m"
red="\e[00;31m"
green="\e[00;32m"
@alces
alces / ansible_local_playbooks.md
Last active May 6, 2025 11:00
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@gg7
gg7 / cve-2015-7547.yml
Last active August 5, 2016 02:15
CVE-2015-7547 Ansible playbook
- hosts: all
remote_user: root
tasks:
- name: Apt-get update
apt: update_cache=yes cache_valid_time=3600
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Check if libc6 is installed (apt)
command: dpkg-query -W libc6
register: libc6
@peterpalmieri
peterpalmieri / cassandra.yaml
Last active February 10, 2016 01:09
Datadog Cassandra config
instances:
- host: localhost
port: 7199
cassandra_aliasing: true
init_config:
# List of metrics to be collected by the integration
# Read http://docs.datadoghq.com/integrations/java/ to learn how to customize it
conf:
- include:
domain: org.apache.cassandra.metrics
@shoemaker
shoemaker / coffee.js
Created January 29, 2016 19:57
Coffee for Hubot
// Description:
// Listens for coffee-related strings and chimes in with quotes and coffee shop suggestions.
// Dependencies:
// none
// Configuration:
// HUBOT_FOURSQUARE_CLIENTID - A Foursquare client ID.
// HUBOT_FOURSQUARE_CLIENTSECRET - A foursquare client secret.
// HUBOT_FOURSQUARE_LATLONG - The latitude and longitude of your location, for coffee shop suggestions. Format: 44.9789949,-93.2717354
@markbirbeck
markbirbeck / mac-from-scratch.md
Last active October 19, 2024 03:03
Mac From Scratch

Admin Account

During installation, create a user called admin rather than one with your own name.

Apps for All Users

Then install Homebrew as per latest instructions (note that this will install the necessary CLI components for XCode):

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@devdazed
devdazed / tombstone_count.py
Created November 24, 2015 22:04
Count tombstones in a Cassandra Table
#!/usr/bin/env python
"""
Counts the number of tombstones in a keyspace.table and reports the top N highest counts
tombstone_count.py
[-h] This help screen
[--data-dir DATA_DIR] The C* data directory (/var/lib/cassandra/data)
[--top-k TOP_K] The top number of keys with highest tombstone counts to display.
keyspace The keyspace that contains the table