Skip to content

Instantly share code, notes, and snippets.

@analogic
analogic / main.go
Created Sep 15, 2020
Hongyuv ultrasonic anemometer + RPI RS486 HAT
View main.go
package main
import (
"bytes"
"encoding/binary"
"fmt"
"time"
)
import "github.com/goburrow/modbus"
View continent-codes.json
[
{
"Code":"AF",
"Name":"Africa"
},
{
"Code":"AN",
"Name":"Antarctica"
},
{
View country-codes.json
[
{
"country-name": "Afghanistan",
"iso2": "AF",
"iso3": "AFG",
"top-level-domain": "af",
"fips": "AF",
"iso-numeric": "004",
"geonameid": "1149361",
"e164": "93",
View gist:59f9eda7f0d50f578b7f72ce87d00076
#!/bin/bash
cp -Rp /data/mailserver/log/dmarc/analogic.cz /tmp/dmarc-analogic.cz
cp -Rp /data/mailserver/log/dmarc/ranky.cz /tmp/dmarc-poste.io
cd /tmp/dmarc-analogic.cz
rename 's/humplik\.cz/analogic.cz/g' *
find . -type f -name '*' -exec bash -c 't=$(stat -c %y "$0"); sed -i -e "s/humplik\.cz/analogic.cz/g" "$0"; touch -d "$t" "$0"' {} \;
rm -Rf /data/mailserver-demo/log/dmarc/analogic.cz
mv /tmp/dmarc-analogic.cz /data/mailserver-demo/log/dmarc/analogic.cz
View huawei-pwd-aes256.py
"""
Decoder for the Huawei AES256 encryption scheme. Further details are
available at the following URL:
http://blog.emaze.net/2013/12/yet-another-huawei-weak-password.html
Author: Roberto Paleari (@rpaleari)
"""
from Crypto.Cipher import AES
@analogic
analogic / creditas.php
Created Jun 4, 2019
Minimalistic Creditas Bank API client
View creditas.php
<?php
class Creditas {
private $id;
private $secret;
public function __construct(string $id, string $secret)
{
$this->id = $id;
@analogic
analogic / .drone.yml
Created Mar 18, 2019
Moving from cloud.docker.com autobuild+autotest to drone.io (repository must be privileged!§)
View .drone.yml
kind: pipeline
name: default
steps:
- name: test
image: docker:dind
privileged: true
pull: true
volumes:
- name: dockersock
@analogic
analogic / autolink.dart
Created Oct 15, 2018
Flutter method to create text with autodetected links
View autolink.dart
@analogic
analogic / radacct.sql
Last active Feb 27, 2018
FreeRADIUS Accounting per month
View radacct.sql
CREATE TABLE IF NOT EXISTS `data_month` (
`calledstationid` VARCHAR(50),
`in_octets` BIGINT(20) DEFAULT 0,
`out_octets` BIGINT(20) DEFAULT 0,
`year` INT(4),
`month` INT(2),
`last_update` DATETIME,
PRIMARY KEY (`calledstationid`, `year`, `month`)
) ENGINE MyISAM;
@analogic
analogic / data-raw.sql
Created Feb 27, 2018
FreeRadius Accounting
View data-raw.sql
CREATE TABLE IF NOT EXISTS `data_raw` (
`acctsessionid` varchar(32) COLLATE utf8_czech_ci DEFAULT NULL,
`username` varchar(64) COLLATE utf8_czech_ci DEFAULT NULL,
`nasipaddress` varchar(15) COLLATE utf8_czech_ci DEFAULT NULL,
`acctsessiontime` int(11) DEFAULT NULL,
`acctinputoctets` bigint(20) DEFAULT NULL,
`acctoutputoctets` bigint(20) DEFAULT NULL,
`prev_acctsessiontime` int(11) DEFAULT NULL,
`prev_acctinputoctets` bigint(20) DEFAULT NULL,
`prev_acctoutputoctets` bigint(20) DEFAULT NULL,
You can’t perform that action at this time.