Skip to content

Instantly share code, notes, and snippets.

@belminf
belminf / ingress-test.yaml
Last active July 2, 2019 17:57
Test ingress
---
kind: Pod
apiVersion: v1
metadata:
name: hello-world
labels:
app: hello-world
spec:
containers:
- name: echo
@belminf
belminf / .kitchen.yml
Last active October 27, 2018 22:59
Simple kitchen config for dokken (for reference)
---
driver:
name: dokken
privileged: true
chef_version: latest
transport:
name: dokken
verifier:
@belminf
belminf / cloudfront_distro.yaml
Created April 26, 2017 23:20
Example of an empty S3OriginConfig
AWSTemplateFormatVersion: 2010-09-09
Resources:
Bucket:
Type: 'AWS::S3::Bucket'
Properties:
AccessControl: PublicRead
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: error.html
Distro:
@belminf
belminf / bootstrap.sh
Last active November 2, 2016 12:50
EC2 user-data apache bootstrap
#!/bin/bash
yum update -y
yum install -y httpd jq
service httpd start
chkconfig httpd on
echo "<html><head><title>Test page</title></head><body><h1>From $(curl http://169.254.169.254/latest/dynamic/instance-identity/document 2> /dev/null | jq '.region' | sed 's/"//g' ): Hello world</h1></body></html>" > /var/www/html/index.html
@belminf
belminf / caesar_cipher.py
Last active July 22, 2016 23:57 — forked from tmessinis/caesar_cipher.py
An implementation of a simple caesar cipher
# This is an attempt at creating a caesar cipher using the ord()
# function and taking input from the user.
import re
def caesar_cipher(mode, input_str, key):
return_str = ''
char_as_num = None
num_as_char = None
char_after_cipher = None
@belminf
belminf / watch_apache_log.sh
Created May 19, 2016 20:03
Capture Apache debug
#!/bin/bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License <gnu.org/licenses/gpl.html> for more details.
@belminf
belminf / log_active_windows.ahk
Created April 21, 2016 19:48
AutoHotkey script to detect current window
LastTitle := ""
while true {
WinGetActiveTitle, Title
if (LastTitle != Title)
{
LastTitle := Title
FileAppend, %LastTitle%`n, %A_Desktop%\active_windows.txt
}
}
@belminf
belminf / test_https_timeout.py
Created March 28, 2016 21:53
Tests timeouts for HTTPS connections
#!/usr/bin/python
#
# Example run:
# time ./test_https_timeout.py example.com 200 10
import httplib
import sys
from time import sleep
@belminf
belminf / aws-cli.sh
Last active August 6, 2021 23:27
AWS CLI command to find latest RHEL and Ubuntu images using JMESPath
# Both are limited to HVM-based 64-bit AMIs backed by EBS
# Red Hat's latest GA images
alias ami_rhel="aws ec2 describe-images \
--filters \
'Name=root-device-type,Values=ebs' \
'Name=architecture,Values=x86_64' \
'Name=virtualization-type,Values=hvm' \
'Name=name,Values=*GA*' \
--owners 309956199498 \