Skip to content

Instantly share code, notes, and snippets.

View dulldusk's full-sized avatar

Fabrício Seger Kolling dulldusk

View GitHub Profile
@dulldusk
dulldusk / dayornight.py
Created December 27, 2018 07:00
Script created for use on MotionEyeOs, to change configurations for day and night. https://github.com/ccrisan/motioneyeos
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Script created for use on MotionEyeOs, to change configurations for day and night
# https://github.com/ccrisan/motioneyeos
# Crontab execute every 5 min
# 02,07,12,17,22,27,32,37,42,47,52,57 * * * * /usr/bin/python /data/dayornight.py >> /var/log/dayornight.log
from math import floor, ceil, pi, atan, tan, sin, asin, cos, acos
function do_dump(&$var, $var_name = NULL, $indent = NULL, $reference = NULL)
{
$do_dump_indent = "<span style='color:#666666;'>|</span> &nbsp;&nbsp; ";
$reference = $reference.$var_name;
$keyvar = 'the_do_dump_recursion_protection_scheme'; $keyname = 'referenced_object_name';
// So this is always visible and always left justified and readable
echo "<div style='text-align:left; background-color:white; font: 100% monospace; color:black;'>";
if (is_array($var) && isset($var[$keyvar]))
@ankithaldar
ankithaldar / SunRiseSet.py
Last active June 21, 2020 11:07
Sunrise/Sunset Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = ("Helder")
__version__ = ("0.1")
__url__ = ('http://williams.best.vwh.net/sunrise_sunset_algorithm.htm')
#imports
PY3=True
from math import floor, ceil, pi, atan, tan, sin, asin, cos, acos
@shawnrice
shawnrice / skeleton-daemon.sh
Created April 19, 2014 07:22
A template to write a quick daemon as a bash script
#!/bin/sh
# This is a skeleton of a bash daemon. To use for yourself, just set the
# daemonName variable and then enter in the commands to run in the doCommands
# function. Modify the variables just below to fit your preference.
daemonName="DAEMON-NAME"
pidDir="."
pidFile="$pidDir/$daemonName.pid"
@eqhmcow
eqhmcow / hfsc-shape.sh
Last active August 2, 2023 11:59
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.