Skip to content

Instantly share code, notes, and snippets.

View koter84's full-sized avatar

Dennis Koot koter84

View GitHub Profile
@koter84
koter84 / speedtest.sh
Last active June 30, 2022 05:30
do a simple speedtest from commandline
#!/bin/bash
links=(
"http://mirror.nl.leaseweb.net/speedtest/1000mb.bin"
"http://download.xs4all.nl/test/1GB.bin"
"http://ftp.snt.utwente.nl/pub/test/1000M"
"http://www.colocenter.nl/speedtest/1000mb.bin"
"http://speed.transip.nl/1000mb.bin"
"http://mirror.widexs.nl/ftp/pub/speed/1000mb.bin"
"http://mirror.nforce.com/pub/speedtests/1000mb.bin"
@koter84
koter84 / update_arduino.sh
Last active December 27, 2017 22:30
Install Arduino-IDE
#!/bin/bash
# get current dir
arduino_dir="/opt/$(ls /opt/ | grep arduino | grep -v tar)"
if [ "$arduino_dir" == "/opt/" ]
then
arduino_dir=""
fi
echo "Arduino DIR: $arduino_dir"
arduino_dir_version=$(echo $arduino_dir | sed 's/.*arduino-//')
@koter84
koter84 / update_teamviewer.sh
Last active February 21, 2017 10:17
download the stand-alone version of teamviewer and link the desktop-file
#!/bin/bash
# get current dir
prog_dir="/opt/$(ls /opt/ | grep teamviewer | grep -v tar)"
if [ "$prog_dir" == "/opt/" ]
then
prog_dir=""
fi
echo "DIR: $prog_dir"
if [ -f $prog_dir/teamviewer ]
@koter84
koter84 / truecolor.sh
Created July 25, 2016 14:04
test for true-color in the terminal
#!/bin/bash
awk 'BEGIN{
s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
for (colnum = 0; colnum<77; colnum++) {
r = 255-(colnum*255/76);
g = (colnum*510/76);
b = (colnum*255/76);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
@koter84
koter84 / reverser.sh
Last active October 31, 2016 12:55
reverse the filename for the current dir
#!/bin/bash
if [ "$1" != "" ]
then
dir=$1
else
dir=$GIST_PWD
fi
cd "$dir"
@koter84
koter84 / update_gitkraken.sh
Last active April 16, 2019 18:29
updater for GitKraken
#!/bin/bash
# get current dir
prog_dir="/opt/$(ls /opt/ | grep gitkraken | grep -v tar)"
if [ "$prog_dir" == "/opt/" ]
then
prog_dir=""
fi
echo "DIR: $prog_dir"
if [ -f $prog_dir/gitkraken ]
@koter84
koter84 / update_mqttfx.sh
Last active April 23, 2017 21:22
updater for MQTTfx
#!/bin/bash
# get current dir
prog_dir="/opt/$(ls /opt/ | grep MQTTfx)"
echo "DIR: $prog_dir"
prog_dir_version=$(grep 'app\.version' /opt/MQTTfx/app/MQTTfx.cfg | sed s/app.version=//)
echo "DIR Version: $prog_dir_version"
# get current url
prog_url=$(curl -s http://mqttfx.jensd.de/index.php/download | sed 's/<a/\n<a/g' | grep '^<a' | grep Version | head -n1 | sed 's/.*http/http/g' | cut -d'"' -f1)
@koter84
koter84 / update_fwbuilder.sh
Last active November 7, 2024 11:48
updater for fwbuilder
#!/bin/bash
if [ -d /opt/fwbuilder-5.1.0.3599 ]
then
echo "removing deprecated version"
rm -rf /opt/fwbuilder-5.1.0.3599
fi
if [ ! -d /opt/fwbuilder/build ]
then
@koter84
koter84 / update_topiconsplus.sh
Created February 7, 2017 09:37
Updater for Gnome Shell Extension TopIcons-Plus
#!/bin/bash
# check version
prog_dir_version=$(grep \"version\" ~/.local/share/gnome-shell/extensions/[email protected]/metadata.json | awk '{ print $2 }' | sed s/,//g)
echo "DIR Version: $prog_dir_version"
prog_url="https://raw.githubusercontent.com/phocean/TopIcons-plus/master/metadata.json"
prog_url_version=$(curl -s $prog_url | grep \"version\" | awk '{ print $2 }' | sed s/,//g)
echo "URL Version: $prog_url_version"
@koter84
koter84 / update_etcher.sh
Last active August 31, 2018 09:53
updater for etcher.io
#!/bin/bash
# get current dir
prog_dir="/opt/$(ls /opt/ | grep etcher | grep -v zip)"
echo "DIR: $prog_dir"
prog_dir_version=$(echo $prog_dir | awk -F/ '{ print $3 }' | awk -F- '{ print $2 }')
if [ "$prog_dir_version" == "electron" ]
then
prog_dir_version=$(echo $prog_dir | awk -F/ '{ print $3 }' | awk -F- '{ print $3 }')
fi