Skip to content

Instantly share code, notes, and snippets.

View tamsky's full-sized avatar

Marc Tamsky tamsky

View GitHub Profile
# http://www.tomsguide.com/answers/id-1797072/driving-2560x1440-monitor-hdmi-equipped-laptop.html#13279006
#/bin/sh
xrandr --newmode "2560x1440_41.00" 163.711 2560 2608 2640 2720 1440 1443 1448 1468 -hsync -vsync
xrandr --addmode HDMI1 "2560x1440_41.00"
xrandr --output HDMI1 --mode "2560x1440_41.00"
xrandr --output eDP1 --mode "1920x1080"
xrandr --output HDMI1 --left-of eDP1
That sets the resolution at startup. I'm sure there are some Windows-tools that can do the same for Windows users
@tamsky
tamsky / dd.log
Created January 15, 2016 06:20 — forked from ktheory/dd.log
EC2 EBS-SSD vs instance-store performance on an EBS-optimized m3.2xlarge
# /tmp/test = EBS-SSD
# /mnt/test = instance-store
root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test
256+0 records in
256+0 records out
268435456 bytes (268 MB) copied, 3.26957 s, 82.1 MB/s
root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test
256+0 records in
256+0 records out
#!/bin/bash
# Required binaries: jq, date, curl, sed
# Prometheus text file format is described here:
# http://prometheus.io/docs/instrumenting/exposition_formats/
# Returns epoch + made up milliseconds timestamp
get_timestamp() {
date "+%s000"
}
@tamsky
tamsky / packer-config
Last active November 30, 2018 20:16 — forked from jjongsma/packer-config
Process YAML and write Packer JSON to STDOUT
#!/usr/bin/env python2
#
# Usage: packer-config my-template.yaml | packer build -
#
# Constructs a Packer JSON configuration file from the specified YAML
# template file and writes it to STDOUT.
#
# The YAML template format adds some flexibility and readability by
# adding comments and an !include directive, allowing for the
# following template syntax:
@tamsky
tamsky / cloudwatch-spot-price-metrics.sh
Created April 10, 2016 02:23 — forked from muhqu/cloudwatch-spot-price-metrics.sh
Shell Script to bring EC2 SpotInstance Prices to CloudWatch.
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2013 Mathias Leppich <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@tamsky
tamsky / raw term output
Created July 5, 2016 01:18
incompatibility bug with OpenSSH-6.9p1 generated keys and Chrome Secure Shell hterm/ssh extension
debug1: Connection established.
debug1: identity file /.ssh/demonstration-key type 1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.7
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.7 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] [email protected]
debug1: kex: client->server aes128-ctr [email protected] [email protected]

See what certificate a site is presenting

openssl s_client -showcerts -connect example.com:443

Disable verification

openssl s_client -verify 0 -showcerts -connect example.com:443

force TLS version

openssl s_client -tls1 -showcerts -connect example.com:443

Examine a local certificate

openssl x509 -noout -in example.com.crt -text | less

Examine a local key

openssl rsa -in example.com.key -noout -text

@tamsky
tamsky / Makefile
Created November 15, 2016 17:58 — forked from pgporada/Makefile
Terraform Makefile
.ONESHELL:
.PHONEY: help set-env init update plan plan-destroy show graph apply output taint
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
set-env:
@if [ -z $(ENVIRONMENT) ]; then\
echo "ENVIRONMENT was not set"; exit 10;\
fi
Example errors for https://github.com/Capgemini/kubeform/pull/170
# pwd
/Users/username/src/github/kubeform/terraform/aws/public-cloud
# terraform plan -out saved-plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but
will not be persisted to local or remote state storage.