Skip to content

Instantly share code, notes, and snippets.

View mvneves's full-sized avatar
🏠
Working from home

Marcelo Veiga Neves mvneves

🏠
Working from home
  • PUCRS | Nubo
  • Porto Alegre, Brazil
  • 00:24 (UTC -03:00)
View GitHub Profile
@mvneves
mvneves / RTL8761B-driver.md
Last active February 14, 2022 19:06
Installing Bluetooth 5.0 Headset with Realtek RTL8761B Bluetooth 5.0 dongle on Linux

How to install Bluetooth 5.0 Headset with Realtek RTL8761B Bluetooth 5.0 dongle on Linux

Download and install RLT8761B chipset firmware:

wget https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_config
wget https://raw.githubusercontent.com/Realtek-OpenSource/android_hardware_realtek/rtk1395/bt/rtkbt/Firmware/BT/rtl8761b_fw

sudo cp rtl8761b_config /usr/lib/firmware/rtl_bt/rtl8761b_config.bin

Reloading dnsmasq hosts

To reload after changes in /etc/hosts, send SIGHUP to dnsmasq like this:

sudo pkill -SIGHUP dnsmasq
@mvneves
mvneves / EC2LimitRegionInstanceType.json
Created July 16, 2018 21:33
AWS policy to limit EC2 usage to a specific region and instance type
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "limitedRegion",
"Action": "ec2:*",
"Resource": "*",
"Effect": "Allow",
"Condition": {
"StringEquals": {
@mvneves
mvneves / git-split.md
Created December 28, 2017 21:36
How to split a git repository into two different ones

How to split a git repository into two different ones

These are the steps to extract a directory from a git repository (with all its history commit), create a new repository from this directory, and optionally remove it from the original one.

To the ones that are here to copy-paste code, this is an example which removes the MODULE directory from REPO repository.

Step 1: Extract the directory from the git repository

Clone the original repository:

@mvneves
mvneves / ssh-agent.md
Last active April 16, 2024 16:38
"Could not open a connection to your authentication agent"

SSH authentication agent does not automatically start when using it from a remote server. This results in the following error message:

$ git pull
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
$ ssh-add ~/my-ssh-key.pem
Could not open a connection to your authentication agent.

To fix it requires manually starting ssh-agent:

@mvneves
mvneves / ssh-without-password.md
Last active August 29, 2015 14:10
SSH without password

Using SSH without password

Generate a pair of keys in the local machine:

ssh-keygen -t rsa

Add public key to server's .ssh/authorized_keys file:

cat ~/.ssh/id_rsa.pub | ssh user@server 'cat >> .ssh/authorized_keys'
@mvneves
mvneves / ec2-rsync.md
Last active August 29, 2015 14:10
Download an entire Amazon EC2 instance to local host using rsync

Download an entire Amazon EC2 instance to local host using rsync

rsync -av --progress -e 'ssh -i /path/to/user.pem' \
--rsync-path='sudo rsync' --exclude='/dev/' --exclude='/proc/' --exclude='/sys/' \
user@ec2-xx-xx-xx-xx.us-west-2.compute.amazonaws.com:/* /local/path/

Actually, this doesn't download the instance itself, but its file system contents.