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
#!/bin/bash | |
# 0 * * * * /usr/local/bin/docker-cleanup.cron.sh > /var/log/docker-cleanup.log 2> /var/log/docker-cleanup.err.log | |
cleanup_images() { | |
echo "Cleaning up images" | |
docker rmi -f $(docker images -af dangling=true -q) | |
} | |
cleanup_containers() { | |
echo "Cleaning up containers" |
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 python3 | |
from typing import List | |
def ptable(data : List[List], sep : str = "\t", sort_by : int = None): | |
""" | |
Pretty-prints a table | |
Args: | |
data (list): A list of lists where data[0] = the first row | |
sep (str): Default "\t" - the separator to use | |
sort_by (int): Default None - the column index to sort by |
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
#!/bin/bash | |
if [ $EUID != 0 ]; then | |
echo "You must be root" | |
exit 1; | |
fi | |
# Installs Docker on Ubuntu 14.04 | |
apt-get update && apt-get -y install \ | |
apt-transport-https \ | |
ca-certificates \ |
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
#!/bin/bash | |
# Provides 'git-prev' and 'git-next' commands for git | |
# to facilitate browsing step-by-step | |
# Run "source git_move.sh" to activate commands | |
_git_next() { | |
git log --reverse --pretty=%H master | \ |
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 python | |
import os | |
import sys | |
from itertools import product | |
from random import sample | |
def load(filename): | |
with open(filename) as fd: | |
return filter(lambda x:x, map(lambda x:x.strip(), fd.readlines())) |
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 application is running |
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
FROM alpine:3.6 | |
RUN apk update && apk add --no-cache bind | |
VOLUME ["/data"] | |
WORKDIR /data | |
ENTRYPOINT ["/usr/sbin/named-checkzone"] |
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
""" | |
* Carrotland | |
* ========== | |
* | |
* The rabbits are free at last, free from that horrible zombie science experiment. They need a happy, safe home, where they can recover. | |
* | |
* You have a dream, a dream of carrots, lots of carrots, planted in neat rows and columns! But first, you need some land. And the only person who's selling land is Farmer Frida. Unfortunately, not only does she have only one plot of land, she also doesn't know how big it is - only that it is a triangle. However, she can tell you the location of the three vertices, which lie on the 2-D plane and have integer coordinates. | |
* | |
* Of course, you want to plant as many carrots as you can. But you also want to follow these guidelines: The carrots may only be planted at points with integer coordinates on the 2-D plane. They must lie within the plot of land and not on the boundaries. For example, if the vertices were (-1,-1), (1,0) and (0,1), then you can plant only one carrot at (0,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
#!/usr/bin/env python | |
""" | |
Creates a list of hosts from a CSV export of nodes | |
Usage: ./check_pe_csv path/to/csvfile | |
""" | |
import csv | |
import os | |
import sys |
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
#!/bin/bash | |
# wget <raw_url> | |
# chmod +x init.sh | |
# ./init.sh | |
if [ "${EUID}" != "0" ]; then | |
echo "You must be root" | |
exit 1; | |
fi |