Skip to content

Instantly share code, notes, and snippets.

View cronnelly's full-sized avatar

Michael Cronnelly cronnelly

View GitHub Profile
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active May 26, 2024 06:07
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
@smac89
smac89 / install_ffmpeg.sh
Last active August 22, 2023 19:48
Install latest version of ffmpeg on Ubuntu
#!/bin/bash
sudo apt-get update
sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev
# Create a dir where the rest of the sources will live
mkdir ~/ffmpeg_sources
@cupracer
cupracer / varnishlog-examples.sh
Last active May 12, 2024 17:50
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted
@oleq
oleq / _README.md
Last active January 7, 2024 10:38
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
@kehers
kehers / gist:48d1dc99c9cae0ceac0c
Last active November 22, 2018 15:48
Order of SSL pem file for HAProxy
1. key
2. crt
3. COMODORSADomainValidationSecureServerCA.crt
4. COMODORSAAddTrustCA
5. AddTrustExternalCARoot
DOMAIN='thefeed.press' sudo -E bash -c 'cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/letsencrypt/live/$DOMAIN/privkey.pem > /etc/haproxy/certs/$DOMAIN.pem'
@joemiller
joemiller / pantheon-check-ping-endpionts.rb
Created June 18, 2013 15:56
a meta-check for sensu that creates many other checks
#!/usr/bin/env ruby
#
# this is a special meta-check. It runs ping checks against all hosts in
# the /endpoints API and sends individual results directly to sensu-client via
# the udp/3030 client socket. this is different from the normal sensu check model
# where individual scripts run and their exit status and output is used to create
# a single event.
#
# the reason for this check is to be able to dynamically ping a list of hosts
# without the race conditions and timing issues involved with creating individual
@serby
serby / gist:3933039
Created October 22, 2012 18:05
Increase max file descriptors SmartOS
projdel node
projadd -c "node settings" -U admin -G staff -K "process.max-file-descriptor=(basic,65535,deny)" node
svccfg -s node-nodestack-service setprop 'method_context/project=node'
svcadm disable node-nodestack-service
svcadm enable node-nodestack-service
pgrep node
@joemiller
joemiller / sensu-handler-input-example.json
Created February 2, 2012 11:33
example json data passed into Sensu handlers via STDIN
{
"client":{
"name":"host01",
"address":"10.2.1.11",
"subscriptions":[
"all",
"env_qa",
"frontend",
"proxy",
"apache"