Skip to content

Instantly share code, notes, and snippets.

View iddqd3's full-sized avatar

Vladimir iddqd3

  • Extreme Developers
  • Russia
View GitHub Profile
@iddqd3
iddqd3 / install_octoprint
Created December 5, 2019 20:06
Instal OctoPrint on Fedora Minimal (pine64)
# dnf install gcc
# dnf install redhat-rpm-config
# dnf install python2-devel.aarch64
# dnf install python3-virtualenv
$ mkdir -p venv && cd venv
$ virtualenv -p /usr/bin/python2.7 octoprint && source ./octoprint/bin/activate
(octoprint)$ pip install octoprint
(octoprint)$ octoprint/bin/octoprint serve --host=<ip>
@iddqd3
iddqd3 / check-cert.sh
Last active April 20, 2018 17:00
Check end date SSL certificate (for letsencrypt)
#!/bin/sh
# Check end date certificate
# Using: script.sh example.net
DOMAIN=$1
CERT_DOWNLOAD_PATH=/tmp
PORT=443
ALERT_TIME=604800 # 7 days
Прописываем настройки в файл:
# ~/.ssh/config
Host MyHost
HostName [host-ip]
Port [host-port]
User [host user, usually root]
IdentityFile [path/to/your/ID_RSA, usually ~/.SSH/ID_RSA]
Далее запускаем:
function verify_app_store_in_app($receipt, $is_sandbox)
{
//$sandbox should be TRUE if you want to test against itunes sandbox servers
if ($is_sandbox)
$verify_host = "ssl://sandbox.itunes.apple.com";
else
$verify_host = "ssl://buy.itunes.apple.com";
$json='{"receipt-data" : "'.$receipt.'" }';
//opening socket to itunes
@iddqd3
iddqd3 / SIP-BORDER-CONTROLLER
Last active April 20, 2018 16:53
iptables VOIP sip border controller
# Check voip scanners and block access for that
#
#
#
*filter
:SIP-BORDER-CONTROLLER - [0:0]
# other rules
@iddqd3
iddqd3 / js func sec2humanReadable
Last active December 12, 2015 04:08
Convert seconds to human readable format e.g. 67 = '00:01:07'
function sec2humanReadable(duration){
var hour = 0;
var min = 0;
var sec = 0;
if (duration){
if (duration >= 60){
min = Math.floor(duration / 60);
sec = duration % 60;
}
@iddqd3
iddqd3 / Server.py
Created February 4, 2013 08:01 — forked from jdkanani/Server.py
#!/usr/bin/env python
import os
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
ROUTES = [
('/', '/var/www/doc-html')
]
class MyHandler(SimpleHTTPRequestHandler):