Skip to content

Instantly share code, notes, and snippets.

Sam Kottler skottler

Block or report user

Report or block skottler

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
View netboot.xyz-edgerouter.md

Setting up netboot.xyz with an EdgeRouter

This document covers how to setup netboot.xyz, a service that provides iPXE-based installation and live boot of a bunch of operating systems, on a Ubiquiti EdgeRouter.

Assumptions

I've made a few assumptions throughout this document that will probably be different for your setup:

View block_device_trim.rb
Ohai.plugin(:Trim) do
# This ohai plugin provides data about TRIM support on each underlying block
# device available on the system. Its functionality is rather simple - it
# iterates over each physical device, ignoring partitions, and then runs
# hdparm to find the drives' capabilities, finally grepping for TRIM support.
provides "block_device/trim"
depends "block_device"
collect_data(:default) do
View patch-it.md

Before:

samkottler@ubuntu:~$ cat /proc/meminfo
MemTotal:        2042728 kB
MemFree:          599932 kB
Buffers:           33268 kB
Cached:          1240816 kB
SwapCached:         3396 kB
Active:          1051100 kB
View bash_spec.rb
require 'spec_helper'
describe command("env x='() { :;}; echo vulnerable' bash -c 'echo this is a test'") do
its(:exit_status) { is_expected.to eq 0 }
its(:stdout) { is_expected.not_to match(/vulnerable/) }
end
View sshd.md

I'm gonna forgot how to fix this next time I come across it, so using this gist to document the issue. This occurs on Debian 7.5 with the following package installed from testing: openssh-server 1:6.6p1-5, which was pulled in through the ssh metapackage.

Could not load host key: /etc/ssh/ssh_host_ed25519_key

Apparently this is a bug in the debian packaging. Luckily there's a pretty great command for fixing it: ssh-keygen -A, which will generate any missing keys. If you're running with a VM make sure you've got enough available entropy to generate those aforementioned keys. If you don't want to run the creation command for all the missing keys, then you can just run this instead: /usr/bin/ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''.

View keybase.md

Keybase proof

I hereby claim:

  • I am skottler on github.
  • I am shk (https://keybase.io/shk) on keybase.
  • I have a public key whose fingerprint is 76EE 0F0F FF19 5505 81F3 0E2F 499C 8210 826E 8956

To claim this, I am signing this object:

View gist:5061909
samkottler@ip-10-253-6-159:/etc/logrotate.d$ sudo dpkg -S nginx
nginx: /etc/nginx/scgi_params
nginx: /etc/nginx/conf.d/example_ssl.conf
nginx: /etc/nginx/nginx.conf
nginx: /etc/nginx/win-utf
nginx: /opt/nginx/sbin/nginx
nginx: /opt/nginx/html/50x.html
nginx: /etc/nginx/mime.types
nginx: /opt/nginx/conf/uwsgi_params
nginx: /opt/nginx/sbin/nginx.old
View gist:4679026
#rubygems Central conversation
#rubygems-status: The content of the status site
#rubygems-verification: Checking MD5's against S3
View gist:4355186
timeout=5
menuentry "Fedora 18" {
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
insmod lvm
set root='hd0,gpt5'
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 --hint='hd0,gpt5' 4d293507-3ec0-410a-9606-bcbcfe44d7dd
echo 'Loading vmlinuz...'
You can’t perform that action at this time.