Skip to content

Instantly share code, notes, and snippets.

@jon1012
jon1012 / sds011.py
Last active October 23, 2017 09:23 — forked from geoffwatts/sds011.py
Read an SDS011 Laser PM2.5 Sensor (Nova PM Sensor) with Python
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import serial, time, struct
import httplib, urllib
ser = serial.Serial("/dev/ttyUSB0", baudrate=9600, stopbits=1, parity="N", timeout=2)
ser.flushInput()
@jeekajoo
jeekajoo / README.md
Last active February 18, 2022 17:31 — forked from JohnTroony/delete_all_tweets.py
delete ALL tweets using tweepy

Delete ALL tweets

Modifications

  • Remove confirmations
  • Add README

How to use

@DenisIzmaylov
DenisIzmaylov / NOTES.md
Last active September 18, 2024 15:50
Step By Step Guide to Configure a CoreOS Cluster From Scratch

Step By Step Guide to Configure a CoreOS Cluster From Scratch

This guide describes how to bootstrap new Production Core OS Cluster as High Availability Service in a 15 minutes with using etcd2, Fleet, Flannel, Confd, Nginx Balancer and Docker.

Content

@vasanthk
vasanthk / System Design.md
Last active May 9, 2025 13:08
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?
@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():
@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:

@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`
@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.
@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"
@jpetazzo
jpetazzo / ansibull.png
Created August 27, 2015 22:53
Generate an ANSI bull.
ansibull.png