Skip to content

Instantly share code, notes, and snippets.

@rafacouto
rafacouto / LICENSE.md
Created May 2, 2021 — forked from noelbundick/LICENSE.md
Resize Azure Cloud Shell storage
View LICENSE.md

MIT License

Copyright (c) 2018 Noel Bundick

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View grafana_telegram_bot.md

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather
@rafacouto
rafacouto / main.rs
Created Jun 21, 2020
My first blinky with Rust embedded
View main.rs
#![no_std]
#![no_main]
use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch panics
use cortex_m_rt::entry;
use stm32f4xx_hal as hal;
use crate::hal::{prelude::*, stm32};
#[entry]
View main.cpp
#include <Arduino.h>
#include "LCDHAL.h"
#include "PINOUT.h"
#include <stdio.h>
LCDHAL ReespiratorLCD;
void setup()
{
View LCDHAL.cpp
#include <Arduino.h>
#include "LCDHAL.h"
#include "PINOUT.h"
LCDHAL* LCDHAL::_lcdInstance = NULL;
int (*LCDHAL::_oriPutchar)(char, FILE *) = NULL;
int LCDHAL::_lcdPutchar(char c, FILE *stream)
{
_lcdInstance->LCDPutchar(c);
@rafacouto
rafacouto / mux-band-tdt-es.sh
Last active Mar 1, 2020
Shows the relation between Spanish TDT MUX offset and its MHz frequency.
View mux-band-tdt-es.sh
#!/bin/bash
for mux in $(seq 21 1 60) ; do echo "MUX $mux --> $((482 + (($mux - 22) * 8))) MHz" ; done
View 328p-readvcc.ino
#include <Arduino.h>
#include <stdint.h>
#include <avr/io.h>
uint16_t vcc_millivolts(uint8_t delay_us = 50)
{
// select AVCC as reference and switch the internal band-gap (1.1V)
ADMUX = 0b01011110;
@rafacouto
rafacouto / 2pass.bash
Created Jan 2, 2020
2pass - a bash importer from raw password list (exported from revelation)
View 2pass.bash
#!/bin/bash
# Requirements: xml2 package
# Export the Revelation file as XML and:
# cat exported.xml | xml2 | 2pass
reset_entry()
{
a_fields=()
a_values=()
View Makefile
TARGET_EXEC ?= simul
TARGET_PLATFORM ?= linux
SRC_DIRS ?= . ../src
SRCS := $(shell find $(SRC_DIRS) -name '*.s')
SRCS += $(shell find $(SRC_DIRS) -name '*.c')
SRCS += $(shell find $(SRC_DIRS) -name '*.cpp')
OBJS := $(SRCS:%=%.o)