Skip to content

Instantly share code, notes, and snippets.

@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 / 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
#!/bin/sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@Razikus
Razikus / lxdeBrightness.md
Last active July 29, 2018 06:19
Scripts for lxde for raise and lower brightness by fn keys

/usr/local/bin/setBrightness

#!/bin/bash
if [ $# -eq 0 ]; then
	if [ ! -f ~/brightness ]; then
		echo "1" > ~/brightness
	fi
	BRIGHT=$(cat ~/brightness)
else
	BRIGHT=$1
#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@Razikus
Razikus / debian9javainstall.sh
Last active May 19, 2018 13:22
To anyone who search for debian9 install oracle jdk 8
apt install software-properties-common
add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
apt install dirmngr
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886
apt update
apt install oracle-java8-installer
@Razikus
Razikus / timetochange.sh
Last active May 17, 2018 07:39
To anyone who waits for output change and anyone who wants to calculate estimated time
#!/bin/bash
COMMAND=$@
SECOND="FALSE"
if [ "$1" == "--second" ]; then
SECOND="TRUE"
COMMAND=${@:2}
fi
OUTPUT=$($COMMAND)
NEWOUTPUT=$OUTPUT
a=0
@Razikus
Razikus / autofix.sh
Created March 12, 2018 09:32
Auto fix GPT PMBR size mismatch
echo "Fix" | parted /dev/loop0 ---pretend-input-tty print
# Evaluators
import os
import sys
scripts = os.listdir("./scripts")
scriptsStrings = []
for script in scripts:
src = open("./scripts/" + script).read()
scriptsStrings.append(src)
@Razikus
Razikus / VBoxAdditions.sh
Last active February 1, 2018 08:47
VBoxAdditions requirements for Debian9
apt install linux-headers-$(uname -r)
apt install build-essential module-assistant dkms
usermod -a -G vboxsf YOURUSERNAME