git reset --hard HEAD
git clean -f -d
git checkout master
git fetch origin master
git reset --hard origin/master
git pull
git submodule update
git submodule update --init --recursive
git submodule foreach git reset --hard HEAD
git submodule foreach git clean -f -d
from flask import Flask, abort, request | |
from werkzeug.utils import secure_filename | |
import os | |
import requests | |
import json | |
# change this to set where you want the file to be saved | |
UPLOAD_FOLDER = "./" | |
# change this to only allow files with a given extension to be accepted |
Use-case:
I have two servers running on my host instance.
The first, step-ca running on local port 1442.
The second, an ACL server running on local port 2443.
Each server terminates TLS directly.
I want both servers accessable from the public internet on port 443.
In this case, I have two DNS A records pointing to the same public IP address of the host instance.
I want requests to the CA @ https://ca.mydomain.io to be passed through to localhost:1443.
https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html
chroot improved.
on arch - i needed qemu-user-static AUR. it takes FOREVER to biuld.
the conf files were absent and so systemd-binfmt (instead of binfmt-support) was failing to load. followed this and resolved: https://github.com/computermouth/qemu-static-conf/blob/master/README.md
create loopback of the raspberrypi.img file
sudo losetup -P -f --show some/path/to/raspbian.img
assuming loop0, mount the boot and rootfs
sudo mkdir-P /mnt/rpi
default-lease-time 86400; | |
max-lease-time 86400; | |
authoritative; | |
log-facility local7; | |
subnet 172.17.1.0 netmask 255.255.255.0{ | |
range 172.17.1.100 172.17.1.200; |
sudo apt-get install python3-dev libffi-dev libssl-dev -y | |
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz | |
tar xJf Python-3.6.3.tar.xz | |
cd Python-3.6.3 | |
./configure | |
make | |
sudo make install | |
sudo pip3 install --upgrade pip |
Suppose you opened a file in the Vim editor, made a lot of changes, and then when you tried saving those changes, you got an error that made you realize that it's a root-owned file, meaning you need to have sudo privileges to save these changes.
:w !sudo tee %
The aforementioned command will ask you for root password, and then let you save the changes.
# predictable enumeration based on physical port the usb serial adapter is plugged into | |
# Hardware : BCM2835 raspberry pi 3b | |
# Revision : a02082 | |
# view looking at the ports of the pi | |
# usbSerial0 usbSerial1 | |
# usbSerial2 usbSerial3 | |
KERNELS=="1-1.2", SUBSYSTEMS=="usb", SUBSYSTEM=="tty", ATTRS{devpath}=="1.2", SYMLINK+="usbSerial0", GROUP="dialout", MODE="0666" | |
KERNELS=="1-1.3", SUBSYSTEMS=="usb", SUBSYSTEM=="tty", ATTRS{devpath}=="1.3", SYMLINK+="usbSerial2", GROUP="dialout", MODE="0666" | |
KERNELS=="1-1.4", SUBSYSTEMS=="usb", SUBSYSTEM=="tty", ATTRS{devpath}=="1.4", SYMLINK+="usbSerial1", GROUP="dialout", MODE="0666" |
This first example assumes two usb serial port adapters are connected to the host machine. They enumerate as ttyUSB0 and ttyUSB1. | |
We want data coming into ttyUSB0 to be piped right back out of ttyUSB1 (so our host sits as a man in the middle). | |
We want an application running on the host to be able to connect to a com port and monitor the traffic. | |
# create the fifo | |
sudo mkfifo -m 777 /tmp/fifo | |
# stream serial data on /dev/ttyUSB0 to the fifo AND a virtual com port /tmp/relay | |
sudo socat /dev/ttyUSB0,raw,echo=0 system:'sudo tee /tmp/fifo | sudo socat - "pty,raw,echo=0,link=/tmp/relay"' & |