Skip to content

Instantly share code, notes, and snippets.

@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
@leoheck
leoheck / chroot.sh
Last active Oct 21, 2018
Chroot from Live USB
View chroot.sh
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 / fix-ccsv7-proj.sh
Created Mar 13, 2017
Script to refactor CCSv7 (Code Composer Studio) to run in linux
View fix-ccsv7-proj.sh
#!/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"