Skip to content

Instantly share code, notes, and snippets.

View schmich's full-sized avatar
:octocat:
May all beings be at ease

Chris Schmich schmich

:octocat:
May all beings be at ease
View GitHub Profile
curl -vvv -X PATCH --data "{\"votes\":[1]}" --header "Content-Type: application/json" "http://litepoll.com/polls/ID"
@schmich
schmich / .gitconfig
Last active June 20, 2017 19:27
git diff with gvim on Windows
[core]
excludesfile = ~/.gitignore_global
editor = gvim
autocrlf = false
safecrlf = false
[user]
email = [email protected]
name = Chris Schmich
[push]
default = current
@schmich
schmich / dw.snippet
Last active July 8, 2022 11:34
Visual Studio snippet to insert Debug.WriteLine with dw
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>dw</Title>
<Shortcut>dw</Shortcut>
<Description>Code snippet for Debug.WriteLine</Description>
<Author>Chris Schmich</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
[core]
excludesfile = ~/.gitignore_global
editor = mvim --nofork
[user]
email = [email protected]
name = Chris Schmich
[push]
default = current
[alias]
br = branch --list -vv
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', '1');
require 'pp'
require 'set'
winner = [Set.new([4, 8, 19, 27, 34]), 10]
tickets = File.open('numbers.txt').readlines.map { |line|
numbers = line.scan(/\d+/).map { |n| n.to_i }
[Set.new(numbers.take(5)), numbers[numbers.length - 1]]
}.to_a
@schmich
schmich / release.md
Created February 6, 2016 00:04
Releasing versions
  • Bump version in source file
  • git commit --allow-empty -m "vX.Y.Z"
  • git tag --sign vX.Y.Z -m "vX.Y.Z"
  • git push &amp;&amp; git push --tags
@schmich
schmich / dev-setup.sh
Last active March 11, 2016 09:59
Multi-user git webserver deployment
sudo echo 192.168.1.42 webserver >> /etc/hosts
sudo cat >> ~/.ssh/config <<EOF
Host webserver 192.168.1.42
User user1
Hostname webserver
IdentityFile ~/.ssh/id_rsa
EOF
cat ~/.ssh/id_rsa.pub | (ssh user@webserver "mkdir -p .ssh && cat >> ~/.ssh/authorized_keys")
git init project
cd project

Keybase proof

I hereby claim:

  • I am schmich on github.
  • I am schmich (https://keybase.io/schmich) on keybase.
  • I have a public key whose fingerprint is 6A81 AFFA A3E3 63E9 E308 5E5E 0C7C 2CE3 2BB3 2877

To claim this, I am signing this object:

  • Create an 8192-bit SSH-2 RSA key
ssh-keygen -t rsa -b 8192 -f id_rsa -C "[email protected]"
chmod 400 id_rsa*
mv -i id_rsa* ~/.ssh
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  • Disallow password-based login
    • Edit /etc/ssh/sshd_config
  • Add PasswordAuthentication no