- https://gist.github.com/ymotongpoo/7207190c4963aa8198c98b2bf4ac5496
- https://gist.github.com/ymotongpoo/ddd8c99c15d9ecf7ddf1b3deeef3cf8f
- https://gist.github.com/ymotongpoo/fdfffec61e98de6aed331fc4fd99678f
- https://gist.github.com/ymotongpoo/91ef4e4da38fd012cc3bc99c6299b30a
- https://gist.github.com/ymotongpoo/79b265ba3aafcd3e554da479ea49270d
- https://gist.github.com/ymotongpoo/d5cd3125e5bc5a8a60c73b4be9da06bb
- https://gist.github.com/ymotongpoo/f6a141a16fa1f477076104b7a6074176
- https://gist.github.com/ymotongpoo/1aecbc9c75a396198e2b59a26a78bd84
- https://gist.github.com/ymotongpoo/246b9041f7e2260e7ece8f127bbce88e
- https://gist.github.com/ymotongpoo/76ebbdd756dd2443c534d17f38d18e35
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
// 1. Open the browser developper console on the network tab | |
// 2. Start the video | |
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL | |
// 4. Run: node vimeo-downloader.js "<URL>" | |
// 5. Combine the m4v and m4a files with mkvmerge | |
const fs = require('fs'); | |
const url = require('url'); | |
const https = require('https'); |
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
#!/usr/bin/env bash | |
set -e | |
VOLUME_PATH=/Volumes/installer | |
while getopts ":d:h" opts; do | |
case $opts in | |
d) | |
VOLUME_PATH=$OPTARG | |
;; |
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
[Unit] | |
Description=Some description | |
After=network.target | |
[Service] | |
Type=simple | |
User=user | |
WorkingDirectory=/home/user/somedir | |
Environment=PYTHONPATH=/home/user/somedir | |
ExecStart=/home/user/venv/bin/python script.py |
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 asyncio | |
import aiohttp | |
import async_timeout | |
from aiohttp import ClientError | |
async def _fetch(session, url, coro): | |
"""HTTPリソースからデータを取得しコルーチンを呼び出す |
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
# The goal: create a list of maps of subnet mappings so we don't have to statically hard-code them in aws_lb | |
# https://www.terraform.io/docs/providers/aws/r/lb.html#subnet_mapping | |
locals { | |
# These represent dynamic data we fetch from somewhere, such as subnet IDs and EIPs from a VPC module | |
subnet_ids = ["subnet-1", "subnet-2", "subnet-3"] | |
eips = ["eip-1", "eip-2", "eip-3"] | |
} | |
# Here's the hack! The null_resource has a map called triggers that we can set to arbitrary values. | |
# We can also use count to create a list of null_resources. By accessing the triggers map inside of |
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
# start with the nvidia container for cuda 8 with cudnn 5 | |
# ensure `/etc/docker/daemon.json` file is | |
# modified to use nvidia runtime by default | |
FROM nvidia/cuda:8.0-cudnn5-devel | |
# install dependencies | |
RUN apt-get update && \ | |
apt-get install -y \ | |
build-essential \ | |
cmake \ |
Find the original here article here: Devops Best Practices
DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing
Mastodon が他のインスタンスと情報交換をする OStatus API の使い方。使ってるだけのユーザは知る必要がない裏側の話。
Mastodon インスタンスに対して、RFC6415 が規定する /.well-known/host-meta
というパスを要求すると以下の XML が返ってくる.
<?xml version="1.0"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
<Link rel="lrdd" type="application/xrd+xml" template="https://[MASTODON_HOST]/.well-known/webfinger?resource={uri}"/>
</XRD>
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 requests | |
SLACK_API_TOKEN = "xoxo-asdfghjkl..." # get one from https://api.slack.com/docs/oauth-test-tokens | |
CHANNEL_NAME = "general" | |
channel_list = requests.get('https://slack.com/api/channels.list?token=%s' % SLACK_API_TOKEN).json()['channels'] | |
channel = filter(lambda c: c['name'] == CHANNEL_NAME, channel_list)[0] | |
channel_info = requests.get('https://slack.com/api/channels.info?token=%s&channel=%s' % (SLACK_API_TOKEN, channel['id'])).json()['channel'] | |
members = channel_info['members'] |