Skip to content

Instantly share code, notes, and snippets.

Jay Pfaffman pfaffman

Block or report user

Report or block pfaffman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pfaffman
pfaffman / passwordless-ssh.md
Last active Jan 12, 2018 — forked from willemo/passwordless-ssh.md
Passwordless SSH/SFTP access to a server
View passwordless-ssh.md

Passwordless SSH/SFTP for dummies

To get SSH or SFTP access to a server without using a password you need to have a SSH key pair for each computer you want to be able to access the server from. In this document I’ll describe the steps you need to take to generate a key pair if you don’t have one already. If you do, you can use your public key(s) to get access to the server.

I'll also explain how to connect to your server using Cyberduck. Click here to skip to that part.

Disclaimer and stuff

This guide is written with newbies in mind, so I'm very thorough in describing the steps that you must take. This guide will not cover setting up the server side of this system. It assumes that there's a server running with SSH enabled.

View gist:03cc573060fe155e7a8114751e374846
", "pry-nav", "byebug", "lru_redux", "flamegraph", "rack-mini-profiler", "kgio", "raindrops", "unicorn", "puma", "trollop", "rbtrace", "gc_tracer", "guess_html_encoding", "ruby-readability", "simple-rss", "stackprof", "memory_profiler", "rmmseg-cpp", "logster", "sass", "sassc"]
HTTP GET https://index.rubygems.org/info/rake
HTTP GET https://index.rubygems.org/info/msgpack
HTTP GET https://index.rubygems.org/info/bootsnap
HTTP GET https://index.rubygems.org/info/i18n
HTTP GET https://index.rubygems.org/info/minitest
HTTP GET https://index.rubygems.org/info/thread_safe
HTTP GET https://index.rubygems.org/info/tzinfo
HTTP GET https://index.rubygems.org/info/activesupport
HTTP GET https://index.rubygems.org/info/builder
@pfaffman
pfaffman / resize-lxd-disk-space.sh
Last active Aug 12, 2018 — forked from mifix/resize.sh
LXD - ZFS - resize
View resize-lxd-disk-space.sh
#!/usr/bin/env bash
# make sure zfs autoexpand is enabled (only needed once)
sudo zpool set autoexpand=on lxd
sudo truncate -s 20G /var/lib/lxd/zfs.img
# Make zfs realize the fact that partition has been changed and make zpool
# use the new partition which is actually the same one
sudo zpool online -e lxd /var/lib/lxd/zfs.img /var/lib/lxd/zfs.img
View keybase.md

Keybase proof

I hereby claim:

  • I am pfaffman on github.
  • I am pfaffman (https://keybase.io/pfaffman) on keybase.
  • I have a public key whose fingerprint is 7C05 5E30 3D57 A003 8F49 9653 6064 BA90 4BC8 EFB8

To claim this, I am signing this object:

View mac-and-cheese.md

People love macaroni and cheese. As is often the case, my evidence for this belief is the amount of shelf-space devoted to this product. Everyone makes it. Kraft, low-budget knock-offs, high-end organic varieties. There's the classic packet-o-powder version and a handful of ones that have cheese sauce in a can or pouch. But if you want to bring people mac and cheese happiness (at least people over the age of, say, six). I'm concerned that a new generation of humans is going to grow up thinking that proper mac and cheese comes only from a box and is made with margarine, skim milk, and a packet of yellow stuff that contains powdered "cheese food."

Real live baked macaroni, the kind that you make in the oven, is not difficult, expensive, or time-consuming to make. This fall I hosted a party for what ended up being about 40 people. It was a long drop-in-when-you-can party, and at some point my mother, who was in attendance, became concerned that we were going to run out of Mac and Cheese. I had made a h

View INSTALL-godaddy.md

Set up Discourse on GoDaddy in under 30 minutes with zero knowledge of Rails or Linux shell using our [Discourse Docker image][dd]. We recommend [DigitalOcean][do], but these steps have been modified to describe setting up a [GoDaddy][gd] cloud image and prepare it for using the [standard install guide][install].

Create New Cloud Server

[Sign up for a GoDaddy Cloud server][gd], update billing info, then create your new server.

  • The hostname you choose does not matter. In the next section you will assign your domain name to this server.

  • Choose a username and password (or SSH key if you have one)

View getdata.sh
#!/bin/bash
# Get data from connected server identified by the current WIFI SSID
if [ -f /sbin/iwconfig ]
then
# it's ubuntu (or, maybe debian)
HOST=`iwconfig wlan0 | grep ESSID | sed 's/.*ESSID:\"\(.*\)\"/\1/'`
else
# oops.
echo Mac solution is not implemented
# networksetup -getairportnetwork en1 | awk -F": " '{print $2}'
View install_bogus_nameserver.sh
#!/bin/bash
# install stuff needed to be a server and wifi hotspot
# Make any stanford.edu address resolve to 10.10.10.1
# Jay Pfaffman <pfaffmman@relaxpc.com>
# This should be used on a stand-alone network where access to the
# actual server is unavailable.
if [ ! -f /etc/init.d/bind9 ]
then
sudo apt-get -y --force-yes install bind9
View install_wifi_access_point.sh
#!/bin/bash
### Setup a wifi Access Point for Fall 2013 critter corral study
# based on from https://gist.github.com/dashohoxha/5767262/
# unlike the above script, this configures hotspot to run at boot
### make sure that this script is executed as root
if [ $(whoami) != 'root' ]
then
echo "
This script should be executed as root or with sudo:
sudo $0
View fixnames
#!/usr/bin/env bash
# fixnames
# Jay Pfaffman <jay@pfaffman.com>
# Available from https://gist.github.com/pfaffman/8644399
if [ $# -lt 1 ]
then
echo "Usage " $0 files
echo " Replaces names (or any words) in files passed on the command line."
echo " Edit below to change what names get replaced."
exit
You can’t perform that action at this time.