Skip to content

Instantly share code, notes, and snippets.

View tazjin's full-sized avatar
🥝
computers

tazjin

🥝
computers
View GitHub Profile
@tazjin
tazjin / t440s-brightness.conf
Created February 8, 2014 19:32
systemd fix for Thinkpad T440s brightness controls
# Fixes the Thinkpad brightness control buttons
w /sys/module/video/parameters/brightness_switch_enabled - - - - N
@tazjin
tazjin / powertop.service
Created February 8, 2014 19:40
Systemd service for powertop auto tune
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/powertop --auto-tune
#"powertop --auto-tune" still needs a terminal for some reason.
#Possibly a bug?
Environment="TERM=xterm"
@tazjin
tazjin / gist:9483800
Created March 11, 2014 11:15
SSH public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJkwAYZqTUuigsNgRMk7bORfbNlS2+YCAmQd5NYvpVAkVpuhjGmOHn45ouq74JjpMeHQlp5+RpMn73KdkZ79LTiRPe0OS97JuYIZIhVxrR2tpsGRTcapaqOzFvdanynEodVPMTur6+MHSohL5ivn3Q6qzFqccZVasvQ+Jyoe4ULk+Pc9R6kk7VR4EHeJHk3qtBnF16p33t6/SDTxiIqLHBljMQj3K9a5unSWXvv/4PGQaFW4Yovv8SPX5LufSvjJQq3/gF6x6kQpI6pNm6+uo7ks9CI6gbYsan5znkdQZR/VwTpvvFdoq2ZZSgDz6kYJWS6xshAmPHbC8hBc3GATOx vincent@spotify.com
@tazjin
tazjin / keybase.md
Created April 16, 2014 10:39
keybase.md

Keybase proof

I hereby claim:

  • I am tazjin on github.
  • I am tazjin (https://keybase.io/tazjin) on keybase.
  • I have a public key whose fingerprint is DCF3 4CFA C1AC 44B8 7E26 3331 36EE 3481 4F6D 294A

To claim this, I am signing this object:

@tazjin
tazjin / Algorithm1.hs
Last active August 29, 2015 14:01
Fun
module Algorithm1 where
import Countries
import Data.List
import System.Random
-- Get random country, weighing the population more
getCountry :: StdGen -> [Country] -> Country
getCountry gen unsorted = helper gen countries
where
@tazjin
tazjin / Main.hs
Created June 28, 2014 14:18
Passwords without whitespace!
{-# LANGUAGE OverloadedStrings #-}
import Crypto.BCrypt
import Control.Monad.IO.Class
import Data.Text.Lazy
import qualified Data.Text.Encoding as TE
import Data.Maybe (fromJust) -- oh yeah
import Data.Monoid (mconcat)
import Web.Scotty
List of X.509 CA Certificates:
subject: "C=US, O=DigiCert Inc, CN=DigiCert SHA2 Secure Server CA"
issuer: "C=US, O=DigiCert Inc, OU=www.digicert.com, CN=DigiCert Global Root CA"
serial: 01:fd:a3:eb:6e:ca:75:c8:88:43:8b:72:4b:cf:bc:91
validity: not before Mar 08 13:00:00 2013, ok
not after Mar 08 13:00:00 2023, ok
pubkey: RSA 2048 bits
keyid: 51:bc:4f:77:17:08:cf:e5:09:dd:e9:ea:a5:54:8e:91:c0:67:78:53
@tazjin
tazjin / gist:d5a6c0f7980abaae684c
Created August 22, 2014 13:35
Migration thing
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Main where
- name: Install cloudconfig
template: src=cloud_config.j2 dest=/media/root/var/lib/coreos-install/user_data
tags: cloudconfig
- name: Run coreos-cloudinit
raw: coreos-cloudinit --from-file=/var/lib/coreos-install/user_data
tags: cloudconfig
#!/bin/bash
if [[ -z "$1" ]]; then
echo "Usage: denter <container-name>";
echo "Might require super-user privileges";
exit 1;
fi
DOCKER_PID=$(docker inspect --format "{{ .State.Pid }}" $1)