Skip to content

Instantly share code, notes, and snippets.

View cob16's full-sized avatar

Cormac Brady cob16

View GitHub Profile
refrain = ' bottles of beer'
refrain1 = ' on the wall! '
bottles = 99
bottles.downto(1) do |i|
puts i.to_s + refrain + refrain1 + i.to_s + refrain
puts 'you take one down, pass it around'
puts (i-1).to_s + refrain + refrain1
cob16 /
Created February 16, 2017 11:25
Python Data structure for storing a packet of bits into a long with mappings
from enum import Enum
import bits_mod
would use 'pyserial' and bits_mod (or more useful rewrite)
This allows us to store the packet inside a long. perhaps the most dense data structure for this problem
class EndBit(Enum):
cob16 /
Created February 18, 2018 11:09
Disable drag lock / click lock linux fedora

Disable drag / click lock on linux

This can somtimes show up when you are playing games that require longclicking of both mouse buttons. (I found this when playing the heavyweapons in tf2)

Use xinput list to find your device id

Then use xinpit list-props <ID> to find the relevent property name to set.

You can then set the property to 0 to disable it ether by using the device and property name like so

cob16 / Fadora
Last active January 13, 2020 13:49
TF2 Linux Fadora 26 HRTF setup

Install openal

sudo dnf install openal-soft.i686 openal-soft.x86_64

Now we need to point steam to use these more up to date vershions of open al To find where dnf installed our files we can run: rpm -q --filesbypkg openal-soft.i686 openal-soft.x86_64 | grep$ On fadora 26 I got:

openal-soft               /usr/lib/
openal-soft /usr/lib64/

A guide to setting up cloudwatch agents in AWS if you do not have internet access

1. Adds the needed endpoints:

The folowing endpoints must be created inside you AWS VPC
cob16 /
Created August 2, 2022 13:37
Graph security groups for aws account
git clone
cd aws-security-viz
docker build -t sec-viz .
AWS_PAGER="" aws-vault exec $AWS_ACCOUNT -- aws ec2 describe-security-groups > sg.json
docker run -i --rm -t -p 3000:3000 -v "$(pwd):/aws-security-viz" --name sec-viz sec-viz /usr/local/bundle/bin/aws_security_viz --renderer navigator --serve 3000 -o sg.json -f aws.json .
xdg-open "http://localhost:3000/navigator.html#aws.json"