Skip to content

Instantly share code, notes, and snippets.

View gmacario's full-sized avatar

Gianpaolo Macario gmacario

View GitHub Profile
@ariccio
ariccio / BluetoothConstants.ts
Created January 10, 2022 18:59
GATT services and characteristics
//Extracted 1/10/2022 from my COVID-CO2-tracker project, in case they're useful to anybody. I'm gonna file an issue/suggesting a few places, and it seems polite to dump it here rather than a long preformatted bit in an issue.
export const GENERIC_GATT_SERVICE_SHORT_ID_DESCRIPTIONS = new Map([
//these are hex strings, without the 0x. Chrome zero extends the devices... so 0x1800 becomes 0x00001800.
// This is a hack to make things easy.
['1800', "generic_access"],
['1801', "generic_attribute"],
['1802', "immediate_alert"],
['1803', "link_loss"],
@cr3ative
cr3ative / jiggler.md
Last active July 11, 2024 08:38
Making an inexpensive USB Mouse Jiggler, with slightly better USB Descriptor (PID, VID, Manufacturer)

Making a half-convincing USB Mouse Jiggler on the cheap

I object to USB Mouse Jigglers being £20-£30 on Amazon for something a microcontroller should be able to do with ease, in an unconfigurable/unknown state when it comes to how they describe themselves to the host machine.

We can do better, with a reprogrammable version for about £6.

There are existing guides to each part of this, and I've linked them inline. Here's a great one for people less familiar with Arduino, but this guide assumes basic knowledge of Arduino.

Hardware

@GGn0
GGn0 / 01_Home_Assistant_on_raspberry.md
Last active November 9, 2021 14:27
Setup Home Assistant on Raspberry pi using Docker. Connect it to Google Home

Home Assistant Core on Raspberry

Run Home Assistant docher container

Make sure you have docker and dcker compose installed

docker --version
docker-compose --version

Create a docker-compose.yaml file inside a relevant directory

@GGn0
GGn0 / README.md
Last active April 8, 2023 09:19
Programming STM32 Nucleo-64 with PlatformIO

Programming STM32 Nucleo-64 with PlatformIO

Make sure to install the correct drivers for the stlink programmer.

⚠️ If you are on Windows, you may want to reboot the system after installing drivers or even PlatformIO

Specifications

  • OS: Windows 10 Pro 20H2 build 19042.1052
  • VSCode: v1.53.2
@GGn0
GGn0 / common-problems.md
Last active June 12, 2021 10:45
git-notes.md

Common git problems

Added a large file in past commits and now you can't push

  • Delete the file and all its history ( source )

    git filter-branch --tree-filter "rm -f Path/to/large-file" -- --all
@mak3r
mak3r / k3s-training.md
Last active April 11, 2022 16:03
Process notes for k3s online training

Prep

  1. Generate a list of instances
  • sbin/generate-instance-list.sh -n mak3r-rancher-training-k3s > instance-ids.json
  • use a script to connect to those instances by list id
    • sbin/ssh-connect.sh -i 0 -k ~/.ssh/mak3r-private.pem -s
  1. Get the cloud server public IP address and replace throughout the script
  2. Prepare a local RPi server

@acolyer
acolyer / jessfraz.md
Created November 19, 2017 13:39
Containers, operating systems and other fun things from The Morning Paper

How I solved Nebula Level 11

The last few days I solved the first levels of Nebula. Nebula is an exploit exercise which consists of twenty levels. The level zero to eight where no real trouble. The level09 drove me crazy. I never wrote serious php code so I was not able to solve the string injection without cheating. For [level10] I gave up a bit too early as-well, after the first hint about TOCTOU (time-of-use to time-of-check) made me solve this with two simple bash scripts.

For the Level 11 flag cheating was no option for me. This walk through describes how I did solve this exercise. The description of this exercise states the following:

The /home/flag11/flag11 binary processes standard input and executes a shell command.  There are two ways of completing this level, you may wish to do both :-) To do this level, log in as the level11 account with th
@donghee
donghee / sx1278_master.cpp
Last active January 9, 2019 08:12
sx1278_from_doriji: 2016-03-05 it's works. from hama to mangwon-dong han river.
#define RF_RESET 11
#define RF_DIO0 12
#define RF_SCK 13
#define RF_MISO 14
#define RF_MOSI 15
#define RF_NSEL 16
#define LED1 PIN_LED1
#define LED2 22 //
@githubteacher
githubteacher / show-branch.md
Created February 29, 2016 20:59
Adding your Git branch to your command prompt

To show your active Git branch in your command prompt, you will need to do the following:

  • If you are on a Mac, you can add the code shown below to your .bash_profile file.
  • If you are on Linux, you will add the code shown below to your .bashrc file.
  • If you are on Windows, you probably aren't reading this because Windows provides this behavior by default.

The Script

parse_git_branch() {