Skip to content

Instantly share code, notes, and snippets.

View freyes's full-sized avatar
🥑

Felipe Reyes freyes

🥑
View GitHub Profile
@noelhibbard
noelhibbard / Doorbell.env
Last active October 12, 2023 16:49
This gist shows how to pull the local stream from a Wyze camera and then push it to an RTMP server.
# Edit and rename this file and then place it in /etc/wyzecam-to-rtmp
WYZE_EMAIL="joeblow@example.com"
WYZE_PASSWORD="wyzepasshere"
WYZE_CAMERA_NAME="Doorbell"
RTMP_URL="rtmp://127.0.0.1/live/doorbell"
@tpsilva
tpsilva / recover_machine_agents.py
Created February 23, 2020 13:54
Recover juju machine agents
#!/usr/bin/env python
"""
This is a tool for recovering lost machine units in current model
Usage:
{0} model-name controller-ip dest-dir
"""
import json
import os
@dosaboy
dosaboy / cleanup-compute-placement-allocations-lp1756179.sh
Last active January 17, 2020 15:12
Cleanup compute host resource allocations in placement api left over from Nova bug LP 1756179
#!/bin/bash -ux
# Cleanup compute host resource allocations in placement api left over from Nova bug LP 1756179
# Background: It turns out that when you delete a service the associated resource provider (nova placement api) does not get deleted or updated.
mysql -s -N -h$host -u${user} -p$pw nova
# Get id of deleted compute host
select id from compute_nodes where host="__HOSTNAME_GOES_HERE__" and deleted_at!="NULL";
#!/bin/bash -eu
#
# Origin: https://gist.github.com/dosaboy/95372c6ec16c9360dec240a2aa5859bb
#
# Authors:
# - edward.hope-morley@canonical.com
# - opentastic@gmail.com
#
# Description:
# Convert simplestreams images in Glance to disk_format=raw
dialmgo() {
agent=$(cd /var/lib/juju/agents; echo machine-*)
pw=$(sudo cat /var/lib/juju/agents/${agent}/agent.conf |grep statepassword |awk '{ print $2 }')
/usr/lib/juju/mongo3.2/bin/mongo --ssl --sslAllowInvalidCertificates -u ${agent} -p $pw localhost:37017/juju --authenticationDatabase admin
}
@niedbalski
niedbalski / strace-hook.sh
Last active September 14, 2017 20:29
strace-hook.sh
#!/bin/bash
# ./strace-hook.sh update-status
# this command straces all the processes and subprocesses spawned
# by a particular juju hook when is run.
set -e
hook=${1:-update-status}
regex=".*${hook}.*"
trace_dir=${2:-trace}
@msplival
msplival / mongodb_collection_sizes.js
Last active March 13, 2018 06:44 — forked from joeyAghion/mongodb_collection_sizes.js
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
var mgo = db.getMongo()
function getReadableFileSizeString(fileSizeInBytes) {
var i = -1;
var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
do {
fileSizeInBytes = fileSizeInBytes / 1024;
i++;
} while (fileSizeInBytes > 1024);
@FlorianHeigl
FlorianHeigl / cheatsheets.md
Last active December 29, 2023 07:07
Printable Cheat Sheets for Software

A collection of links to useful cheat sheets.

Only what's properly printable can get a spot at the top of this list. It should also be small enough to fit on a few pages. almost all links in this document were designed by their creators so that YOU can print them in a good-looking format and store them however is best for you. Anything that isn't really something you could print in A4/UfS Letter format, but is still a well-made cheatsheet can get a spot at the end of the page.

Pleae contribute any you remember you've seen and liked. It would be wonderful if we can get these to be something more commonly made.

Search Engines

erl -sname tester -setcookie $(cat /var/lib/rabbitmq/.erlang.cookie) -remsh rabbit@$(hostname)
io:format("~p", [dict:find(rabbit, dict:from_list(rabbit:environment()))]).
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 9, 2024 20:00
Hyperlinks in Terminal Emulators