Skip to content

Instantly share code, notes, and snippets.

View kylescottmcgill's full-sized avatar

Kyle Mcgill kylescottmcgill

View GitHub Profile
server {
listen 80 default_server;
server_name _;
location / {
return 301 https://$host$request_uri;
}
}
@kylescottmcgill
kylescottmcgill / linux.sh
Created January 16, 2017 09:40 — forked from marcan/linux.sh
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name

Keybase proof

I hereby claim:

  • I am kylescottmcgill on github.
  • I am kylescottmcgill (https://keybase.io/kylescottmcgill) on keybase.
  • I have a public key ASAEw-rDzstQ3nabeKw_sXnDmhelBP3theJ7yeLgRUcuTAo

To claim this, I am signing this object:

ubuntu@cluster-us:~$ date
Wed Mar 23 01:28:34 UTC 2016
ubuntu@cluster-us:~$ sudo ntpdate -s time.nist.gov
sudo: unable to resolve host cluster-us
ubuntu@cluster-us:~$ date
Wed Mar 23 01:28:37 UTC 2016
ubuntu@cluster-us:~$
#!/bin/bash
function yap_yank {
focused=$(xdotool getwindowfocus getwindowname)
if [[$focused == "termite"]];
then
xdotool key ctrl+shift+c
else
xdotool key ctrl+c
fi
exit
@kylescottmcgill
kylescottmcgill / app.rb
Created June 25, 2013 03:06
URL Shorty
require "sinatra/base"
require "sinatra/contrib/all"
require "redis"
require "slim"
class App < Sinatra::Base
register Sinatra::Contrib
redis = Redis.new
helpers do
include Rack::Utils