Skip to content

Instantly share code, notes, and snippets.

@leoheck
leoheck / Freecad_Links_List.py
Last active Oct 5, 2022
This code presents files linked inside a FreeCad (.FCStd)
View Freecad_Links_List.py
@leoheck
leoheck / cc2538-and-openocd.md
Last active Jun 10, 2022 — forked from hwhw/cc2538-and-openocd.md
Flashing CC13*2 using OpenOCD
View cc2538-and-openocd.md

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 Dec 2, 2021
Shellhub API Requests with Curl
View shellhub_api_requests_with_curl.sh
#============================================
# GET ACCESS TOKEN
read -r -d '' login_data <<-EOM
{
"username": "${SHELLHUB_USER}",
"password": "${SHELLHUB_PASS}"
}
EOM
@leoheck
leoheck / userpic.sh
Created Nov 2, 2021 — forked from palmerc/userpic.sh
Updating a user's picture from a script
View userpic.sh
#!/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
Update Ferdi Recipies
View 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 Feb 19, 2021
Shell Customization
View set_my_zsh
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 Nov 10, 2020
Install Homebase
View homebase-install.sh
#!/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 Mar 14, 2020
Attempt to automate host authentication in PUCRS using curl
View authenticate_pucrs.sh
#!/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
@leoheck
leoheck / authenticate_pucrs.sh
Last active Mar 14, 2020
Script to launch a remote browser to authenticate a host on PUCRS network
View authenticate_pucrs.sh
#!/bin/bash
# By Leandro Heck (leoheck@gmail.com)
# Add this script in your .bashrc (or .zshrc) or source it like:
# $> source autenticate_pucrs.sh
# Usage examples:
# 1. Authenticate using same network user
# $> authenticate_host lheck gaphl12
@leoheck
leoheck / fix-ubuntu-18.10-on-dell-xps-9570
Last active Nov 7, 2019
Fix Ubuntu 18.10 on Dell XPS 9570
View fix-ubuntu-18.10-on-dell-xps-9570
#
# Run this from the Live USB.
#
#############################
# EDIT YOUR PARTITIONS HERE #
#############################
root_partition=/dev/nvm0n1p2
sudo mount ${root_partition} /mnt