Skip to content

Instantly share code, notes, and snippets.

@leoheck
leoheck / fix-ccsv7-proj.sh
Created March 13, 2017 16:25
Script to refactor CCSv7 (Code Composer Studio) to run in linux
#!/bin/bash
# Leandro S. Heck (leoheck@gmail.com)
# PATHS IN MY HOST, CHANGE THIS ACCORDINGNLY
proj_name="seeds"
proj_path="/home/lheck/Desktop/$proj_name"
ccstudio_path="/repo/tools/TI/css/7.1.0/ccsv7"
workspace_path="/home/lheck/workspace_v7"
ti_path="/home/lheck/ti"
@leoheck
leoheck / chroot.sh
Last active October 21, 2018 18:13
Chroot from Live USB
efi_partition=/dev/nvm0n1p1
root_partition=/dev/nvm0n1p2
sudo mount ${root_partition} /mnt
sudo mount ${efi_partition} /mnt/boot/efi
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /usr/ /mnt/usr
@leoheck
leoheck / guide-crosscompile-transmission-for-wd-my-cloud.md
Last active October 24, 2018 02:45 — forked from sled/guide.text
Guid to cross compile transmission 2.82 for Western Digital MyCloud

########################################################

CROSS COMPILING TRANSMISSION 2.82 FOR WD MY CLOUD

########################################################

This is a guide to compile transmission 2.82 for the WD MyCloud 2/3/4 TB.

Because I didn't want to install the build tools and dependencies on my NAS I chose to setup a cross-compiler toolchain on my x86_64 Ubuntu 12.04 machine and create a .deb package that can be installed on the NAS. Furthermore the cross compiler can be used to compile anything for the My Cloud (printer drivers, etc.)

@leoheck
leoheck / authenticate_pucrs.sh
Last active March 14, 2020 18:13
Script to launch a remote browser to authenticate a host on PUCRS network
#!/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 / 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
@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 / 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 / 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 / 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 / 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