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 | |
# encoding: utf-8 | |
""" | |
digitalocean | |
Created by Djordje Stojanovic <[email protected]> | |
Based on DigitalOcean inventory plugin: | |
https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/digital_ocean.py | |
""" |
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 ansible import errors, runner | |
def tail(lines, num_lines=1, delimiter='\n'): | |
if type(lines) is unicode or type(lines) is str: | |
lines = str(lines).split(delimiter) | |
# remove empty lines | |
lines = remove_empty_elements(lines) | |
end = len(lines) | |
start = end-num_lines | |
return lines[start: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
import logging | |
import requests | |
try: | |
import json | |
except ImportError: | |
import simplejson as json | |
class CloudFlare(object): | |
def __init__(self, email, token): | |
self.url = 'https://www.cloudflare.com/api_json.html' |
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 | |
# encoding: utf-8 | |
""" | |
dynflare | |
Created by Djordje Stojanovic <[email protected]> | |
""" | |
import sys | |
import socket | |
import logging |
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 bash | |
padding () { | |
local char=" " | |
if [ "$#" -gt "1" ]; then | |
local char=${1:-$char} | |
local count=${2:-"1"} | |
elif [ "$#" -eq "1" ]; then | |
local count=${1:-"1"} | |
fi |
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 bash | |
TEMPLATE_FILE=${1} | |
if [ -z "${TEMPLATE_FILE}" ]; then | |
echo "Usage: $(basename $0) TEMPLATE_FILE" | |
exit 1 | |
fi | |
eval "echo \"$(< $TEMPLATE_FILE)\"" |
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 bash | |
# Tested on Debian/Ubuntu | |
GITHUB_USER="StalkingKillah" | |
DEVICE="TLMR3020" | |
RELEASE='15.05' | |
case "$RELEASE" in | |
trunk) | |
BUILDER="https://archive.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64.tar.bz2" | |
;; | |
15.05) |
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/sh | |
if [ -z "$1" ]; then | |
echo "Input device (ex. /dev/sda1)" | |
exit | |
fi | |
TARGET="${1}" | |
MOUNT_POINT="/mnt/$(basename $TARGET)" | |
echo "Make sure the partition on $TARGET is safe for deletion" | |
read -p "Do you wish to continue [yN]? " answer; |
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
# add your custom package feeds here | |
# | |
# src/gz example_feed_name http://www.example.com/path/to/files | |
# Old feeds from previous image | |
# Uncomment to reenable | |
# src/gz chaos_calmer_pineapple https://www.wifipineapple.com/nano/packages |
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 * | |
import exifread | |
from PyQt5.QtCore import * | |
from PyQt5.QtGui import * | |
from PyQt5.QtWidgets import * | |
class QExifAwareImage(QLabel): | |
changed = pyqtSignal() |
OlderNewer