Skip to content

Instantly share code, notes, and snippets.

mime_message = DATA.read
puts "To line before: "
puts ' ' + mime_message.match(/^(To\:.*)$/i)[1]
# Massage the To: line.
changed_to = '[email protected]'
mime_message.gsub!(/^To\:.*$/i, "To: #{changed_to}")
puts "To line after: "
@endymion
endymion / gist:a5381dad4987c69bda9ec2141bf2b960
Last active May 23, 2021 12:04
Attempting to install the AWS SAM CLI on a Gravitron2-based EC2 M6g Amazon Linux 2 instance using PIP.
[ec2-user@ip-172-31-40-220 ~]$ pip3 install --user aws-sam-cli
Collecting aws-sam-cli
Downloading https://files.pythonhosted.org/packages/6d/f7/77aaa4d128dd5b9cc443b852f924cbe155cac7bb0ce191c2ac34d7c4d794/aws_sam_cli-1.23.0-py3-none-any.whl (3.8MB)
100% |████████████████████████████████| 3.8MB 383kB/s
Collecting requests==2.23.0 (from aws-sam-cli)
Downloading https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 12.8MB/s
Collecting Flask~=1.1.2 (from aws-sam-cli)
Downloading https://files.pythonhosted.org/packages/e8/6d/994208daa354f68fd89a34a8bafbeaab26fda84e7af1e35bdaed02b667e6/Flask-1.1.4-py2.py3-none-any.whl (94kB)
100% |████████████████████████████████| 102kB 13.3MB/s
@endymion
endymion / gist:53d5dec9ede03f4265ed739c9471f024
Created January 4, 2021 23:04
A list of AWS Lambda layers that Yumbda can create for you.
Last login: Mon Jan 4 17:54:28 on ttys005
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
ryan-13:~ work$ docker run --rm lambci/yumda:2 yum list available
Unable to find image 'lambci/yumda:2' locally
2: Pulling from lambci/yumda
a3f8e652bdc4: Pull complete
b952bd002b0a: Pull complete
@endymion
endymion / exam.md
Last active August 2, 2019 16:00
Cloud Fu Exam Lab

Cloud Fu Exam Lab

This lab demonstrate aptitude with:

  • Unix
  • Git
  • virtualization
  • Vagrant

...and touches a bit on Ruby.

@endymion
endymion / gist:7dc56dd017339164841121c69657350c
Created January 5, 2018 20:02
The post body is not available to the Lambda function.
$ curl -v -X POST 'https://8cjjw9ynlb.execute-api.us-east-1.amazonaws.com/Prod' -H 'content-type: application/json' -d '{"callerName": "John"}'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 52.85.109.19...
* TCP_NODELAY set
* Connected to 8cjjw9ynlb.execute-api.us-east-1.amazonaws.com (52.85.109.19) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
@endymion
endymion / gist:f788fb06d8f9e68108ae9c52314afb97
Created April 24, 2017 15:59
'next upcoming event' Marketo template code
<h2>Custom Objects</h2>
<table>
<tr>
<th>#</th>
<th>date</th>
</tr>
#foreach($object in $openTableReservation_cList)
    <tr>
<td>$foreach.count</td>
<td>
@endymion
endymion / gist:73f026518256d19f4e77250167562ae4
Created February 23, 2017 22:15
The birth of Screen Driver.
ryan-15:projects rap$ curl https://install.meteor.com/ | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7786 0 7786 0 0 16883 0 --:--:-- --:--:-- --:--:-- 16852
Downloading Meteor distribution
######################################################################## 100.0%
Meteor 1.4.3.1 has been installed in your home directory (~/.meteor).
Writing a launcher script to /usr/local/bin/meteor for your convenience.
@endymion
endymion / gist:17a8c16453e21334abcf
Created August 7, 2014 18:04
Building a static site with gollum-lib, for deployment to Amazon S3.
require 'fileutils'
require 'yaml'
require 'haml'
require 'sass'
require 'gollum-lib'
desc 'Build a static web site from the Gollum wiki.'
task :build do |t, args|
puts "Generating static web site from the wiki, in _site..."
mkdir_p('_site')
@endymion
endymion / gist:d5acf44be284d4feeda2
Created July 29, 2014 22:01
Merge Salesforce objects using Ruby SOAP API code
require 'soapforce'
request = <<"EOC"
<request>
<masterRecord>
<ns7:type xmlns:ns7="urn:sobject.partner.soap.sforce.com">Lead</ns7:type>
<ns8:Id xmlns:ns8="urn:sobject.partner.soap.sforce.com">00Qo0000002gZlTEAU</ns8:Id>
</masterRecord>
<recordToMergeIds>00Qo0000002gZldEAE</recordToMergeIds>
</request>
@endymion
endymion / gist:8588110
Created January 23, 2014 22:28
Somebody probed a staging server, the moment that I mapped a DNS name to it.
Processing ApplicationController#index (for 93.174.93.17 at 2014-01-23 22:04:45) [GET]
ActionController::RoutingError (No route matches "/cgi-bin/php" with {:method=>:get}):
sass (3.1.21) rails/./lib/sass/plugin/rack.rb:54:in `call'
sass (3.1.21) rails/./lib/sass/plugin/rack.rb:54:in `call'
/data/venuedriver/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.6.2.96/lib/new_relic/rack/agent_hooks.rb:18:in `call'
/data/venuedriver/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.6.2.96/lib/new_relic/rack/browser_monitoring.rb:16:in `call'
/usr/libexec/passenger/lib/phusion_passenger/rack/request_handler.rb:97:in `process_request'
/usr/libexec/passenger/lib/phusion_passenger/abstract_request_handler.rb:520:in `accept_and_process_next_request'