This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -a /Applications/YakYak.app/Contents/Info.plist ] | |
then | |
YAK_INSTALLED=1 | |
YAK_CUR_VERS=$(cat /Applications/YakYak.app/Contents/Info.plist | grep -A1 CFBundleVersion | grep '<string' | cut -f2 -d">"|cut -f1 -d"<" | tr -d '.') | |
else | |
YAK_INSTALLED=0 | |
YAK_CUR_VERS=0 | |
fi | |
YAK_STABLE_VERS=$(curl -sL https://github.com/yakyak/yakyak/releases/latest | grep -we "yakyak/yakyak/releases/download/.*/yakyak-osx.app.zip" | awk -F'\/' '{print $6}' | tr -d '.' | tr -d 'v') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################## | |
## A NOTE ABOUT YOUR SCRIPT ## | |
################################################################################## | |
VARIABLE="MyString123" | |
FILE_NAME="${VARIABLE}.txt" | |
EMPTY_ARRAY=() | |
COMMAND_OUTPUT=$(echo $VARIABLE) #MyString123 | |
BACK_TRIMMED_VARIABLE=${VARIABLE::(-1)}; #MyString12 | |
FRONT_TRIMMED_VARIABLE=${VARIABLE:(1)}; #yString123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
check_connection(){ | |
checkMyIP='' | |
checkGoogle='' | |
checkMyIP=$(curl -s icanhazip.com | egrep [0-9] | head -n1 | wc -l) | |
checkGoogle=$(curl -s google.com | grep HEAD | head -n1 | wc -l) | |
internetHealth=$(echo $checkMyIP+$checkGoogle|bc) | |
printf "$internetHealth" | |
} | |
timestamp() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
agentAddr="$1" | |
#use zabbix server address here if you're not in aws using an ENI | |
eniAddr=10.10.10.5 | |
sanityCheck=$(zabbix_get -s ${agentAddr} -k system.run["service zabbix-agent status"] -I ${eniAddr} 2>&1) | |
isSane=$(echo "$sanityCheck" | grep ZBX_NOTSUPPORTED | wc -l) | |
if [ $isSane -lt 1 ] | |
then | |
agentRestart=$(zabbix_get -s ${agentAddr} -k system.run["service zabbix-agent restart",nowait] -I ${eniAddr} && sleep 2) | |
isRunning=$(zabbix_get -s ${agentAddr} -k system.run["service zabbix-agent status"] -I ${eniAddr} 2>/dev/null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#run as root | |
fileList=$(grep -nir "f07746" /usr/ | awk -F: '{print $1}' | sort -u) | |
for file in "$fileList"; | |
do | |
sed -i 's/f07746/023c88/g' $file; | |
sed -i 's/F07746/023c88/g' $file; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;how to update an eeprom setting on repetier | |
;get list of settings: | |
M205 | |
;example line: | |
;Recv: EPR:3 145 210.000 X max length [mm] | |
;Update position 145 with 230.0 | |
M206 T3 P145 X230.0 | |
;save configuration | |
M500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
thingid=${1} | |
descr=$(curl -s https://www.thingiverse.com/thing:${thingid} | grep -A1 "dc:title" | tail -n1 | tr -s " " | sed 's/<\/span>//g' | tr -cd 'A-Za-z0-9_-') | |
zipURL="https://www.thingiverse.com/thing:${thingid}/zip" | |
dlDir="$(dirname "$0")/thing_files" | |
mkdir -p ${dlDir}/${descr} | |
echo "Writing file: ${dlDir}/${descr}/${descr}.zip" | |
curl -sL ${zipURL} -o ${dlDir}/${descr}/${descr}.zip | |
cd ${dlDir}/${descr}/ | |
unzip ${descr}.zip && rm -f ${descr}.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#apt-get install -y i2c-tools python-smbus vim | |
#pip3 install --upgrade setuptools | |
#pip3 install RPI.GPIO adafruit-blinka adafruit-circuitpython-charlcd netifaces | |
import board | |
import digitalio | |
import busio | |
import os | |
import socket | |
import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd | |
import netifaces as ni |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gpg --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 8B48AD6246925553 | |
gpg --armor --export 7638D0442B90D010 | apt-key add - | |
gpg --armor --export 8B48AD6246925553 | apt-key add - |