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 osascript -l JavaScript | |
function run(argv) { | |
// Obtain the terminal application | |
terminal = Application('Terminal'); | |
// Set the font | |
terminal.defaultSettings.fontName = 'Source Code Pro for Powerline'; | |
terminal.defaultSettings.fontSize = 18; | |
terminal.defaultSettings.fontAntialiasing = true; |
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
# Automatic activation and deactivation of virtualenvs using virtualenvwrapper | |
# whereby the virtualenv name must match the current directory name | |
function cd | |
{ | |
# Perform the regular cd | |
builtin cd "$@" | |
# Iterate through the current directory, heading into each parent directory | |
# until we find a .virtualenv file or land in the top directory (/) | |
test_directory=$(pwd) |
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 | |
from __future__ import print_function | |
from glob import glob | |
import multiprocessing | |
import os | |
import signal | |
import subprocess | |
import sys |
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 | |
# | |
# Red Hat Satellite Dynamic Inventory for Ansible | |
# Copyright 2016 by Fotis Gimian (MIT License) | |
# | |
# Set your inventory to point to this script and ensure the script is | |
# executable. You'll need an INI file with Satellite details of the following | |
# style (whereby you may specify one or more Satellite servers): | |
# | |
# [satellite] |
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 | |
# Set the destination IP or hostname to ping | |
DESTINATION=8.8.8.9 | |
# Ping the endpoint and write an error to a log file if the ping fails 5 times consecutively | |
FAILURE_COUNT=0 | |
while true | |
do | |
ping -c 1 -t 1 $DESTINATION > /dev/null 2>&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
import math | |
import sys | |
import time | |
# Colours | |
BOLD = '\033[1m' | |
RED = '\033[91m' | |
GREEN = '\033[92m' | |
YELLOW = '\033[93m' |
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
--- | |
# Ensure very detailed checking with no exclusions | |
strictness: veryhigh | |
doc-warnings: true | |
member-warnings: true | |
test-warnings: true | |
# Set maximum line length across linters to the agreed length | |
max-line-length: 100 |
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
require "yaml" | |
# The default representation of null values in Crystal is an empty value which while valid | |
# (see http://yaml.org/type/null.html) but is less familiar and clear to me, use the string | |
# "null" instead | |
struct Nil | |
def to_yaml(yaml : YAML::Nodes::Builder) | |
yaml.scalar "null" | |
end | |
end |
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
require 'net/http' | |
require 'json' | |
require 'uri' | |
@token = '' | |
def list_files(days) | |
params = { | |
token: @token, | |
ts_to: (Time.now - days * 24 * 60 * 60).to_i, |
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 python3 | |
""" | |
Trash Locations shows you all deleted files and their original location (sorted by original | |
location). | |
To run this script, you'll first need to install Python 3.6 or later and run: | |
pip3 install ds_store | |
Developed by Fotis Gimian (MIT license). |
OlderNewer