Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Raźniewski Razikus

View GitHub Profile
View put_archive-docker-py.py
import tarfile
import uuid
import StringIO
import docker
def main():
client = docker.from_env()
container = client.containers.get(uuidOfContainer)
toSave = "blablabla"
@Razikus
Razikus / script.sh
Created Jan 25, 2018
Create id_rsa and id_rsa.pub, force overwrite existing key
View script.sh
echo -e 'y\n' | ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''
@Razikus
Razikus / VBoxAdditions.sh
Last active Feb 1, 2018
VBoxAdditions requirements for Debian9
View VBoxAdditions.sh
apt install linux-headers-$(uname -r)
apt install build-essential module-assistant dkms
usermod -a -G vboxsf YOURUSERNAME
View executeAllScriptsInDirectoryWithArguments.py
# Evaluators
import os
import sys
scripts = os.listdir("./scripts")
scriptsStrings = []
for script in scripts:
src = open("./scripts/" + script).read()
scriptsStrings.append(src)
@Razikus
Razikus / autofix.sh
Created Mar 12, 2018
Auto fix GPT PMBR size mismatch
View autofix.sh
echo "Fix" | parted /dev/loop0 ---pretend-input-tty print
@Razikus
Razikus / timetochange.sh
Last active May 17, 2018
To anyone who waits for output change and anyone who wants to calculate estimated time
View timetochange.sh
#!/bin/bash
COMMAND=$@
SECOND="FALSE"
if [ "$1" == "--second" ]; then
SECOND="TRUE"
COMMAND=${@:2}
fi
OUTPUT=$($COMMAND)
NEWOUTPUT=$OUTPUT
a=0
@Razikus
Razikus / debian9javainstall.sh
Last active May 19, 2018
To anyone who search for debian9 install oracle jdk 8
View debian9javainstall.sh
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
View prereqs-ubuntu.sh
#!/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 / lxdeBrightness.md
Last active Jul 29, 2018
Scripts for lxde for raise and lower brightness by fn keys
View lxdeBrightness.md

/usr/local/bin/setBrightness

#!/bin/bash
if [ $# -eq 0 ]; then
	if [ ! -f ~/brightness ]; then
		echo "1" > ~/brightness
	fi
	BRIGHT=$(cat ~/brightness)
else
	BRIGHT=$1
View cleaner
#!/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