Skip to content

Instantly share code, notes, and snippets.

@yunano
yunano / consul.service
Created May 1, 2015 15:52
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
# MOVED TO
# https://github.com/jamiesonbecker/redis2json
@nikreiman
nikreiman / sp
Last active October 26, 2015 23:44 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@jpetazzo
jpetazzo / ansibull.png
Created August 27, 2015 22:53
Generate an ANSI bull.
ansibull.png
@LCBH
LCBH / HideLog.py
Last active November 16, 2015 11:05
"""" Hides private data from Kresus logs.
Usage: $python HideLog.py log_input.json log_output.json. """
from sys import argv
import json
from Crypto.Cipher import AES
# -- LABELS
BA = "bankAccount"
TL = "title"
@vik-y
vik-y / delete_all_tweets.py
Last active September 22, 2023 21:04 — forked from davej/delete_all_tweets.py
This script will delete all of the tweets in a specified account.
# -*- coding: utf-8 -*-
"""
This script is forked originally from Dave Jeffery. The original implementation
was very slow and deleted around 2 tweets per second. Making it multithreaded I
am able to delete 30-50 tweets per second.
@author: vik-y
----------------------------------------------------------------------------
This script will delete all of the tweets in the specified account.
@clochix
clochix / gist:4b8576b1eac17b45d012
Created November 3, 2015 12:44
Using Debian alternative system to switch between versions of Node.js
To switch easily between Node versions on Debian, instead of tools like [nvm](https://github.com/creationix/nvm), you can just use [Debian's native alternatives system](http://www.debian-administration.org/article/91/Using_the_Debian_alternatives_system).
(the following commands require root privilege)
- download and install the node executables under /usr/local/bin/nodes/…
- add this binaries to the alternative system:
update-alternatives --install /usr/bin/node node /usr/bin/nodejs 100
update-alternatives --install /usr/bin/node node /usr/local/bin/nodes/0.10.38/nodejs 50
- to switch between versions, just call `update-alternatives --config node`
@xrstf
xrstf / letsencrypt.md
Last active October 30, 2024 07:03
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

@jackcarter
jackcarter / slack_delete.py
Last active February 11, 2025 15:46
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@vasanthk
vasanthk / System Design.md
Last active July 18, 2025 05:13
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?