This file contains 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
from typing import NamedTuple | |
from urllib.parse import urlparse | |
class HarnessPipeline(NamedTuple): | |
account: str | |
org: str | |
project: str | |
pipeline: str | |
@classmethod |
This file contains 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
from contextlib import contextmanager | |
from functools import wraps | |
from time import perf_counter | |
@contextmanager | |
def t(name: str): | |
start = perf_counter() | |
yield | |
print(f'TIMER {name}: {perf_counter() - start}') |
This file contains 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
#!/usr/bin/env python | |
# This is free and unencumbered software released into the public domain. | |
# Anyone is free to copy, modify, publish, use, compile, sell, or | |
# distribute this software, either in source code form or as a compiled | |
# binary, for any purpose, commercial or non-commercial, and by any | |
# means. | |
# In jurisdictions that recognize copyright laws, the author or authors | |
# of this software dedicate any and all copyright interest in the |
This file contains 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
edx_platform_repo: "https://github.com/mitocw/edx-platform.git" | |
edx_platform_version: "mitx-release" | |
edxapp_use_custom_theme: true | |
edxapp_theme_name: mitx | |
edxapp_theme_source_repo: 'https://{{ COMMON_GIT_MIRROR }}/mitocw/edx-theme.git' | |
edxapp_theme_version: 'mitx-loloadx' | |
EDXAPP_MKTG_URL_LINK_MAP: | |
CONTACT: !!null | |
FAQ: !!null | |
HONOR: !!null |
This file contains 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
def x_in_loop(): | |
x = range(500) | |
for i in x: | |
if x == 253: | |
return True | |
return False | |
def x_in_range(): | |
x = range(500) | |
return 253 in x |
This file contains 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
- name: Update libc6 and reboot | |
hosts: all | |
sudo: yes | |
# Comment out to apply to all servers | |
serial: 1 | |
tasks: | |
- name: "Install packages and update cache" | |
apt: name="{{ item }}" state=latest update_cache=yes | |
with_items: |
This file contains 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
#!/bin/bash | |
# This script assumes that the git repository is already cloned | |
# App specifics | |
EDXAPP_USER="edxapp" | |
EDXAPP_VENV="/edx/app/edxapp/venvs/edxapp" | |
EDXAPP_DIR="/edx/app/edxapp/edx-platform" | |
# Git specifics | |
export GIT_KEY="/edx/app/course_git_backup/git_backup_deploy" |
This file contains 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
#!/usr/bin/env python | |
""" | |
Tail a Jenkins build in a terminal | |
""" | |
import os | |
import requests | |
import sys | |
import time | |
This file contains 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
# no startup msg | |
startup_message off | |
# always use a login shell | |
shell -$SHELL | |
# auto-log | |
logfile $HOME/log/screen-logs/%Y%m%d-%n.log | |
deflog on | |
escape ^Oo |
This file contains 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
#!/bin/bash | |
hostname=example.com | |
while true; do | |
ip=$(dig +short $hostname | tail -n 1) | |
if [ ! -n "$ip" ]; then | |
echo "Failed at $(date)" | |
fi | |
sleep 1 |
NewerOlder