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/env python3 | |
import argparse | |
import os | |
# this is 'ffmpeg-python', not 'ffmpeg' or 'python-ffmpeg' :D | |
import ffmpeg | |
from pathlib import Path | |
# one weird trick to remove the extra "encoder" metadata | |
# that ffmpeg adds and deflemask h8s | |
one_weird_trick = { |
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
--- | |
- hosts: webservers | |
tasks: | |
- name: "Create required directories in /etc/letsencrypt" | |
file: | |
path: "/etc/letsencrypt/{{ item }}" | |
state: directory | |
owner: root | |
group: root | |
mode: u=rwx,g=x,o=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
# update was parsed from the goodreads xml as a big-ass dictionary/hashmap | |
name = update['actor']['name'] | |
title = update['object']['read_status']['review']['book']['title'] | |
author = update['object']['read_status']['review']['book']['author']['name'] | |
status = update['object']['read_status']['status'] |
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
// 1000 servers | |
// 1000000 events, randomly distributed across servers | |
db.getCollection("server").aggregate([ | |
{ $match: { created_by: "sivy"}}, | |
{ $lookup: { | |
from: "event", | |
let: { server_uuid: "$instance_uuid" }, | |
pipeline: [ | |
{ $match: { |
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
module Jekyll | |
module Filters | |
module SignalLogFilters | |
def date_with_yc_year(date) | |
year = date.year | |
# puts year | |
yc_year = 105+(year-2003) | |
# puts yc_year | |
time(date).strftime("YC#{yc_year}.%m.%d") |
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
try: | |
pass_through_moria() | |
except (UnexpectedBalrogError) as oh_shit_a_balrog: | |
print "FLY YOU FOOLS" |
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
15-10-27 17:17:05 pce_cloud_provisioner [DEBUG:] Checking on Mount point /apps | |
15-10-27 17:17:05 pce_cloud_provisioner [INFO:] cmd_subprocess() - Executing df -k /apps; ls -l /apps | |
15-10-27 17:17:05 pce_cloud_provisioner [INFO:] df: `/apps': No such file or directory | |
15-10-27 17:17:05 pce_cloud_provisioner [INFO:] df: no file systems processed | |
15-10-27 17:17:05 pce_cloud_provisioner [INFO:] ls: cannot access /apps: No such file or directory | |
15-10-27 17:17:05 pce_cloud_provisioner [INFO:] cmd_subprocess() - returncode=2 | |
15-10-27 17:17:05 pce_cloud_provisioner [DEBUG:] check_mount_point() - rc=2 | |
15-10-27 17:17:05 pce_cloud_provisioner [INFO:] cmd_subprocess() - Executing grep mptspi /sys/class/scsi_host/host?/proc_name | |
15-10-27 17:17:05 pce_cloud_provisioner [INFO:] cmd_subprocess() - returncode=0 | |
15-10-27 17:17:05 pce_cloud_provisioner [INFO:] format_mount_volume() - /sys/class/scsi_host/host2/proc_name:mptspi |
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 create_or_update(self, item_id, data): | |
if not self.validate(data): | |
raise ValidationError('Validation error!') | |
file_path = self._filepath(item_id) | |
existing_data = {} | |
try: | |
with open(file_path, 'r') as f: | |
content = f.read() |
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
class Foo(object): | |
num = 1 | |
ary = [] | |
class Bar(Foo): | |
pass | |
Bar.num = 2 | |
Bar.ary.extend([1]) |
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
[Fri Feb 06 14:29:06.602584 2015] [:error] tables.DataTableView.__init__(self, workflow.request) | |
[Fri Feb 06 14:29:06.602613 2015] [:error] File "/usr/lib/python2.7/dist-packages/horizon/tables/views.py", line 29, in __init__ | |
[Fri Feb 06 14:29:06.602642 2015] [:error] super(MultiTableMixin, self).__init__(*args, **kwargs) | |
[Fri Feb 06 14:29:06.602670 2015] [:error] TypeError: __init__() takes exactly 1 argument (2 given) |
NewerOlder