Skip to content

Instantly share code, notes, and snippets.

View akatrevorjay's full-sized avatar
🌙

Trevor Joynson akatrevorjay

🌙
View GitHub Profile
@UtahDave
UtahDave / module.sls
Created June 11, 2012 20:30 — forked from anonymous/module.sls
Apache module macro for salt
{% macro a2mod(module, enabled=true) -%}
{% if enabled %}
a2enmod {{ module }}:
cmd:
- run
- unless: test -L /etc/apache2/mods-enabled/{{ module }}.load
- require:
- pkg: apache2
- watch_in:
- service: apache2
@eliasp
eliasp / salt#master.sls
Last active December 27, 2015 20:29
Saltmaster Dockerfiles
python-pip:
pkg.installed
docker-py:
pip.installed:
- require:
- pkg: python-pip
# TODO: ensure docker-py is declared a requirement for all dockerio states without having to explicitely declare the requirement in each container state again
@lauborges
lauborges / github_repos.rb
Created July 24, 2011 23:50 — forked from akitaonrails/github_repos.rb
manage all github repositories (yours and watched) with a single command.
#!/usr/bin/env ruby
#
# Brute-force way to retrieve all Github's repositories at once
# Usage:
# github_repos.rb clone # will clone all the user's repositories
# github_repos.rb clone test # will just clone 6 repositories for testing purposes
# github_repos.rb pull # will update all of the user's local repositories
#
# If you have forked repositories, the original sources will be added
# as remotes with the default 'forked_from' name, and a new 'forked_from'
@rcarmo
rcarmo / thespian-raft.py
Created August 7, 2016 08:17
The Raft leader election protocol, implemented atop GoDaddy's Thespian actor library
from thespian.actors import *
from datetime import datetime, timedelta
from logging import getLogger, basicConfig, DEBUG
from random import randint
basicConfig(level=DEBUG)
log = getLogger(__name__)
class Postman(Actor):
import asyncio
import functools
import random
class Message(object):
def __init__(self, message, payload={}):
self.message = message
self.payload = payload
self.result = None
@sogoo
sogoo / gist:4644583
Last active December 1, 2017 06:11
MultiColumn Bookmarks 4 Firefox
/* MultiColumn Bookmarks for Firefox */
#bookmarksMenu menupopup .scrollbox-innerbox, .bookmark-item[container="true"] menupopup .scrollbox-innerbox {
width: 650px !important; /*display width*/
/* width: 850px !important; *//*4 colonnes*/
display: table !important;
}
#bookmarksMenu .bookmark-item, .bookmark-item[container="true"] .bookmark-item {
min-width: 300px !important;/*title width*/
@JZersche
JZersche / : userChrome.css (zDark) Firefox Theme
Last active February 2, 2019 18:13
The chrome directory and userChrome.css file does not exist by default. It will need to be created.
[Firefox 57.0b11->65.0b12 Developer Edition]
Tab Center Redux 0.5.1 zDark Modern Theme
/* Place the Code below inside the chrome folder in a file named userChrome.css */
[%APPDATA%\Mozilla\Firefox\Profiles\[YourProfileID].dev-edition-default\chrome\userChrome.css */
@namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul;// userChrome.css JZersche //
#navigator-toolbox{margin-top:1px}#TabsToolbar{visibility:collapse!important}#main-window{--toolbar-bgcolor:#282C30!important}#urlbar{background:#1f2226;border:1px solid #33383c}#pageAction-urlbar-reload-in-urlbar_exe-boss{filter:invert(100%)}#sidebar-box[sidebarcommand="_0ad88674-2b41-4cfb-99e3-e206c74a0076_-sidebar-action"]{overflow:hidden!important;min-width:32px!important;max-width:32px!important;position:relative!important;top:89px!important;transition:all .2s ease!important;border-right:2px solid #0088eeff!important;z-index:2!important}#sidebar-box[sidebarcommand="_0ad88674-2b41-4cfb-99e3-e206c74a0076_-sidebar-action"] #sidebar{position:
@renoirb
renoirb / files-ssl.cnf
Last active January 11, 2020 22:54
Creating on a server MySQL configuration. Using those three
[client]
ssl
ssl-ca=/etc/mysql/ca-cert.pem
ssl-cert=/etc/mysql/client-cert.pem
ssl-key=/etc/mysql/client-key.pem
[mysqld]
ssl
ssl-cipher=DHE-RSA-AES256-SHA
ssl-ca=/etc/mysql/ca-cert.pem
{% macro postconf(key, value) -%}
postconf-{{ key }}:
cmd:
- run
- name:
- postconf -e {{ key }}='{{ value }}'
- unless: test "x$(postconf -h {{ key }} )" = 'x{{ value }}'
- require:
- pkg: postfix
@akatrevorjay
akatrevorjay / setuptools_parse_all_requirements.py
Last active February 12, 2020 19:25
Parse a glob of requirements file(s) to fill in your requirements for you, or just as a generic parser.
import glob
import itertools
import os
# This is getting ridiculous
try:
from pip._internal.req import parse_requirements
from pip._internal.network.session import PipSession
except ImportError:
try: