Skip to content

Instantly share code, notes, and snippets.

willurd /
Last active Jan 19, 2022
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
View gist:5884472
description "service"
start on filesystem
stop on runlevel S
respawn limit 10 5
oom never
kill timeout 86400 #If it's given a stop order, this is how long it will take to stop.
vumaasha /
Created Sep 29, 2013
Installing solr on jetty 9. Downloads jetty and solr from the given urls and installs the sample core collection1 in solr in jetty 9. Also creates a use for jetty and installs jetty as a service. *Run the script as super user or using sudo in ubuntu.*
# set the configuration variables below, before running the script
# get the solr nightly build download link from
erickok /
Last active Jul 23, 2021
Loading a self-signed SSL certificate .crt file and packaging it into a SSLSocketFactory for use with a HttpsURLConnection.
// Usage example...
HttpsURLConnection connection = (HttpsURLConnection) new URL("").openConnection();
private static SSLSocketFactory buildSslSocketFactory(Context context) {
// Add support for self-signed (local) SSL certificates
// Based on
try {
rothgar / main.yml
Last active Dec 9, 2021
Generate /etc/hosts with Ansible
View main.yml
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
View gist:9324487
awk '/^(\S+) \S+ \S+ \[([^\]]+)\] "([A-Z]+)[^"]*" \d+ \d+ "[^"]*" "([^"]*)"$/m ($6 == "\"GET") && ($9 == 200) && !($7 ~ /^\/_analytics/) && !($7 ~ /^\/arama/) && !($7 ~ /^\/programlar\?q/) && !($7 ~ /^\/uzmanlar\?search/) && !($7 ~ /^\/app\/vplayer\/ {print $7}' access.log | uniq > access_log_filtered.log
kevingessner / gist:9509148
Last active Jul 10, 2021
Responsive emails that really work -- From Etsy's Code As Craft blog:
View gist:9509148
<style type="text/css">
table table {
width: 600px !important;
table div + div { /* main content */
width: 65%;
float: left;
cridenour / gist:74e7635275331d5afa6b
Last active Oct 17, 2021
Setting up Vim as your Go IDE
View gist:74e7635275331d5afa6b

Setting up Vim as your Go IDE

The final IDE


I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

duggan /
Created Oct 12, 2015
Present Terraform tfstate data as an Ansible inventory
#!/usr/bin/env python
import sys
import os
import json
import argparse
import collections
__description__ = """Ansible Dynamic Inventory for Terraform."""
__epilog__ = """
arun-gupta / readme.adoc
Last active Mar 22, 2020
Kubernetes Cluster on AWS
View readme.adoc
  1. kops:

    1. Getting Started Guide:

    2. Installing Kubernetes on AWS with kops:

    3. Mulit-master Kubernetes Cluster on AWS with kops:

    4. Booting Kubernetes on Amazon Elastic Compute with kops:

    5. Setting up an HA Kubernetes Cluster in AWS with private topology with kops 1.5.1:

    6. Kubernetes on AWS:

    7. Your 2nd day with Kubernetes on AWS:

  2. Tectonic (Terraform):