Skip to content

Instantly share code, notes, and snippets.

View StalkingKillah's full-sized avatar

Djordje Stojanovic StalkingKillah

  • Ursus Software
  • Nis, Serbia
View GitHub Profile
@StalkingKillah
StalkingKillah / cloudflare_v4_dyndns.rsc
Last active April 18, 2020 02:08
Mikrotik dynamic DNS using CloudFlare API v4
## Meta
# Script by Djordje Stojanovic (djordje.stojanovic<at>shadow-inc.net)
# Updated: 2020-04-18
## Script Permissions
# Read
# Write
# Test
# Sniff
# Sensitive
@StalkingKillah
StalkingKillah / qtransparentmainwindow.py
Created November 4, 2018 21:12
Transparent QMainWindow
from typing import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class QTransparentMainWindow(QMainWindow):
closing = pyqtSignal()
_movable = False
@StalkingKillah
StalkingKillah / qexifawareimage.py
Created November 4, 2018 21:04
QLabel for image display, EXIF aware
from typing import *
import exifread
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class QExifAwareImage(QLabel):
changed = pyqtSignal()
@StalkingKillah
StalkingKillah / customfeeds.conf
Last active February 22, 2018 20:17
OpenWRT Chaos Calmer 15.05.1 (Pineapple) OPKG Feed - put it under /etc/opkg
# 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
#!/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;
#!/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)
@StalkingKillah
StalkingKillah / simple-template
Created November 26, 2015 20:46
Using bash as a template engine
#!/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)\""
@StalkingKillah
StalkingKillah / scaffold_ansible.sh
Last active April 23, 2017 14:11
Scaffold Ansible project
#!/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
@StalkingKillah
StalkingKillah / dynflare.py
Created January 7, 2015 16:14
DynFlare - CloudFlare as dynamic dns service
#!/usr/bin/env python
# encoding: utf-8
"""
dynflare
Created by Djordje Stojanovic <djordje.stojanovic@shadow-inc.net>
"""
import sys
import socket
import logging
@StalkingKillah
StalkingKillah / cloudflare.py
Created January 7, 2015 16:10
Basic CloudFlare API Python Library (using requests library)
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'