Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lpaulmp on github.
  • I am paulmp (https://keybase.io/paulmp) on keybase.
  • I have a public key ASC5Yfg_UmblYc4Rjx-A-Wo1doczwndqx8s1Du9wJN2ekwo

To claim this, I am signing this object:

@lpaulmp
lpaulmp / slackpost.sh
Created October 18, 2017 17:21
slack post using webhook_url and username based on https://gist.github.com/dopiaza/6449505
#!/usr/bin/env bash
# Usage: slackpost "<webhook_url>" "<channel>" "<username>" "<message>"
# also (echo $RANDOM; echo $RANDOM) |slackpost "<channel>" "<username>"
# ------------
webhook_url=$1
if [[ $webhook_url == "" ]]
then
echo "No webhook_url specified"
@lpaulmp
lpaulmp / configuration.nix
Last active July 12, 2017 15:22
Nixos configuration Mackbook pro 2015
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
#-----
# BOOT
{
webserver =
{ config, pkgs, ... }:
{ deployment.targetEnv = "virtualbox";
deployment.virtualbox.headless = true;
deployment.virtualbox.memorySize = 512; # megabytes
};
}
{
A good commit message looks like this:
Header line: explaining the commit in one line
Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.
The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
@lpaulmp
lpaulmp / ansible-bootstrap-ubuntu-16.04.yml
Created October 21, 2016 22:09 — forked from gwillem/ansible-bootstrap-ubuntu-16.04.yml
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@lpaulmp
lpaulmp / shipitfile.js
Created July 19, 2016 22:44 — forked from jbraithwaite/shipitfile.js
Shipit deploy with Slack integration
var pack = require('./package.json');
var request = require('request');
var name = pack.name;
module.exports = function (shipit) {
require('shipit-deploy')(shipit);
var deployTo = '/var/www/FOLDER_TO_DEPLOY_TO';
var deployToCurrent = deployTo + '/current';
var slackWebhookURL = 'SLACK_HOOK_URL';
@lpaulmp
lpaulmp / openvpn.md
Last active September 17, 2015 20:36 — forked from seuros/openvpn.md

OpenVPN on Ubuntu

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/sample-keys/ /etc/openvpn/keys/

cd /etc/openvpn/keys/