Skip to content

Instantly share code, notes, and snippets.

View ricardodeazambuja's full-sized avatar

Ricardo de Azambuja ricardodeazambuja

View GitHub Profile
@ricardodeazambuja
ricardodeazambuja / using-google-takeout.md
Created December 5, 2022 13:39 — forked from chabala/using-google-takeout.md
Merge and extract tgz files from Google Takeout

Recently found some clowny gist was the top result for 'google takeout multiple tgz', where it was using two bash scripts to extract all the tgz files and then merge them together. Don't do that. Use brace expansion, cat the TGZs, and extract:

$ cat takeout-20201023T123551Z-{001..011}.tgz | tar xzivf -

You don't even need to use brace expansion. Globbing will order the files numerically:

$ cat takeout-20201023T123551Z-*.tgz | tar xzivf -
@ricardodeazambuja
ricardodeazambuja / semantic_segmentation.ipynb
Created October 7, 2022 19:04
Semantic_Segmentation.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ricardodeazambuja
ricardodeazambuja / gist:eb668cb015055f8c91eb9ed2f5f3ee43
Created March 12, 2022 22:55 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ricardodeazambuja
ricardodeazambuja / print_in_color.sh
Last active February 5, 2022 21:13
When your black cartridge is empty and your printer driver doesn't help, change the pdf from black to something else :D
#!/bin/bash
# From https://www.reddit.com/r/linux4noobs/comments/2yzld7/command_line_change_text_color_in_pdf/
# It will go through all the pdfs in the directory and change the color black (0 0 0) to something else (0.3 0.3 0.3)
# The RGB values here go from 0 to 1 instead of 0 to 255 ;)
for f in *.pdf; do
echo $f
pdftk "$f" output "tmp-$f" uncompress
sed -i "s/0 0 0 rg/0.3 0.3 0.3 rg/g" "tmp-$f"
@ricardodeazambuja
ricardodeazambuja / Send infrared commands from the Arduino to the iRobot Roomba
Created January 23, 2022 20:34 — forked from probonopd/Send infrared commands from the Arduino to the iRobot Roomba
Send infrared commands from the Arduino to the iRobot Roomba. Use a transistor to drive the IR LED from pin D3 for maximal range.
#include <IRremote.h>
/*
Send infrared commands from the Arduino to the iRobot Roomba
by probono
2013-03-17 Initial release
@ricardodeazambuja
ricardodeazambuja / server.py
Created September 18, 2021 18:16 — forked from dragermrb/server.py
Python 3 HTTP Server with Basic Authentication
import http.server
import cgi
import base64
import json
from urllib.parse import urlparse, parse_qs
class CustomServerHandler(http.server.BaseHTTPRequestHandler):
def do_HEAD(self):
@ricardodeazambuja
ricardodeazambuja / live_loss_plot_keras.ipynb
Created June 16, 2021 09:16 — forked from stared/live_loss_plot_keras.ipynb
Live loss plot for training models in Keras (see: https://github.com/stared/livelossplot/ for a library)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ricardodeazambuja
ricardodeazambuja / GitDeleteCommands.ps1
Created April 10, 2021 17:14 — forked from cmatskas/GitDeleteCommands.ps1
Git Delete Branch commands
## Delete a remote branch
$ git push origin --delete <branch> # Git version 1.7.0 or newer
$ git push origin :<branch> # Git versions older than 1.7.0
## Delete a local branch
$ git branch --delete <branch>
$ git branch -d <branch> # Shorter version
$ git branch -D <branch> # Force delete un-merged branches
## Delete a local remote-tracking branch
@ricardodeazambuja
ricardodeazambuja / FeatherM0Express_ADLX377_Datalogger.ino
Last active September 22, 2020 18:05
Arduino sketch to log data using ADC from Adafruit Feather M0 Express
//
// Adafruit Feather M0 Express ADC data logging
//
// Based on the Adafruit SdFat_circuitpython example
//
// The files can be accessed by double pressing the reset button and
// copying the circuitpython uf2 file (https://circuitpython.org/board/feather_m0_express/)
// into the featherboot drive (must be connected to the computer USB port :P)
// If you want to keep your arduino code, save the CURRENT.UF2 file before copying
// the circuitpython one from the link above.
@ricardodeazambuja
ricardodeazambuja / boot.py
Last active August 12, 2020 19:08
ADXL377 datalogging using Adafruit Feather M0 Express (almost 8 seconds of data with sample rate between 100 and 120Hz, 4 between 200Hz and 210Hz)
import storage
storage.remount("/", readonly=True) # to enable the code to save data to the flash this needs to be False
# After the system is reset with the above line set to False, it will not allow to update
# anything using the virtual USB drive. Therefore it's necessary to connect using the serial USB (minicom),
# enter the REPL (contr+c to cancel code.py if it's running and any key) and paste the line below:
# import os; os.remove("/boot.py"); fs=open("/boot.py", "w"); fs.write("import storage\nstorage.remount(\"/\", readonly=True)"); fs.close()
#
# Usage