Skip to content

Instantly share code, notes, and snippets.

@chrisbolin
chrisbolin / serve.py
Last active March 22, 2023 13:53
Python SimpleHTTPServer for Static Serving (React / Angular / Ember) in HTML5 mode (a la mod_rewrite)
'''
Taken from:
http://stackoverflow.com/users/1074592/fakerainbrigand
http://stackoverflow.com/questions/15401815/python-simplehttpserver
'''
import SimpleHTTPServer, SocketServer
import urlparse, os
PORT = 3000
@mattupstate
mattupstate / README.md
Created November 13, 2014 17:14
An example of how to setup streaming replication for PostgreSQL with Docker.

PostgreSQL Streaming Replication With Docker

The *.txt files here hold user and database parameters. Specifically, replication.txt contains the user/role and password to use for replication. Whereas database.txt contains an initial database, user/role and password to create on the master.

Run the master:

$ fig run -d master

Wait for it to start up completely. Start the slave:

@crisidev
crisidev / grafana-dashboard-exporter
Created October 7, 2015 20:35
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
@dcunited001
dcunited001 / io.xkb
Created December 22, 2015 11:24
Xkb digimon layout with unicode & emoji for linux mint
// check out my keyboard dotfiles for info
// - https://github.com/dcunited001/dc.files.kbd/tree/master/xkeyboard
partial alphanumeric_keys
xkb_symbols "basic" {
include "us"
name[Group1]= "Digimon - US";
// shift + space = underscore
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active June 21, 2024 17:44
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@c0psrul3
c0psrul3 / do_cloud-config.init.yaml
Last active May 11, 2024 09:40
Digital Ocean cloud-init / cloud-config / droplet metadata usage
#
#DO droplet metadata intro + for DO-API
# [https://www.digitalocean.com/community/tutorials/an-introduction-to-droplet-metadata#how-to-retrieve-droplet-metadata#digitalocean-api]
#
#intro to cloud-config scripting (source of following examples)
# [https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting]
#
#howto
# [https://www.digitalocean.com/community/tutorials/how-to-use-cloud-config-for-your-initial-server-setup]
#
@m93a
m93a / .XCompose
Last active August 26, 2023 08:44
Unicode emoticons for Compose key
# Emoji
# http://unicode.org/emoji/charts/full-emoji-list.html
<Multi_key> <e> <m> <o> <colon> <D> : "😀"
<Multi_key> <e> <m> <o> <x> <D> : "😁"
<Multi_key> <e> <m> <o> <x> <apostrophe> <D> : "😂"
<Multi_key> <e> <m> <o> <colon> <apostrophe> <D> : "😂"
<Multi_key> <e> <m> <o> <r> <o> <f> <l> : "🤣"
<Multi_key> <e> <m> <o> <colon> <d> : "😃"
<Multi_key> <e> <m> <o> <x> <parenright> : "😄"
@Daniel-dk
Daniel-dk / espNow_broadcast
Created November 28, 2017 17:40
ESP-Now broadcast example
/**
ESPNOW - Basic communication - Broadcast
Date: 28th September 2017
Original Author: Arvind Ravulavaru <https://github.com/arvindr21>
modified by Daniel de kock
Purpose: ESPNow Communication using Broadcast
Resources: (A bit outdated)
a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf
@AHaymond
AHaymond / bash-colors.md
Last active May 27, 2024 20:11 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple