Skip to content

Instantly share code, notes, and snippets.

View lmmendes's full-sized avatar
🏠

Luís Mendes lmmendes

🏠
View GitHub Profile
@lmmendes
lmmendes / b1decode.js
Created April 28, 2024 08:12
Portisch RF-Bridge Decode 0xB1 sniffed data
/***
* The following script decodes 0xB1 to 0xB0
* For more information on 0xB1 to 0xB0 decoding see https://github.com/Portisch/RF-Bridge-EFM8BB1/wiki/Decode-0xB1-sniffed-data
*
* The following site can also be used for decoding https://bbconv.hrbl.pl/
*
*/
const readline = require('readline').createInterface({
input: process.stdin,
@lmmendes
lmmendes / script.sh
Created March 25, 2020 00:26
join replica set
rs.initiate( {
_id : "rs0",
members: [
{ _id: 0, host: "mongo-0:27017" },
{ _id: 1, host: "mongo-1:27017" }
]
});
@lmmendes
lmmendes / aws-cloud-convention-naming.md
Created September 15, 2019 21:04
AWS Cloud Convention Naming

Tags Schema

Tag Name (Key) Description
Environment Used to distinguish between production (prd), development (dev), and staging infrastructure (stg). Application Used to describe the set of disparate resources (or clusters) that work together to deliver a product or service to a customer.
Application If this resource belongs to a application place the name of the application
Project The project name that a group of instances and resources bellong, eg: mrsv4
Cluster Used to identify the set of instances that share the responsibility for perform a specific function as part of an application. Clustered instances typically share the same configuration and exist behind a load balancer.
@lmmendes
lmmendes / bash-java_home.md
Last active December 24, 2018 09:10
[Blog Post] Java Version Manager
#> echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
/*
Reddit DailyProgrammer Challenge #180 -- Tamagotchi Emulator
By Aerospark12 (aka Luke)
I may have gone a little bit overboard with this one, but I've got fond memories of tamagotchi from when
I was but a wee laddie, I've always wanted to make something like this, and I really enjoy graphics and animation
The design of this is partially inspirte by how I understand "low level" ICs to work, as an homage to the real tamagotchi
@lmmendes
lmmendes / jvm.md
Created February 6, 2018 12:42
JVM Stats

vmstat <ms>

Shows virtual memory stats every ms millis.

jps -lvm

Shows the java processes running, their PID, and command line arguments.

jcmd <pid> help

Hello, guys!

Thank you for participating in the Mercedes-Benz Pixels Camp challenge.

We were overwhelmed by the ideas and the quality of the projects that we saw during the testing phase in the real car.

That being said, we are now reaching out for a call on all projects so that we can evaluate them and select a winner.

So please commit your project to GitHub, use the mock VIN number as the project name so that we can more easily identify the team. Use the README.md file attached to this e-mail as a template for your project, replace the example values with your own and delete anything that doesn't make sense to you.

@lmmendes
lmmendes / web-servers.md
Created September 8, 2017 16:18 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@lmmendes
lmmendes / wepack.md
Created July 9, 2017 16:46
js intro
  • npm
  • webpack (problemas que veio resolver)
  • explicar deps e dev deps
  • mostrar o module.export
  • mostrar uma class constructor ola
  • mostrar um loader (babel)
  • falar do resolver.alias
@lmmendes
lmmendes / parallel.rb
Created May 23, 2017 13:04
tinkering around with concurrent notions
module Parallel
def cpu_cores
2
end
def parallel_each(&block)
t = []
each_slice(cpu_cores).each do |items|
t << Thread.new do
items.each do |item|