brew install pgloader
brew install mysql@5.7
brew services start mysql@5.7
brew link mysql@5.7 --force
curl -LO http://ergast.com/downloads/f1db.sql.gz
gunzip -k f1db.sql.gz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun toss () | |
| (/ (* (/ (/ (* complexity operating-cost) | |
| work-to-turn-off) | |
| 1000.0) | |
| (+ security-risk accountability-risk)) | |
| (* (/ active-users total-possible-users) | |
| (* total-possible-users future-growth)))) | |
| ;; CLUES 1.0 | |
| (let ((complexity 3.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bindkey -v | |
| bindkey "^R" history-incremental-search-backward | |
| # zle vi mode indication | |
| # http://pawelgoscicki.com/archives/2012/09/vi-mode-indicator-in-zsh-prompt/ | |
| setopt PROMPT_SUBST | |
| vim_ins_mode="-- INSERT --" | |
| vim_cmd_mode="" | |
| vim_mode=$vim_ins_mode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ** Restarting a dead service on a node | |
| https://aws.amazon.com/premiumsupport/knowledge-center/restart-service-emr/ | |
| hbase regionserver logs were saying they were timing out talking to hdfs ports. | |
| This led us to a problem with the "datanode" service, and that above blog about restarting services is how we restarted that service. | |
| Just looking through these will help to find what's broken. | |
| /var/logs/ | |
| /tmp/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| tkentrycomplete.py | |
| A Tkinter widget that features autocompletion. | |
| Created by Mitja Martini on 2008-11-29. | |
| Updated by Russell Adams, 2011/01/24 to support Python 3 and Combobox. | |
| Updated by Dominic Kexel to use Tkinter and ttk instead of tkinter and tkinter.ttk | |
| Licensed same as original (not specified?), or public domain, whichever is less restrictive. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class EnhancedJSONEncoder(json.JSONEncoder): | |
| def default(self, o): | |
| if is_dataclass(o): | |
| return asdict(o) | |
| if isinstance(o, Enum): | |
| return o.name | |
| if isinstance(o, time): | |
| return o.strftime("%H:%M") | |
| return super().default(o) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import logging | |
| from base64 import b64decode | |
| from datetime import datetime, timezone | |
| from urllib.request import urlopen | |
| from M2Crypto import X509 | |
| from flask import Blueprint, request, jsonify | |
| from werkzeug.exceptions import BadRequest, Unauthorized |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> import csv | |
| >>> s = '"Yes, this line",can be, parsed as csv' | |
| >>> list(csv.reader([s]))[0] | |
| ['Yes, this line', 'can be', ' parsed as csv'] | |
| >>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| s3_client = boto3.client('s3') | |
| def list_dirs(bucket, prefix): | |
| """ Yield direct child folders of the given prefix. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| from functools import wraps, update_wrapper | |
| def scaled_retries(attempts, sleeptime, sleepscale): | |
| scaled_sleeptime = sleeptime | |
| for attempt_no in range(attempts): | |
| yield attempt_no + 1, scaled_sleeptime | |
| scaled_sleeptime *= sleepscale |
NewerOlder