Skip to content

Instantly share code, notes, and snippets.

View mburns's full-sized avatar

Michael Burns mburns

View GitHub Profile
@Josh-Tucker
Josh-Tucker / feeds.opml
Last active July 7, 2023 15:14
HN User Blogroll OPML
<?xml version='1.0' encoding='utf-8'?>
<opml version="1.0">
<head />
<body>
<outline text="https://xeiaso.net" type="rss" xmlUrl="https://xeiaso.net/blog.rss" />
<outline text="https://fasterthanli.me/" type="rss"
xmlUrl="https://fasterthanli.me/index.xml" />
<outline text="https://matt-rickard.com" type="rss" xmlUrl="/rss/" />
<outline text="https://jmmv.dev/" type="rss" xmlUrl="/feed.xml" />
<outline text="https://paulstamatiou.com" type="rss"
@twratl
twratl / AWS SES Email Parser in Lambda
Last active November 14, 2023 14:54
Sample Python Lambda code for parsing emails delivered to S3 buckets via SES and then Lambda invocation from SES - untested
# content provided as part of thread here: https://www.reddit.com/r/aws/comments/cffmxr/how_do_you_strip_the_attachments_from_aws_sessns/
from email.parser import BytesParser
from email import policy
import os
# event will be JSON from SES incoming email rule - NOT an S3 PUT event
def lambda_handler(event, context):
try:
ses_mail = event['Records'][0]['ses']['mail']
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@htp
htp / curl-websocket.sh
Last active May 14, 2024 21:24
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@maoueh
maoueh / test-cloud-init-run.sh
Created June 2, 2016 14:28
Small script to test changes made to cloud init config without rebooting
rm -rf /var/lib/cloud/instance && rm -rf /var/lib/cloud/instances/* && rm -rf /var/lib/cloud/sem/*
cloud-init init && cloud-init modules --mode config && cloud-init modules --mode final
@dragonjet
dragonjet / 1-server.md
Last active July 31, 2021 21:01
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
@jeffbyrnes
jeffbyrnes / .kitchen.yml
Created September 24, 2014 18:01
Travis CI + Test Kitchen
language: ruby
rvm:
- 1.9.3
before_install:
- openssl aes-256-cbc -K $encrypted_755628117be5_key -iv $encrypted_755628117be5_iv
-in travis_ci_ec2.pem.enc -out ~/.ssh/travis_ci_ec2.pem -d
- chmod 600 ~/.ssh/travis_ci_ec2.pem
install:
- bundle install --without vagrant
- bundle exec berks install
@igor47
igor47 / chef_to_hash.rb
Created July 15, 2013 02:01
a recursive to_hash for chef 11; also handles arrays inside the hash.
class Chef
class Node
class ImmutableMash
def to_hash
h = {}
self.each do |k,v|
if v.respond_to?('to_hash')
h[k] = v.to_hash
elsif v.respond_to?('each')
h[k] = []
@johnkary
johnkary / vagrant-nfs-vpn-solution.md
Last active April 8, 2020 10:30
Workaround for using an NFS mount with Vagrant and VirtualBox while connecting to a VPN network restricting local network connections

Fixing NFS disconnecting with Vagrant and VirtualBox on Mac OS

Symptoms and Known Conditions

  • Mac OS host machine (10.6+)
  • VirtualBox (4.1+)
  • Vagrant (1.0+)
  • Connecting via VPN to a remote network
  • Mounting a directory from your host machine to the guest machine using NFS with something like this:
@halcyonCorsair
halcyonCorsair / Vagrantfile
Created September 5, 2012 21:10
A json file for chef-solo, and the equivalent Vagrantfile to setup koha
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"