Skip to content

Instantly share code, notes, and snippets.

@rohancme
rohancme / Installation.md
Last active August 29, 2015 14:25
Postgres and PostGIS on a mac

With brew

brew install postgres
brew install PostGIS
@rohancme
rohancme / gist:a6c37fca6c6e3b8d5c82
Created August 4, 2015 06:23
Setting up Gunicorn on Ubuntu server
nginx
```
sudo apt-get install nginx
```
@rohancme
rohancme / digital_ocean_basics.md
Last active September 15, 2015 19:52
Digital Ocean API v2 basics

Get list of available images

(Replace XXXXXX with your access token):

curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer XXXXXX' "https://api.digitalocean.com/v2/images"

To pretty-print:

@rohancme
rohancme / azure_vm_creation.md
Last active February 18, 2021 03:14
Create an Azure VM using the Python SDK

Setting up a VM on Azure using the Python SDK

After over a day of going through their documentation, reading GitHub issues, going through the SDK unit tests and shudder the second page of google results, here's how:

Create a private key and cert (pem file):

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout id_rsa -out myCert.pem

(id_rsa is your private key, myCert.pem is your CSR)

Generate the public key from the private key:

# Sort disk usage asc
du -k -m -h -c / | sort -h
# listen for udp packets on a port
sudo tcpdump -i lo udp port 514
# make all .sh files in a directory executable
find ./ -name "*.sh" -exec chmod +x {} \;
# rsync through ssh tunnel
@rohancme
rohancme / kubernetes.json
Created July 15, 2017 01:31
Kubernetes template for the ACS-Engine
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.6.6"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "k8s-southcentralus-mgmt",
@rohancme
rohancme / azure-storage-class.yaml
Created July 15, 2017 01:34
Kubernetes storage class definitions for Azure
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: fast
provisioner: kubernetes.io/azure-disk
parameters:
skuName: Premium_LRS
location: southcentralus
---
@rohancme
rohancme / jenkins-persistent-volume.yaml
Created July 15, 2017 01:36
Kubernetes Persistent Volume for Jenkins
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: jenkins-master-claim
namespace: ci
annotations:
volume.beta.kubernetes.io/storage-class: fast
spec:
accessModes:
- ReadWriteOnce
@rohancme
rohancme / jenkins-master-deployment.yaml
Created July 15, 2017 01:37
Jenkins master Kubernetes deployment file
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins-master
namespace: ci
spec:
template:
metadata:
labels:
name: jenkins-master
apiVersion: v1
kind: Service
metadata:
name: jenkins-master-service
namespace: ci
spec:
type: LoadBalancer
ports:
- port: 80
name: http