Skip to content

Instantly share code, notes, and snippets.

View iamjohnnym's full-sized avatar
🤘
clicky klack klack clicky

Johnny M iamjohnnym

🤘
clicky klack klack clicky
View GitHub Profile
import pulumi
import pulumi_aws
from localstack_endpoints import localstack_endpoints as endpoints
aws = pulumi_aws.Provider(
'localstack',
skip_credentials_validation=True,
skip_metadata_api_check=True,
s3_force_path_style=True,
access_key="mockAccessKey",
def split_numbers(numbers):
split_size = int(len(numbers) / 2)
list_a = numbers[:split_size]
list_b = numbers[split_size:]
return list_a, list_b
def find_matching_sum(match, numbers):
list_a, list_b = split_numbers(numbers)
for x in list_a:
@iamjohnnym
iamjohnnym / iterm2.md
Created December 3, 2019 20:37 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@iamjohnnym
iamjohnnym / keybase.md
Created September 2, 2019 21:50
Keybase proof of identity

Keybase proof

I hereby claim:

  • I am iamjohnnym on github.
  • I am iamjohnnym (https://keybase.io/iamjohnnym) on keybase.
  • I have a public key ASARAMuMe3ReDC4AoogsWggh6CT1qbIdQ8VPvfxyHBcytQo

To claim this, I am signing this object:

#! /bin/bash
## ./curl_resume.sh https://example.com
export done=1;
while [ $done -gt 0 ]; do
/usr/bin/curl -O -C - $1;
export done=$?;
done
- name: install rvm
raw: curl -L https://get.rvm.io | bash -s stable
tags:
- install
- name: source scripts
raw: . ~/.bashrc
tags:
- install
I'm looking to point load the passenger library from my local users home directory:
/home/rails/.rvm/gems/gems/passenger-4.0.57
In my applications virtualhost, I have this block:
<IfModule mod_passenger.c>
PassengerRoot /home/rails/.rvm/gems/gems/passenger-4.0.57
PassengerDefaultRuby /home/rails/.rvm/gems/ruby-2.1.0/wrappers/ruby
</IfModule>
When trying to execute this, I keep running into rack not found:
$ gem install rack
Successfully installed rack-1.6.0
1 gem installed
$ stat ~/.rvm/gems/gems/rack-1.6.0/
File: ‘/home/rails/.rvm/gems/gems/rack-1.6.0/’
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 801h/2049d Inode: 659676 Links: 7
# LAMP Deployment Vars
# group_vars/all
playbook: {
'php5': {
'apache': "apache2",
'packages': [
"libapache2-mod-php5",
"php5-cli",
- name: Setup default firewall rules
command: "/sbin/iptables -I INPUT 1 -p tcp -m tcp -m comment --comment '{{item.type}}' --dport {{item.port}} -j ACCEPT"
with_items:
- {'type':'SSH', 'port':22}
- {'type':'HTTP', 'port':80}
- {'type':'HTTPS', 'port':443}
when: ansible_os_family == 'RedHat'
- name: Setup default firewall rules
command: ufw allow {{item}}
with_items: