Skip to content

Instantly share code, notes, and snippets.

AWSTemplateFormatVersion: '2010-09-09'
Parameters:
DBUser:
Description: Username for master RDS user
Type: String
Default: INVALID
NoEcho: true
AllowedPattern: ^[A-Za-z][A-Za-z0-9_]{1,62}$
ConstraintDescription: Must contain 1 to 63 alphanumeric characters. First character
must be a letter.
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
@schmiddy
schmiddy / example.json
Created February 16, 2019 20:38
example packer template with instance_type being a user variable
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
from __future__ import unicode_literals
UNADORNED = 'abc'
UNICODE_STR = u'abc'
BYTE_STRING = b'abc'
print "Type of UNADORNED: %s" % type(UNADORNED)
print "Type of UNICODE_STR: %s" % type(UNICODE_STR)
print "Type of BYTE_STRING: %s" % type(BYTE_STRING)
if not set([1, 2, 3]) <= set([3, 4]):
print "not a subset"
@schmiddy
schmiddy / pstree.out
Created August 3, 2015 17:27
pstree output
python(27620)─┬─python(27628)─┬─{python}(27694)
│ └─{python}(27703)
├─python(27629)─┬─{python}(27695)
│ └─{python}(27728)
├─python(27630)─┬─{python}(27696)
│ └─{python}(27726)
├─python(27633)─┬─{python}(27698)
│ └─{python}(27727)
├─python(27636)─┬─{python}(27699)
│ └─{python}(27724)
@schmiddy
schmiddy / celery-parent-py-bt.text
Created July 30, 2015 16:16
celery worker parent process: python backtrace
#4 Frame 0x67d6ea0, for file /path/to/venv/local/lib/python2.7/site-packages/kombu/utils/eventio.py, line 93, in _poll (self=<_epoll(_epoll=<select.epoll at remote 0x5dd0598>) at remote 0x617d060>, timeout=<float at remote 0x6838650>)
return self._epoll.poll(timeout if timeout is not None else -1)
#8 Frame 0x67d6c80, for file /path/to/venv/local/lib/python2.7/site-packages/kombu/utils/eventio.py, line 65, in poll (self=<_epoll(_epoll=<select.epoll at remote 0x5dd0598>) at remote 0x617d060>, timeout=<float at remote 0x6838650>)
return self._poll(timeout)
#12 Frame 0x67cff60, for file /path/to/venv/local/lib/python2.7/site-packages/kombu/async/hub.py, line 278, in create_loop (self=<Hub(consolidate=set([]), _register_fd=<instancemethod at remote 0x5d4a760>, _running=False, readers={35: (<function at remote 0x67ab108>, (35,)), 39: (<function at remote 0x67ab108>, (39,)), 8: (<function at remote 0x67ab108>, (8,)), 41: (<instancemethod at remote 0x67ac960>, (<...>, 41)), 42: (<instancemethod at remote 0x67
@schmiddy
schmiddy / thread-apply-all.text
Created July 30, 2015 16:01
thread apply all backtrace
(gdb) thread apply all bt
Thread 3 (Thread 0x7f747d028700 (LWP 11546)):
#0 0x00007f74853359d3 in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f7482c53bed in ?? () from /usr/lib/libpq.so.5
#2 0x00007f7482c53c70 in ?? () from /usr/lib/libpq.so.5
#3 0x00007f7482c51e21 in PQgetResult () from /usr/lib/libpq.so.5
#4 0x00007f7482c520b8 in ?? () from /usr/lib/libpq.so.5
#5 0x00007f7482e7942b in pq_execute_command_locked (conn=0x6428d50, query=
0x7f7482e9833e "BEGIN", pgres=0x7f747d016338, error=0x7f747d016340, tstate=
@schmiddy
schmiddy / py-bt.text
Created July 30, 2015 15:42
py-bt backtrace
(gdb) py-bt
#5 Frame 0x6365b40, for file /usr/lib/python2.7/threading.py, line 243, in wait (self=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f7478826180>, acquire=<built-in method acquire of thread.lock object at remote 0x7f7478826180>, _Condition__waiters=[<thread.lock at remote 0x7f74788262c0>], release=<built-in method release of thread.lock object at remote 0x7f7478826180>) at remote 0x67a1bc0>, timeout=None, waiter=<thread.lock at remote 0x7f74788262c0>, saved_state=None)
waiter.acquire()
#9 Frame 0x7f74780e7ab0, for file /usr/lib/python2.7/Queue.py, line 168, in get (self=<Queue(unfinished_tasks=0, queue=<collections.deque at remote 0x7f74784c6d80>, maxsize=0, all_tasks_done=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f7478826180>, acquire=<built-in method acquire of thread.lock object at remote 0x7f7478826180>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f7478826180>) at remote 0
@schmiddy
schmiddy / thread apply all.text
Created July 30, 2015 15:14
'thread apply all bt' backtrace of stuck celery worker process
(gdb) thread apply all bt
Thread 3 (Thread 0x7f747d028700 (LWP 11546)):
#0 0x00007f74853359d3 in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f7482c53bed in ?? () from /usr/lib/libpq.so.5
#2 0x00007f7482c53c70 in ?? () from /usr/lib/libpq.so.5
#3 0x00007f7482c51e21 in PQgetResult () from /usr/lib/libpq.so.5
#4 0x00007f7482c520b8 in ?? () from /usr/lib/libpq.so.5
#5 0x00007f7482e7942b in pq_execute_command_locked (conn=0x6428d50, query=