Skip to content

Instantly share code, notes, and snippets.

@blar
blar / Dockerfile
Created October 5, 2021 18:14
Rancher 1.6 Server: Upgrade agent image
FROM rancher/server:v1.6.30
RUN mkdir -p /var/lib/cattle/etc/cattle/ && \
echo -e "\nbootstrap.required.image=rancher/agent:v1.2.11-fixed" >> /var/lib/cattle/etc/cattle/cattle.properties
@mattkenn4545
mattkenn4545 / install-k3s.sh
Last active April 11, 2022 16:03
K3s/Rancher install script
#!/bin/env bash
set -e
export PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
: <<'README'
# Master node install, note this script /should/ be idempotentish. Rerunning to get worker node command output is fine
sudo -E ./install-k3s.sh
# to skip install of rancher
SKIP_RANCHER_INSTALL=true sudo -E ./install-k3s.sh
@hfreire
hfreire / upload_download_to_from_aws_glacier_using_aws.sh
Last active March 10, 2022 07:48
Upload/download to/from AWS Glacier using aws-cli
# create a vault
aws glacier create-vault --account-id - --vault-name my-vault-name
# check that the vault was created successfully
aws glacier describe-vault --account-id - --vault-name my-vault-name
# upload a file to the vault
aws glacier upload-archive --vault-name my-vault-name --account-id - --archive-description "my-archive-description" --body my-text-file.txt
# request an inventory of the vault
@andyrbell
andyrbell / docker-image-size.sh
Last active June 3, 2024 16:58
Sort docker images by size desc
#!/bin/sh
docker images --format '{{.Size}}\t{{.Repository}}\t{{.Tag}}\t{{.ID}}' | sed 's/ //' | sort -h -r | column -t
@gomfunkel
gomfunkel / elgato-eve.md
Last active September 9, 2023 18:28
Elgato Eve HomeKit Services & Characteristics

Elgato Eve HomeKit Services & Characteristics

A work in progress collection of proprietary and as of yet undocumented HomeKit characteristics and their UUIDs used by Elgato Eve.

This list is not including all Eve accessories available and some services and characteristics still make no sense to me. If you have anything to contribute, please leave a comment. There is no guarantee that the information listed below is correct.

Elgato Eve Energy (Firmware Revision 1.3.1;466)

Service - Characteristic UUID R W Type Description
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@JamesChevalier
JamesChevalier / mac_utf8_insanity.md
Last active June 16, 2024 13:44
Unicode on Mac is insane. Mac OS X uses NFD while everything else uses NFC. This fixes that.

convmv manpage

Install convmv if you don't have it

sudo apt-get install convmv

Convert all files in a directory from NFD to NFC:

convmv -r -f utf8 -t utf8 --nfc --notest .

@johntyree
johntyree / getBlockLists.sh
Last active June 4, 2024 12:30
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter