Skip to content

Instantly share code, notes, and snippets.

View mattbillenstein's full-sized avatar

Matt Billenstein mattbillenstein

View GitHub Profile
1 awscli-1.16.212/awscli/customizations/cloudtrail/validation.py
4 awscli-1.16.212/awscli/customizations/codedeploy/push.py
2 awscli-1.16.212/awscli/customizations/emr/createcluster.py
23 awscli-1.16.212/awscli/shorthand.py
4 awscli-cwlogs-1.4.5/cwlogs/push.py
1 boto-2.49.0/boto/cloudfront/distribution.py
1 boto-2.49.0/boto/cloudsearchdomain/layer1.py
7 boto-2.49.0/boto/connection.py
2 boto-2.49.0/boto/gs/resumable_upload_handler.py
1 boto-2.49.0/boto/https_connection.py
#!/bin/bash -xv
set -eo pipefail
HERE="$(pwd)"
sudo apt-get install gcc make libffi-dev pkg-config zlib1g-dev libbz2-dev \
libsqlite3-dev libncurses5-dev libexpat1-dev libssl-dev libgdbm-dev \
tk-dev libgc-dev python-cffi \
liblzma-dev libncursesw5-dev # these two only needed on PyPy3
#!/usr/bin/env python3
# sudo apt-get install libcairo2
# pip install requests python-chess Pillow CairoSVG
import io
import sys
import time
import cairosvg
>>> import datetime
>>> import pytz
>>> tz = pytz.timezone('America/Los_Angeles')
>>> dt = datetime.datetime.utcnow()
>>> tz.localize(dt) + datetime.timedelta(days=2)
datetime.datetime(2019, 3, 11, 20, 32, 13, 824846, tzinfo=<DstTzInfo 'America/Los_Angeles' PST-1 day, 16:00:00 STD>)
>>> (tz.localize(dt) + datetime.timedelta(days=2)).isoformat()
'2019-03-11T20:32:13.824846-08:00'
>>> (tz.localize(dt + datetime.timedelta(days=2))).isoformat()
'2019-03-11T20:32:13.824846-07:00'
#!/usr/bin/env python3
import json
import time
start = time.time()
L = []
i = 0
import time
find = '07123E1F482356C415F684407A3B8723E10B2CBBC0B8FCD6282C49D37C9C1ABC'
length = len(find)
# dd if=/dev/urandom of=200mb.txt bs=1000000 count=200
# echo '07123E1F482356C415F684407A3B8723E10B2CBBC0B8FCD6282C49D37C9C1ABC' >> 200mb.txt
data = open('200mb.txt').read()
found = 0
mattb@mattb-mbp:~/src/nixpkgs master$ nix-build '<nixpkgs>' -A mongodb -K 2>&1 | tail
Checking for storage class __declspec(thread) no
Checking for C++11 is_trivially_copyable support... yes
Checking for C++14 std::make_unique support... no
Checking for C++11 std::align support... yes
Checking for SSL_version(NULL) in C library ssl... no
Couldn't find OpenSSL ssl.h header and library
See /private/var/folders/g3/n64c6yd14js83j3vsnp_5f340000gn/T/nix-build-mongodb-3.2.9.drv-5/mongodb-src-r3.2.9/build/scons/config.log for details
note: keeping build directory ‘/private/var/folders/g3/n64c6yd14js83j3vsnp_5f340000gn/T/nix-build-mongodb-3.2.9.drv-5’
builder for ‘/nix/store/9rb2vxk57d1c9f8ll94lv9nypri617jj-mongodb-3.2.9.drv’ failed with exit code 1
(Pdb) w
/tve/bin/airflow(23)<module>()
-> args.func(args)
/tve/lib/python2.7/site-packages/airflow/bin/cli.py(455)scheduler()
-> job.run()
/tve/lib/python2.7/site-packages/airflow/jobs.py(173)run()
-> self._execute()
/tve/lib/python2.7/site-packages/airflow/jobs.py(765)_execute()
-> executor.end()
/tve/lib/python2.7/site-packages/airflow/executors/local_executor.py(75)end()
(tve)push@prod-db2:PROD::/data/log/airflow/corpus $ date; ps aux | grep scheduler
Thu Sep 22 19:54:32 UTC 2016
push 10687 0.0 0.0 6044 476 pts/3 S+ 09:54 0:00 tail -f scheduler.log
push 29313 0.0 0.0 12944 928 pts/4 S+ 19:54 0:00 grep --color=auto scheduler
(tve)push@prod-db2:PROD::/data/log/airflow/corpus $ date; ps aux | grep scheduler
Thu Sep 22 19:54:34 UTC 2016
push 10687 0.0 0.0 6044 476 pts/3 S+ 09:54 0:00 tail -f scheduler.log
app 29310 90.2 0.5 161352 44924 ? R 19:54 0:03 /tve/bin/python /tve/bin/airflow scheduler --num_runs 10
push 29322 0.0 0.0 12944 928 pts/4 S+ 19:54 0:00 grep --color=auto scheduler
(tve)push@prod-db2:PROD::/data/log/airflow/corpus $ date; ps aux | grep scheduler
[2016-09-22 18:50:23,412] {jobs.py:741} INFO - Done queuing tasks, calling the executor's heartbeat
[2016-09-22 18:50:23,413] {jobs.py:744} INFO - Loop took: 0.278067 seconds
[2016-09-22 18:50:23,422] {models.py:305} INFO - Finding 'running' jobs without a recent heartbeat
[2016-09-22 18:50:23,423] {models.py:311} INFO - Failing jobs without heartbeat after 2016-09-22 18:48:08.423588
[2016-09-22 18:50:28,120] {jobs.py:574} INFO - Prioritizing 0 queued jobs
[2016-09-22 18:50:28,122] {models.py:154} INFO - Filling up the DagBag from /opt/t3/airflow/dags
[2016-09-22 18:50:28,144] {jobs.py:726} INFO - Starting 2 scheduler jobs
[2016-09-22 18:50:28,258] {models.py:2660} INFO - Checking state for <DagRun anr @ 2016-09-22 12:20:00: scheduled__2016-09-22T12:20:00, externally triggered: False>
[2016-09-22 18:50:28,258] {models.py:2660} INFO - Checking state for <DagRun anr @ 2016-09-22 13:20:00: scheduled__2016-09-22T13:20:00, externally triggered: False>