Skip to content

Instantly share code, notes, and snippets.

@Razikus
Razikus / PKDJsonArray
Last active August 26, 2018 11:05
JSON Array of PL PKD codes
[{"code":"01.11.Z","desc":"Uprawa zbóż, roślin strączkowych i roślin oleistych na nasiona, z wyłączeniem ryżu"},{"code":"01.12.Z","desc":"Uprawa ryżu"},{"code":"01.13.Z","desc":"Uprawa warzyw, włączając melony oraz uprawa roślin korzeniowych i roślin bulwiastych"},{"code":"01.14.Z","desc":"Uprawa trzciny cukrowej"},{"code":"01.15.Z","desc":"Uprawa tytoniu"},{"code":"01.16.Z","desc":"Uprawa roślin włóknistych"},{"code":"01.19.Z","desc":"Pozostałe uprawy rolne inne niż wieloletnie"},{"code":"01.21.Z","desc":"Uprawa winogron"},{"code":"01.22.Z","desc":"Uprawa drzew i krzewów owocowych tropikalnych i podzwrotnikowych"},{"code":"01.23.Z","desc":"Uprawa drzew i krzewów owocowych cytrusowych"},{"code":"01.24.Z","desc":"Uprawa drzew i krzewów owocowych ziarnkowych i pestkowych"},{"code":"01.41.Z","desc":"Chów i hodowla bydła mlecznego"},{"code":"01.25.Z","desc":"Uprawa pozostałych drzew i krzewów owocowych oraz orzechów"},{"code":"01.26.Z","desc":"Uprawa drzew oleistych"},{"code":"01.27.Z","desc":"Uprawa roślin wykor
@Razikus
Razikus / dockerize.sh
Created February 5, 2019 10:02
installs docker on arm in version docker-ce=18.06.1~ce~3-0~raspbian
#!/bin/sh
set -e
# This script is meant for quick & easy install via:
# $ curl -fsSL https://get.docker.com -o get-docker.sh
# $ sh get-docker.sh
#
# For test builds (ie. release candidates):
# $ curl -fsSL https://test.docker.com -o test-docker.sh
# $ sh test-docker.sh
@Razikus
Razikus / assets
Created October 10, 2019 19:42
Minecraft 1.14 asset list from index
icons/icon_16x16.png
icons/icon_32x32.png
icons/minecraft.icns
minecraft/icons/icon_16x16.png
minecraft/icons/icon_32x32.png
minecraft/icons/minecraft.icns
minecraft/lang/af_za.json
minecraft/lang/ar_sa.json
minecraft/lang/ast_es.json
minecraft/lang/az_az.json
@Razikus
Razikus / yamlunion.py
Created October 22, 2019 20:29
For the situation, where you have 2 yaml files, one is older, but fits in 50% of bigger, and bigger have just new keys, then you don't want to do something from beginning, and consider the script that will just join 2 files, but take objects that exists from the bigger file, uff.
import ruamel.yaml as yamler
import ruamel
import sys
def main():
resultDict = dict()
if(len(sys.argv) < 4):
print("USAGE: script biggerYaml smallerYaml resultfile")
print("If entry is in smaller yaml - it will go to result")
print("If entry is not in smaller yaml - it will take it from biggerYaml")
sys.exit(1)
#/bin/mount -o bind / writeable/
#/bin/mount -o remount,rw / writeable/
tmpfs /tmp tmpfs nosuid,nodev 0 0
tmpfs /var/log tmpfs nosuid,nodev 0 0
tmpfs /var/tmp tmpfs nosuid,nodev 0 0
proc /proc proc defaults 0 0
PARTUUID=x /boot vfat defaults,ro 0 2
PARTUUID=xx / ext4 defaults,noatime,ro 0 1
[{"id":"9f1559dc.1c6748","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"dff0b9e8.e718a8","type":"ui_template","z":"9f1559dc.1c6748","group":"5b65b30a.de7e4c","name":"","order":0,"width":0,"height":0,"format":"<img src=\"{{msg.payload}}\"/>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":540,"y":380,"wires":[[]]},{"id":"d6aa0132.a2191","type":"mqtt in","z":"9f1559dc.1c6748","name":"","topic":"testtest","qos":"2","datatype":"auto","broker":"27edd438.632cac","x":280,"y":380,"wires":[["dff0b9e8.e718a8"]]},{"id":"86450727.888b18","type":"inject","z":"9f1559dc.1c6748","name":"","topic":"","payload":"https://www.testhr.pl/img/logo.png","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":300,"wires":[["1aec40e6.85496f"]]},{"id":"1aec40e6.85496f","type":"mqtt out","z":"9f1559dc.1c6748","name":"","topic":"testtest","qos":"","retain":"","broker":"27edd438.632cac","x":570,"y":300,"wires":[]},{"id":"b66b8ef8.f4fa9","type":
<style>
body {
background: url("{{msg.payload}}") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#Home_Default {
display: none;
version: '2'
services:
traefik:
build:
context: traefik
dockerfile: Dockerfile.template
command:
- --entrypoints.web.address=:80
- --providers.docker=true
- --providers.docker.exposedbydefault=false
@Razikus
Razikus / main.py
Last active July 6, 2022 17:33
immudb example for creating table with index
from immudb import ImmudbClient
import time
class ExampleClient:
def __init__(self, immudbUrl, login, password, database):
self.immudbUrl = immudbUrl
self.login = login
self.password = password
self.database = database
self.client = ImmudbClient(immudbUrl)
@Razikus
Razikus / pagination.py
Last active November 15, 2023 19:26
Simple pagination in immudb
from immudb.client import ImmudbClient
import uuid
MAX_N = 2000
def main():
client = ImmudbClient("localhost:3322")
client.login("immudb", "immudb", "defaultdb")
client.sqlExec("""CREATE TABLE IF NOT EXISTS pagination( ID INTEGER AUTO_INCREMENT, VALUE VARCHAR[255], PRIMARY KEY(ID) )""")
for index in range(0, MAX_N):
print("Adding records...", index, f"{round((index / MAX_N) * 100, 2)}%")