This guide has moved to a GitHub repository to enable collaboration and community input via pull-requests.
https://github.com/alexellis/k8s-on-raspbian
Alex
if __name__ == '__main__': | |
env = gym.make('Mario-Kart-Luigi-Raceway-Multi-v0') | |
obs = env.reset() | |
env.render() | |
while not end_episode: | |
# Action should be multi-threaded + setting agent | |
for i in range(num_agents): | |
agent = i+1 |
# Inspired by https://medium.com/@tuzzer/cart-pole-balancing-with-q-learning-b54c6068d947 | |
import gym | |
import numpy as np | |
import math | |
from collections import deque | |
class QCartPoleSolver(): | |
def __init__(self, buckets=(1, 1, 6, 12,), n_episodes=1000, n_win_ticks=195, min_alpha=0.1, min_epsilon=0.1, gamma=1.0, ada_divisor=25, max_env_steps=None, quiet=False, monitor=False): | |
self.buckets = buckets # down-scaling feature space to discrete range |
This guide has moved to a GitHub repository to enable collaboration and community input via pull-requests.
https://github.com/alexellis/k8s-on-raspbian
Alex
#!/bin/bash | |
# This bash script outputs the status of your Pi and checks whether you are being throttled for undervoltage and gives you your temperature | |
# Article and discussion at https://jamesachambers.com/measure-raspberry-pi-undervoltage-true-clock-speeds/ | |
# Author James A Chambers 6-6-17 | |
# Output current configuration | |
vcgencmd get_config int | egrep "(arm|core|gpu|sdram)_freq|over_volt" | |
# Measure clock speeds | |
for src in arm core h264 isp v3d; do echo -e "$src:\t$(vcgencmd measure_clock $src)"; done |
sudo apt-get install apt-transport-https ca-certificates
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update
sudo apt-get install syncthing
sudo apt-get install git
Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:
Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.
Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.
Instructions provided for both Fedora and Ubuntu (including Debian):
Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:
# Ensure PacketFilter is running | |
service { 'pfctl': | |
ensure => 'running', | |
provider => base, | |
restart => 'pfctl -d && pfctl -F all && pfctl -f /etc/pf.conf && pfctl -e', | |
start => 'pfctl -f /etc/pf.conf && pfctl -e', | |
status => "echo \"pfctl -s info 2>/dev/null | grep Status | [ $(awk '{print \$2}') == Enabled ]\" | bash", | |
stop => 'pfctl -d', | |
} |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
More details - http://blog.gbaman.info/?p=791
For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt
file dtoverlay=dwc2
on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh
in the SD card as well. By default SSH i
[Unit] | |
Description=Errbot | |
After=network.target | |
[Service] | |
Type=forking | |
User=errbot | |
Environment="CONFIGFILE=/etc/errbot/config.py" | |
ExecStart=/usr/local/bin/errbot --daemon --config $CONFIGFILE | |
ExecStop=/bin/kill -SIGINT $MAINPID |