On the server, edit the file /etc/ssh/sshd_config:
ClientAliveInterval 30
ClientAliveCountMax 10
| # iptables basic rules to use (in order) | |
| # set default policy to drop | |
| iptables -P INPUT DROP | |
| iptables -P OUTPUT ACCEPT | |
| iptables -P FORWARD ACCEPT | |
| # enable ssh on port 22 | |
| iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT |
| # Generated by iptables-save v1.4.14 on Wed May 14 23:43:26 2014 | |
| *filter | |
| :INPUT ACCEPT [0:0] | |
| :FORWARD ACCEPT [0:0] | |
| :OUTPUT ACCEPT [0:0] | |
| # accept all loop traffic, discard all malicious localloop traffic | |
| -A INPUT -i lo -j ACCEPT | |
| -A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable |
| #!/bin/bash | |
| # Secure OpenVPN server installer for Debian, Ubuntu, CentOS and Arch Linux | |
| # https://github.com/Angristan/OpenVPN-install | |
| if [[ "$EUID" -ne 0 ]]; then | |
| echo "Sorry, you need to run this as root" | |
| exit 1 | |
| fi |
Tool for creating isolated Python environments
The common use-cases:
| // | |
| // "Pacifica" | |
| // Gentle, blue-green ocean waves. | |
| // December 2019, Mark Kriegsman and Mary Corey March. | |
| // For Dan. | |
| // | |
| #define FASTLED_ALLOW_INTERRUPTS 0 | |
| #include <FastLED.h> | |
| FASTLED_USING_NAMESPACE |
| # --------- SCRIPT BEGIN ---------- | |
| # By Bret Stateham | |
| # This script assumes | |
| # - You are running on a linux machine | |
| # - You have the can-utils installed and working. See: | |
| # - https://github.com/linux-can/can-utils | |
| # - https://www.kernel.org/doc/Documentation/networking/can.txt | |
| # - You have a can device attached and configured as can0 (you can change the targetbus variable to match if otherwise) | |
| # - The can device is attached to your running target vehicle |
| #include <string> | |
| #include <ctime> | |
| #include <msgpack.hpp> | |
| struct message | |
| { | |
| std::string tag; | |
| std::time_t time; | |
| std::string text; | |
| MSGPACK_DEFINE(tag, time, text); |
| # capture mjpegstream -r Framerate | |
| ffmpeg -f mjpeg -r 2 -i "http://127.0.0.1/rpicam/cam_pic_new.php?" -r 2 ./video.avi |