Skip to content

Instantly share code, notes, and snippets.

View kyl191's full-sized avatar

Kyle Lexmond kyl191

View GitHub Profile
@kyl191
kyl191 / ec2.tf
Created June 29, 2020 06:02
minimal fedora ec2 instance with IPv6 support + no magic constants
resource "aws_key_pair" "ansible_key" {
key_name = "ansible_key"
public_key = file("id_rsa.pub")
}
data "aws_ami" "fedora_cloud" {
owners = [125523088429] # fedora infra
most_recent = true
filter {
data.aws_ebs_default_kms_key.current: Refreshing state...
2020-06-21T18:06:20.295-0700 [DEBUG] plugin.terraform-provider-aws_v2.67.0_x4:
2020/06/21 18:06:20 [DEBUG] [aws-sdk-go] DEBUG: Request ec2/GetEbsDefaultKmsKeyId Details:
2020-06-21T18:06:20.295-0700 [DEBUG] plugin.terraform-provider-aws_v2.67.0_x4: ---[ REQUEST POST-SIGN ]-----------------------------
2020-06-21T18:06:20.295-0700 [DEBUG] plugin.terraform-provider-aws_v2.67.0_x4: POST / HTTP/1.1
2020-06-21T18:06:20.295-0700 [DEBUG] plugin.terraform-provider-aws_v2.67.0_x4: Host: ec2.us-west-2.amazonaws.com
2020-06-21T18:06:20.295-0700 [DEBUG] plugin.terraform-provider-aws_v2.67.0_x4: User-Agent: aws-sdk-go/1.32.3 (go1.13.7; linux; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.12.26 (+https://www.terraform.io)
2020-06-21T18:06:20.295-0700 [DEBUG] plugin.terraform-provider-aws_v2.67.0_x4: Content-Length: 47
2020-06-21T18:06:20.295-0700 [DEBUG] pl
@kyl191
kyl191 / css.patch
Created June 24, 2018 01:31
CSS patch to align 138px thumbnails on Zenphoto
--- dark.css.ori 2018-06-24 00:55:25.001595046 +0000
+++ dark.css 2018-06-24 01:30:02.656363668 +0000
@@ -237,7 +237,7 @@
------------------------------ */
#images {
float: left;
- width: 650px;
+ width: 685px;
border: 0px solid gray;
}
@kyl191
kyl191 / google-cloud.repo
Created June 16, 2018 20:26
Hardcoded Google Cloud repo for Fedora
[google-cloud-compute]
name=Google Cloud Compute
baseurl=https://packages.cloud.google.com/yum/repos/google-cloud-compute-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
@kyl191
kyl191 / pub.sh
Last active June 16, 2018 20:26
Fedora on GCE
#!/bin/bash
set -e
# Get the image - Image must be names disk.raw
curl -L https://download.fedoraproject.org/pub/fedora/linux/releases/28/Cloud/x86_64/images/Fedora-Cloud-Base-28-1.1.x86_64.raw.xz | xz --decompress > disk.raw
# Create the temp bucket to hold the file
export BUCKET=$(cat /dev/urandom| tr -dc 'a-z0-9' | fold -w 32 | head -n 1)
gsutil mb gs://${BUCKET}
# tar & compress the file and upload it
export TARFILE=Fedora-Cloud-Base-28.tar.gz
tar -Sczf ${TARFILE} disk.raw && gsutil mv ${TARFILE} gs://${BUCKET}
@kyl191
kyl191 / do-not-run-me.txt
Created June 11, 2018 02:24
ZenGallery password reset
# connect to db using mysql
$ mysql
MariaDB [(none)]> use zen_gallery_db;
MariaDB [zen_gallery_db]> select value from zp_options where name = 'extra_auth_hash_text';
(keep this value!)
# separate python process
import hashlib
hashlib.sha1('{username}{password}{value_from_above}'.encode('utf-8')).hexdigest()
@kyl191
kyl191 / gist:f5d9177cfe4f0635eafcb4a6a3947dba
Created March 26, 2017 18:23
Minimal CF template which creates a lambda fn & associates with a bucket, but fails
---
AWSTemplateFormatVersion: 2010-09-09
Description: Calligre Lambda CF Stack
Resources:
ImagePendingResizeBucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: Private
NotificationConfiguration:
LambdaConfigurations:
- - include:
- domain: org.apache.cassandra.metrics
- type: ClientRequest
- attribute:
- Count:
- #metric_type: counter
- metric_type: gauge
- alias: cassandra.metrics.client_request.count
- 50thPercentile:
- metric_type: gauge
@kyl191
kyl191 / vhost.conf
Created April 25, 2015 12:49
nginx/php
server {
listen 80;
listen [::]:80;
server_name {{item.key}};
root /var/www/{{item.key}};
index index.html index.htm index.php;
@kyl191
kyl191 / nginx.spec
Last active August 29, 2015 14:17
Nginx-mainline spec file for Fedora <=21 & CentOS 6
%global _hardened_build 1
%global nginx_user nginx
%global nginx_group %{nginx_user}
%global nginx_home %{_localstatedir}/lib/nginx
%global nginx_home_tmp %{nginx_home}/tmp
%global nginx_confdir %{_sysconfdir}/nginx
%global nginx_datadir %{_datadir}/nginx
%global nginx_logdir %{_localstatedir}/log/nginx
%global nginx_webroot %{nginx_datadir}/html