Skip to content

Instantly share code, notes, and snippets.

@onedr0p
onedr0p / simple_convert.py
Last active November 30, 2024 13:48
A simple script to convert media files to MP4 for a better Plex experience
# Python 2.7
import os
import sys
import time
import platform
import subprocess
import urllib2
import logging
@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:

default.conf

server {
    listen 443;
    server_name homelab.example.com;

    access_log /var/log/nginx/homelab.example.com.access.log;
    error_log /var/log/nginx/homelab.example.com.error.log;

root /var/www/html;

@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active September 13, 2025 02:49
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@bfg100k
bfg100k / snapRAID_helper.sh
Last active February 23, 2025 19:56
Bash helper script to help with the automation of routine snapRAID tasks. Add it as a cron job to automate the routine tasks of running sync and scrub. Script will optionally send you email of status and issues encountered during the run.
#!/bin/bash
#######################################################################
# This is a helper script that keeps snapraid parity info in sync with
# your data and optionally verifies the parity info. Here's how it works:
# 1) It first calls diff to figure out if the parity info is out of sync.
# 2) If parity info is out of sync, AND the number of deleted files exceed
# X (configurable), it triggers an alert email and stops. (In case of
# accidental deletions, you have the opportunity to recover them from
# the existing parity info)
# 3) If partiy info is out of sync, AND the number of deleted files exceed X
@haf
haf / LICENSE
Last active February 14, 2024 11:15
Setting up a digitalocean proxy
https://www.gnu.org/licenses/gpl-3.0.en.html
GNU GENERAL PUBLIC LICENSE v3
@rolandboon
rolandboon / VMware ESXi(5.5) Fix networking and SATA for Gigabyte GA-Z97N-WIFI
Last active February 18, 2017 15:39
VMware ESXi(5.5) Fix networking and SATA for Gigabyte GA-Z97N-WIFI
== ESXi on Gigabyte GA-Z97N-WIFI ==
Default driverset of ESXi5.5 doesn't support the Gigabyte GA-Z97N-WIFI onboard Network Controller and SATA Controller. During install you will be stopped on the error "No support network interfaces available".
== Intel NIC drivers ==
To be able to install ESXi you need to add "unofficial" drivers to the install ISO. Gigabyte doesn't really mention which specific Intel Network Controller it is used, but it is the Intel I217-V. To add the drivers. To add the drivers to the install ISO use ESXi-customizer to merge the VIB file (drivers) with the official ESXi ISO.
- ESXi-customizer: http://www.v-front.de/p/esxi-customizer.html
- VIB file: http://shell.peach.ne.jp/~aoyama/wordpress/download/net-e1000e-2.3.2.x86_64.vib
- More info: http://www.ivobeerens.nl/2013/09/20/enable-the-intel-i217-v-network-card-in-vmware-esxi/

How To Run OpenVPN in a Docker Container

Introduction

This tutorial will explain how to setup and run an OpenVPN container with the help of Docker.

OpenVPN provides a way to create virtual private networks (VPNs) using TLS (evolution of SSL) encryption. OpenVPN protects the network traffic from eavesdropping and man-in-the-middle (MITM) attacks. The private network can be used to securely connect a device, such as a laptop or mobile phone running on an insecure WiFi network, to a remote server that then relays the traffic to the Internet. Private networks can also be used to securely connect devices to each other over the Internet.

Docker provides a way to encapsulate the OpenVPN server process and configuration data so that it is more easily managed. The Docker OpenVPN image is prebuilt and includes all of the necessary dependencies to run the server in a sane and stable environment. Scripts are included to significantly autom

@yuvadm
yuvadm / install.sh
Last active October 12, 2020 11:21
Arch Linux installation on Lenovo ThinkPad X200s
# Arch Linux installation procedure on a Lenovo ThinkPad X200s
# BIOS boot (no UEFI), SSD + LVM + LUKS + TRIM + discards
# Randomize (or zero) drive contents
dd if=/dev/urandom of=/dev/sda
# Create GPT and partitions
# Use gdisk to ensure proper partition alignment
gdisk /dev/sda
# 100MB boot partition on /dev/sda1 type 8300
@ndarville
ndarville / business-models.md
Last active September 19, 2025 07:49
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google