Skip to content

Instantly share code, notes, and snippets.

View gene1wood's full-sized avatar
🎩

Gene Wood gene1wood

🎩
View GitHub Profile
@wilmoore
wilmoore / knife.rb
Created June 22, 2011 07:56
Base "knife" configuration for a standard chef-solo setup
# .chef/knife.rb
# SEE: http://wiki.opscode.com/display/chef/Troubleshooting+and+Technical+FAQ
# set some sensible defaults
current_dir = File.dirname(__FILE__)
user = ENV['OPSCODE_USER'] || ENV['USER']
log_level :debug
log_location STDOUT
node_name `hostname`
client_key ''
@casualjim
casualjim / recipe.rb
Created October 5, 2011 09:37 — forked from rberger/recipe.rb
S3 File Resource for Chef
# Source accepts the protocol region:// with the host as the bucket
# access_key_id and secret_access_key are just that
# for the eu-west-1 region:
s3_file "/var/bulk/the_file.tar.gz" do
source "s3-eu-west-1://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
@skylander86
skylander86 / lambda-ses-forwarder.py
Created January 4, 2017 18:10
Python port of arithmetric/aws-lambda-ses-forwarder. An AWS Lambda function for forwarding incoming emails through SES.
"""
This code is a Python 2.7 port of [aws-lambda-ses-forwarder](https://github.com/arithmetric/aws-lambda-ses-forwarder). Follow instructions there for setting up SES and AWS Lambda.
"""
from email import message_from_file
import json
import logging
import os
import re
@peplin
peplin / recipe.rb
Created July 10, 2010 01:30
S3 File Resource for Chef
# Source accepts the protocol s3:// with the host as the bucket
# access_key_id and secret_access_key are just that
s3_file "/var/bulk/the_file.tar.gz" do
source "s3://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
mode 0644
end
@bguiz
bguiz / dont-lose-gnome-terminal-sessions-on-reboot.md
Last active February 11, 2023 22:04
Ensures that you don't lose your gnome-terminal windows when you crash/ reboot Linux

Usage

  • create and alias/ symlink for the file, I use 'watcher.sh' in my home directory
  • when you fire up a gnome-terminal
    • enter ~/watcher.sh and leave that tab running in the background
  • when you crash and reboot, and fire up a gnome-terminal
    • enter ~/watcher.sh restore to restore all your windows and tabs that you previously had open, and it will cotninue watching automatically after that is done

Problem that it solves

@pessom
pessom / quick_punycode_encode_decode_example.py
Created March 2, 2018 15:43 — forked from floer32/quick_punycode_encode_decode_example.py
quick example of encoding and decoding a international domain name in Python (from Unicode to Punycode or IDNA codecs and back). Pay attention to the Unicode versus byte strings
# INCORRECT! DON'T DO THIS!
>>> x = "www.Alliancefrançaise.nu" # This is the problematic line. Forgot to make this a Unicode string.
>>> print x
www.Alliancefrançaise.nu
>>> x.encode('punycode')
'www.Alliancefranaise.nu-h1a31e'
>>> x.encode('punycode').decode('punycode')
u'www.Alliancefran\xc3\xa7aise.nu'
>>> print x.encode('punycode').decode('punycode')
www.Alliancefrançaise.nu
@alexcasalboni
alexcasalboni / aws-lambda-static-type-checker.md
Last active May 22, 2023 07:31
AWS Lambda Static Type Checker Example (Python3)

How to use Python3 Type Hints in AWS Lambda

TL;DR

Static Type Checkers help you find simple (but subtle) bugs in your Python code. Check out lambda_types.py and incrementally improve your code base and development/debugging experience with type hints.

Your Lambda Function code will go from this:

@Luzifer
Luzifer / README.md
Last active November 18, 2023 17:22
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@NiklasGollenstede
NiklasGollenstede / !autossh-service.md
Last active November 26, 2023 03:57
Automatic, persistent, and secure SSH port forwarding between hosts

This is a comprehensive and automated guide to set up automatic, persistent, and secure SSH port forwarding between hosts.

Please read the content for more information.