This file contains hidden or 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
all: migen | |
deps: | |
sudo yum install git make gcc gcc-c++ | |
icestorm: deps | |
sudo yum install -y python3 libftdi-devel \ | |
&& git clone https://github.com/cliffordwolf/icestorm \ | |
&& cd icestorm \ | |
&& make -j $(nproc) \ |
This file contains hidden or 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 | |
sudo apt-get -y remove docker docker-engine docker.io | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" # No cosmic yet? | |
sudo apt update | |
sudo apt-get -y install docker-ce |
This file contains hidden or 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
FROM ubuntu | |
ENV TZ=UTC | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
ENV DEBIAN_FRONTEND=noninteractive | |
#^ Really, ubuntu? (tzdata hanging) | |
RUN apt-get update && apt-get -y install bison build-essential clang cmake flex gawk git graphviz gtkwave libboost-all-dev libffi-dev libftdi-dev libreadline-dev python3 python3-dev python3-setuptools qt5-default tcl-dev xdot | |
RUN git clone https://github.com/cliffordwolf/icestorm && cd icestorm && make -j $(nproc) && make install | |
RUN git clone https://github.com/YosysHQ/nextpnr && cd nextpnr && cmake -DARCH=ice40 . && make -j $(nproc) && make install |
This file contains hidden or 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
cd /var/lib/machines | |
debootstrap stable ./debian https://mirrors.kernel.org/debian | |
systemd-nspawn -M debian | |
echo 'deb https://deb.debian.org/debian-security stable/updates main' >> /etc/apt/sources.list | |
apt update && apt -y upgrade | |
apt install -y sudo | |
useradd -mUG sudo -s /bin/bash debian #kind of pointless. | |
passwd -d debian |
This file contains hidden or 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/sh | |
umask 77 | |
TMPDIR=$(mktemp -d) | |
HOST="${1}" | |
cd ${TMPDIR} | |
for TYPE in dsa ecdsa ed25519 rsa; do | |
# ssh-key{gen,scan} are very smart and their outputs are not directly compatible, very cool |
This file contains hidden or 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/sh | |
CLIENT="${1}" | |
IP="${2}" | |
if [ -z "${CLIENT}" ]; then | |
exit 1 | |
fi | |
cd /etc/openvpn |
This file contains hidden or 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/sh | |
print_help() { | |
echo "A script to copy ssh host keys via SCP and sign them with a local SSH CA" | |
echo | |
echo "Simple usage: ${0} -h <host>" | |
echo "The following options are accepted:" | |
echo " -h: specify the host" | |
echo " -H: override the hostname for SCP (default: same as -h)" | |
echo " -s: override location of CA privkey (default: /etc/ssh/ca)" |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
fbarr := []string { "%[2]sFizzBuzz", "%[1]d", "%[1]d", | |
"%[2]sFizz" , "%[1]d", "%[2]sBuzz", | |
"%[2]sFizz" , "%[1]d", "%[1]d", |
This file contains hidden or 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
package main | |
import ( | |
"os" | |
"bufio" | |
"fmt" | |
) | |
// double curly brackets to provide arbitrary scoping for variable shadowing. | |
// this is rather disgusting, but cleaner than repeat casts or more vars. |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"os" | |
"bufio" | |
"strings" | |
) | |
func atofw(in string) (out string) { |
OlderNewer