Skip to content

Instantly share code, notes, and snippets.

View JakWai01's full-sized avatar
🌅

Jakob Waibel JakWai01

🌅
View GitHub Profile
@JakWai01
JakWai01 / main.sh
Created March 6, 2021 10:48
Installation of k3s on a determined network interface using Debian 10
# On the first host
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --node-ip=192.168.100.1 --flannel-iface=edge0" sh -
cat /var/lib/rancher/k3s/server/node-token # Find the token here
# On the second host
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="agent --token=K108fda6a9dcd1995b3b93d53468d918df95ef5cc0c763846240ebf3a6baa8c8e62::server:7ccc91c12c8ae498b200a390e02533f6 --node-ip=192.168.100.2 --server=https://192.168.100.1:6443 --flannel-iface=edge0" sh -
@JakWai01
JakWai01 / main.sh
Created March 6, 2021 10:49
n2n installation on Debian 10
# On both hosts
curl -L -o /tmp/apt-ntop-stable.deb https://packages.ntop.org/apt-stable/buster/all/apt-ntop-stable.deb
apt install -y /tmp/apt-ntop-stable.deb
apt update
apt install -y n2n
# On the first host (104.248.195.171)
supernode -l 7777
edge -A3 -c code-and-chill -k cacpass -a 192.168.100.1 -f -l 104.248.195.171:7777
# On the second host
edge -A3 -c code-and-chill -k cacpass -a 192.168.100.2 -f -l 104.248.195.171:7777
@JakWai01
JakWai01 / supernode.service
Created March 6, 2021 15:04
Systemd service to setup a n2n supernode
[Unit]
Description=Starting n2n supernode
[Service]
ExecStart=/usr/sbin/supernode -l 7777
Restart=on-failure
[Install]
WantedBy=multi-user.target
@JakWai01
JakWai01 / vpn.service
Created March 6, 2021 15:06
Systemd service to connect to a n2n supernode
[Unit]
Description=Connecting to supernode
[Service]
ExecStart=/usr/sbin/edge -A3 -c name -k password -a 192.168.100.1 -f -l 168.119.56.189:7777
Restart=on-failure
[Install]
WantedBy=multi-user.target
package appl_alg_interpreter;
import java.io.File;
public class ExpressionParser {
static ProgramScanner psc;
static String NAME = "[a-zA-Z_][a-zA-Z_0-9]*";
static String NUMBER = "(^|\\s+)((\\-?[0-9]+(\\.[0-9]*)?)|(-?\\.[0-9]+))($|\\s+)";
package appl_alg_interpreter;
import java.io.File;
public class ExpressionParser {
static ProgramScanner psc;
static String NAME = "[a-zA-Z_][a-zA-Z_0-9]*";
static String NUMBER = "(^|\\s+)((\\-?[0-9]+(\\.[0-9]*)?)|(-?\\.[0-9]+))($|\\s+)";
package appl_alg_interpreter;
import java.io.File;
public class ExpressionParser {
static ProgramScanner psc;
static String NAME = "[a-zA-Z_][a-zA-Z_0-9]*";
static String NUMBER = "(^|\\s+)((\\-?[0-9]+(\\.[0-9]*)?)|(-?\\.[0-9]+))($|\\s+)";
package Main;
import java.io.IOException;
import java.util.Scanner;
/**
* Main class of this program
* @version 1.0.0
* @author Jakob Waibel, Maximilian Dolbaum, Lukas Kleinau
*/
public static void main( String[] args ) throws IOException {
BufferedReader fileReader = new BufferedReader(new FileReader("/home/jakobwaibel/IdeaProjects/test-push/src/main/java/org/example/test.txt"));
String currentLine;
while (((currentLine = fileReader.readLine()) != null)) {
System.out.println(currentLine);
}
}
@JakWai01
JakWai01 / netcat
Created August 25, 2021 08:08
Send string via netcat
echo '{"opcode":"ready", "mac":"1235"}' | netcat -N localhost 8080