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 sys | |
import hashlib | |
import base64 | |
import os.path | |
import urllib.request, urllib.parse | |
import xml.etree.ElementTree as ET | |
URL='http://www.napiprojekt.pl/api/api-napiprojekt3.php' | |
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 | |
# This program is free software. It comes without any warranty, to | |
# the extent permitted by applicable law. You can redistribute it | |
# and/or modify it under the terms of the Do What The Fuck You Want | |
# To Public License, Version 2, as published by Sam Hocevar. See | |
# http://sam.zoy.org/wtfpl/COPYING for more details. | |
#Background | |
for clbg in {40..47} {100..107} 49 ; do |
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
var gulp = require('gulp'); | |
// Include Our Plugins | |
var jshint = require('gulp-jshint'); | |
var sasslint = require('gulp-sass-lint'); | |
var sass = require('gulp-sass'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var rename = require('gulp-rename'); |
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
@echo off | |
rem Batch script (.bat or .cmd) command line arguments variables | |
rem %* - for all command line parameters (excluding the script name itself) | |
rem %0 - the command used to call the batch file | |
rem %1 - is the first command line parameter | |
rem %2 - is the second command line parameter, and so on till %9 (and SHIFT can be used for those after the 9th) | |
rem %~nx0 - the actual name of the batch file, regardless of calling method (some-batch.bat) | |
rem %~dp0 - drive and path to the script including trailing backslash (d:\scripts\) |
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
<?php | |
/** | |
* Forking in PHP 7 done right. Requires PHP >= 7.1 and Process Control extension (pcntl) | |
* | |
* @author Sebastian Pająk | |
* Good article in the subject that inspired me: https://ruslanspivak.com/lsbaws-part3 | |
*/ | |
// Enable asynchronous signal handling (as of PHP 7.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
[Unit] | |
Description=Haraka SMTP server | |
After=syslog.target network.target | |
[Service] | |
Type=simple | |
PIDFile=/var/run/haraka.pid | |
ExecStart=/usr/bin/haraka -c /usr/local/etc/haraka | |
ExecStop=/bin/kill -s QUIT $MAINPID |
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
class MyDescriptor: | |
def __set_name__(self, owner, name): | |
self.name = name | |
def __get__(self, instance, owner): | |
return f'Surprise from "{self.name}" descriptor' | |
def __set__(self, instance, value): | |
# You can set any property here or raise an exception to make it read only property | |
pass |
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
class Fib: | |
"""Iterator that yields numbers in the Fibonacci sequence""" | |
def __init__(self, max): | |
self.max = max | |
def __iter__(self): | |
self.a = 0 | |
self.b = 1 | |
return self |
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
<?php | |
/** | |
* Simple, custom, bulletproof PHP 7 runtime errors/exceptions handling done right (I hope so :). | |
* By handling I mean logging to systemd journal or stderr, and die if any exception, | |
* error, warning, and even notice or strict occurs. This is not all-in-one | |
* or an ultimate solusion, but a good base to start with. | |
* Logs go to stderr or systemd journal (recommended, but optional). Systemd extension | |
* for PHP can be found at https://github.com/systemd/php-systemd | |
*/ |
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 | |
# Script installs Entware-ng (https://github.com/Entware/Entware-ng) | |
# on Synology DSM 6.2 under /opt directory. | |
# Must be run with sudo. Can be used as a scheduled task on system boot. | |
printf -- "---------------------------\n" | |
printf -- "| Installing Entware-ng.. |\n" | |
printf -- "---------------------------\n" |
OlderNewer