Skip to content

Instantly share code, notes, and snippets.

View obax's full-sized avatar
🎯

Olivier obax

🎯
View GitHub Profile
@obax
obax / private_fork.md
Created March 19, 2023 12:40 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

DO
$do$
BEGIN
IF EXISTS (
SELECT FROM pg_catalog.pg_roles
WHERE rolname = 'eos_app_rw') THEN
RAISE NOTICE 'Role "eos_app_rw" already exists. Skipping.';
ELSE
CREATE USER eos_app_rw;
@obax
obax / list.txt
Created June 16, 2020 13:44 — forked from shortjared/list.txt
List of AWS Service Principals
a4b.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
apigateway.amazonaws.com
application-autoscaling.amazonaws.com
appstream.application-autoscaling.amazonaws.com
appsync.amazonaws.com
@obax
obax / checkwifi.sh
Last active March 10, 2024 15:02
Rebooting the Raspberry Pi when it loses wireless connection
# Source: https://weworkweplay.com/play/rebooting-the-raspberry-pi-when-it-loses-wireless-connection-wifi/
# Save under /usr/local/bin/checkwifi.sh
# The Raspberry Pi tends to drop network connection (especially wireless wifi) rather fast, which is a real pain when you're trying to do anything that has the RPi running constantly from a remote location (like our RaspEye does).
# However, it's possible to detect wifi connection loss and perform upon it. It's easiest to just do a full system reboot.
# Change the IP on the first line to the IP of your router, or some other device on your network that you can assume will be always online.
# First step is to ping your IP.
# On line three, the $? represents the exit code of the previous command, in this case the ping.
#!/usr/bin/env bash
#>>> EC2 user data
yum install -y docker mariadb iptraf-ng htop tmux
# Adding Oli's key (add Dom's and Matilde's)
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxFWqGO98YYuZowuuFF5XPX2hvTMK8C/gz/BVt5GCy60spByJ7j3QVc0YEPdzx1D//fLJAa8T34d9jBJorZqkkHtG7mXCp9kWSC4IluyOosg3Sg1Wd0WBZatboRgRlwMpCXnHOPQxAHdyDgNrpEZIL9B6v5wT95MDc5tITywhirgwRY48jZIjNmzHn8U9DTUCj9qGlAHGU6pTOnvQmjLVy54rIMTgrTykGdHcG1+YTnQq0/TPpM5WzN8Ep7nM7oKeg6+887raZkGb6a2zX0lDNG6LUaQXblJ2vgdHfrrtoHV/jnXo58dXMRoIGt2MliGGGJ5pM8T0EIS36eGk3g6gr obax@BMDIG0012.local" | tee -a /home/ec2-user/.ssh/authorized_keys
# execute as super user
usermod -aG docker ec2-user