Skip to content

Instantly share code, notes, and snippets.

@thedouglenz
thedouglenz / lightsail-docker.sh
Created June 28, 2020 22:48 — forked from Jeiwan/lightsail-docker.sh
Auto-Install Docker and Docker Compose on AWS Lightsail
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install -y docker-engine
sudo curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo groupadd docker
@thedouglenz
thedouglenz / App.js
Created November 11, 2019 20:59 — forked from YajJackson/App.js
React Context Demo
import React, { useState, useEffect, useContext } from 'react'
import { UserContext } from './Context'
import './App.css'
const Login = ({ onLogin, ...props }) => {
const [name, setName] = useState('')
const [pass, setPass] = useState('')
return (
<form onSubmit={() => onLogin({ name, pass })}>
<input
@thedouglenz
thedouglenz / .tmux.conf
Created October 1, 2018 17:34
.tmux.conf
# Change prefix key from CTRL-B (default) to CTRL-A
unbind C-b
set -g prefix C-a
# Quickly reload tmux configuration
bind r source-file ~/.tmux.conf
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
@thedouglenz
thedouglenz / apmdownloads.sh
Created July 25, 2015 15:41
Atom package manager downloads monitor shell program
#!/bin/bash
#
# A shell program to monitor the number of downloads
# of solarized-seti-ui
#
# Usage: apmdownloads.sh <package-name>
# Douglas Lenz, 2015
#
# First line; will be replaced
@thedouglenz
thedouglenz / wiki.php
Last active August 29, 2015 14:18
Wikipedia information from the command line
#!/usr/bin/env php
<?php
/*
* A program to grab a quick summary of some topic from Wikipedia.
* Usage: wiki <subject>
*
* subject can contain spaces if, for example, it is more than one word.
* Examples
* `wiki cherry bomb`
* `wiki Hercules`
@thedouglenz
thedouglenz / linkedlist
Last active August 29, 2015 14:17
Working with linked lists in C
/*
*
* A program that takes a list of numbers as arguments
* and turns them into the payload for a set of nodes
* that become a linked list, linked in the order
* the numbers are given to the program.
*
* Douglas Lenz, 2015
*
*/