Skip to content

Instantly share code, notes, and snippets.

View liamdawson's full-sized avatar

Liam Dawson liamdawson

View GitHub Profile

Keybase proof

I hereby claim:

  • I am liamdawson on github.
  • I am liamdawson (https://keybase.io/liamdawson) on keybase.
  • I have a public key ASDsemyfg_ZHyIFMe_vh8uRE9bJnfI0dBiqUKovyyOygpgo

To claim this, I am signing this object:

@liamdawson
liamdawson / postinstall.txt
Created January 7, 2018 14:37
openSUSE post-install on XPS
sudo zypper in -y pam_kwallet
sudo usermod -aG wheel liamdawson
sed -i 's/## Do not insult users when they enter an incorrect password.//g' /etc/sudoers
sed -i 's/Defaults !insults/Defaults insults/g' /etc/sudoers
sed -i 's/Defaults targetpw # ask for the password of the target user i.e. root/Defaults !targetpw # ask for the password of the current user/g' /etc/sudoers
sed -i 's/ALL ALL=(ALL) ALL # WARNING! Only use this together with .Defaults targetpw.!/#ALL ALL=(ALL) ALL # only secure if targetpw default is active/g' /etc/sudoers
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g' /etc/sudoers
rpmkeys --import https://keybase.io/docs/server_security/code_signing_key.asc
@liamdawson
liamdawson / AlwaysRunVS2017AsAdmin.reg
Last active January 18, 2018 20:35
Always Run Visual Studio 2017 as Administrator (64-bit)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE\\devenv.exe"="RUNASADMIN"
"C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe"="RUNASADMIN"
@liamdawson
liamdawson / gnome-ext-install.sh
Created February 8, 2018 00:52
Bash script to install extensions from the command line. *Use at your own risk!*
#!/bin/bash
set -e
set -u
version="0.0"
usage="$(basename $0) version $version
usage:
$(basename $0) install <extension-uuid> [<extension-id/uuid> ... ]
@liamdawson
liamdawson / typed-examples.tsx
Created July 27, 2018 02:48
Type usage examples for octicons-react
import React from 'react';
// all of the icons are auto-completeable in IDE imports
import Octicon, {Globe, getIconByName} from '@githubprimer/octicons-react';
import {storiesOf} from '@storybook/react';
storiesOf('Icon', module)
// won't compile, icon prop required
.add('Empty icon', () => <Octicon />)
// won't compile, string not assignable, needs to be Icon<x, y>, or a StatelessComponent
@liamdawson
liamdawson / icons.d.ts
Last active July 27, 2018 03:16
@githubprimer/octicons-react 8.0.0 typings
declare module "@githubprimer/octicons-react" {
import * as React from 'react'
type Icon<
W extends number = number,
H extends number = number
> = React.SFC<{}> & { size: [W, H] };
type Size = 'small' | 'medium' | 'large'
interface OcticonProps {
@liamdawson
liamdawson / token.sls
Last active February 7, 2020 19:32
Set a grain from an api call on a minion
#!py
# The following statefile uses Python to set a grain ('sample-token') to
# a value pulled from a HTTP call. The call will not be repeated if the
# grain is already set.
from salt.utils.http import query
import json
def run():
@liamdawson
liamdawson / README.md
Created October 5, 2020 22:29
Remap Capslock to Escape on Macos

Place the following file under ~/Library/LaunchAgents (e.g. ~/Library/LaunchAgents/com.ldaws.CapslockEsc.plist)

@liamdawson
liamdawson / 2.2.1-typo.patch
Created March 7, 2015 12:05
Fixes a typo in MRI Ruby 2.2.1 when installing via rbenv's ruby-build
--- tool/rbinstall.rb 2015-03-07 21:59:28.834830008 +1000
+++ tool/rbinstall.rb.patch 2015-03-07 21:59:43.202830008 +1000
@@ -711,7 +711,7 @@
install?(:ext, :comm, :gem) do
begin
require "zlib"
- rescue LoadErroe
+ rescue LoadError
end
if defined?(Zlib)
@liamdawson
liamdawson / Gemfile
Created July 27, 2021 02:09
Extract a CSV of manual RDS DB snapshots in an AWS account
# frozen_string_literal: true
source "https://rubygems.org"
gem "aws-sdk-rds"