sudo apt install build-essential gcc-6 g++-6
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 20
sudo update-alternatives --set gcc /usr/bin/gcc-6
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
@Override | |
public void doRun(SwitchboardConfiguration configuration, Environment environment) throws Exception { | |
Optional<Meter> allLogs = Optional.fromNullable( environment.metrics().getMeters().get("ch.qos.logback.core.Appender.all") ); | |
Optional<Meter> warnLogs = Optional.fromNullable( environment.metrics().getMeters().get("ch.qos.logback.core.Appender.warn") ); | |
Optional<Meter> errorLogs = Optional.fromNullable( environment.metrics().getMeters().get("ch.qos.logback.core.Appender.error") ); | |
if(allLogs.isPresent()) { | |
if(errorLogs.isPresent()) registerLogMeterAsHealthCheck(environment, allLogs.get(), errorLogs.get(), "logged_errors", 0.05D); | |
if(warnLogs.isPresent()) registerLogMeterAsHealthCheck(environment, allLogs.get(), warnLogs.get(), "logged_warns", 0.25D); | |
} |
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
Homebrew build logs for macvim on Mac OS X 10.11.5 | |
Build date: 2016-06-01 15:47:46 |
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 | |
### | |
### NOTE: add cron job that runs every minute using `crontab -e`: | |
### * * * * * ~/joystick-connect.sh | |
### | |
# using a device ID is more secure, but using \t uses first available device | |
DEVICE='\t' | |
#DEVICE='XX:XX:XX:XX:XX:XX' |
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 | |
readonly serial=/dev/ttyS0 | |
function getTime() { | |
# temporarily disable the ntp client | |
service ntp stop | |
# force an immediate time update; with timeout at 30s | |
timeout 30 ntpd -gq |
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 | |
readonly serial=/dev/ttyS0 | |
latlon="$(curl -s ipinfo.io | jq -r '.loc')" | |
lat=$(cut -d, -f1 <<< ${latlon}) | |
lon=$(cut -d, -f2 <<< ${latlon}) | |
location=$(./latlon2celestron.py "${lat}" "${lon}") |
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
# Tastyworks is created using JavaFX, as discovered by glancing through | |
# their java library directory. JavaFX does scale for hi-dpi displays, | |
# but only does this automatically on Mac. To force this behavior on | |
# Ubuntu, manually set the legacy gnome scaling factor that is being | |
# used by JavaFX to detect this state, but I believe is being ignored | |
# by Gnome itself. [https://stackoverflow.com/a/26184471] | |
gsettings set org.gnome.desktop.interface scaling-factor 2 |
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
def main(): | |
raise NotImplementedError() | |
if __name__ == "__main__": | |
try: | |
main() | |
except Exception: | |
import vlc | |
from time import sleep |
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 -ex | |
image=SYSTEM | |
sdcard=/media/${USER}/LIBREELEC | |
path=squashfs-root | |
rm -rf ${image} ${path} | |
cp ${sdcard}/${image} ${image} | |
unsquashfs ${image} |