Skip to content

Instantly share code, notes, and snippets.

View broo0ose's full-sized avatar

broo0ose

  • UK
View GitHub Profile
@broo0ose
broo0ose / SessionManager.ps1
Last active March 17, 2023 11:45
Creates a tunnel using AWS session manager to an AWS instance so that you can connect with a local client over the tunnel. e.g. RDP from your PC.
# Creates a tunnel using AWS session manager to an AWS instance so that you can connect with a local client over the tunnel
# https://github.com/broo0ose 24/08/2021
# pre-reqs for this script
# - AWS CLI environment on powershell
# - the AWS Session Manager plugin https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
# - I use SSO to connect to AWS so I needed to use 'aws configure sso' to the correct account and profile.
# - logged in using 'aws login sso' Or however you connect to AWS, eg IAM account.
# - the instance must be set up to use AWS Session Manager, and you must have the rights to run the client connection eg. remote admin group.
@broo0ose
broo0ose / headless wifi pi config
Last active August 27, 2018 22:06
headless wifi pi config
+ write raspbian to the card
+ create a file called ssh in the boot partition (the only bit you can see in Windows),
No extension, right click properties make sure it is not ending in .txt ot anything like that.
+ using Notepad++ create a file called wpa_supplicant.conf in the boot partition.
+ paste this into the file changing it for your WiFi parameters
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
@broo0ose
broo0ose / ener_pi.py
Last active December 21, 2015 22:47
quick script to control energenie equipped raspberry pi from the command line.
#!/usr/bin/env python3
# needs python v3 for argparse
# needs energenie module from https://pythonhosted.org/energenie/
from energenie import switch_on, switch_off
import argparse
parser = argparse.ArgumentParser()
# TOGGLE -u UNIT_NUMBER
in_thread do
loop do
sample :drum_heavy_kick
sleep 0.5
end
end
in_thread do
loop do
sleep 0.5
@broo0ose
broo0ose / noPowerSaveWiFi.sh
Last active August 29, 2015 14:14
Stabilise Edimax WiFi on Raspberry Pi, disables power saving
# info from http://www.averagemanvsraspberrypi.com/2014/10/how-to-set-up-wifi-on-raspberry-pi.html
# I just made it a one-liner.
echo 'options 8192cu rtw_power_mgnt=0 rtw_enusbss=0 rtw_ips_mode=1' | sudo tee /etc/modprobe.d/8192cu.conf