Skip to content

Instantly share code, notes, and snippets.

@leoheck
leoheck / kicad_cli_all
Last active February 17, 2023 06:56
Exports all Schematics pages and every Layer of the PCB in individual SVG files.
#!/bin/bash
# Usage: kicad_cli_all KICAD_PRO
kicad_pro=${1}
if [[ ! -f "${kicad_pro}" ]]; then
echo "Kicad project '${kicad_pro}' is missing"
exit
fi
@leoheck
leoheck / Freecad_Links_List.py
Last active October 5, 2022 19:46
This code presents files linked inside a FreeCad (.FCStd)
@leoheck
leoheck / cc2538-and-openocd.md
Last active January 13, 2023 15:47 — forked from hwhw/cc2538-and-openocd.md
Flashing CC13*2 using OpenOCD

Flashing CC13x2 with OpenOCD Using XDS110 and JTAG.

Install OpenOCD version 0.11.0 (or maybe higher)

You can also build it yourself.

Boards setup

If you are using Launchpads to experiment this setup, you are going to need to prepare them as it is being shown in this image.

jtag_chain2

@leoheck
leoheck / shellhub_api_requests_with_curl.sh
Last active December 2, 2021 18:08
Shellhub API Requests with Curl
#============================================
# GET ACCESS TOKEN
read -r -d '' login_data <<-EOM
{
"username": "${SHELLHUB_USER}",
"password": "${SHELLHUB_PASS}"
}
EOM
@leoheck
leoheck / userpic.sh
Created November 2, 2021 15:21 — forked from palmerc/userpic.sh
Updating a user's picture from a script
#!/bin/bash
set -e
declare -x USERNAME="$1"
declare -x USERPIC="$2"
declare -r DSIMPORT_CMD="/usr/bin/dsimport"
declare -r ID_CMD="/usr/bin/id"
@leoheck
leoheck / update_ferdi_recipies
Created May 14, 2021 01:32
Update Ferdi Recipies
#!/bin/bash
cd ~/.config/Ferdi/recipes
rm -rf ~/.ferdi_recipes
git clone https://github.com/getferdi/recipes.git ~/.ferdi_recipes
dirs=$(find . -mindepth 1 -maxdepth 1 -type d \( ! -name recipes \) \( ! -name temp \) \( ! -name '.*' \))
mkdir -p ~/.ferdi_old_recipes
@leoheck
leoheck / set_my_zsh
Last active February 19, 2021 21:55
Shell Customization
sudo apt update
sudo apt install -y zsh
sudo apt install -y git
sudo apt install -y curl
sudo apt install -y wget
sudo apt install -y binutils
# Install oh-my-zsh
if [[ ! -d ~/.oh-my-zsh ]]; then
@leoheck
leoheck / homebase-install.sh
Last active November 10, 2020 00:42
Install Homebase
#!/usr/bin/bash
# Homebase, pre installation
#
# How to use:
# sh -c "$(curl -H "Cache-Control: no-cache" https://gist.githubusercontent.com/leoheck/3158d9d959eb708ecfd42300b2a88e78/raw/homebase-install.sh)"
# Set Hostname
read -p "What is the HOSTNAME: " hname
echo $hname > /etc/hostname
@leoheck
leoheck / authenticate_pucrs.sh
Last active March 14, 2020 18:15
Attempt to automate host authentication in PUCRS using curl
#!/bin/bash
# By Leandro Heck (leoheck@gmail.com)
# Save this script in /usr/bin/authenticate_pucrs
# Usage
# authenticate_pucrs 12981829
# Automating..
# echo "minhaSenha" | authenticate_pucrs 12981829