Skip to content

Instantly share code, notes, and snippets.

View rogeriopradoj's full-sized avatar
😀

Rogerio Prado de Jesus rogeriopradoj

😀
View GitHub Profile
# My pretty prompt:
# - Truncates the first few dirs in long paths
# - red/green prompt based on return value of previous command
# - inserts git branch name if in a repo
# Developed primarily for debian/ubunu systems
# First, some stuff from the Ubunutu .bashrc
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
@rogeriopradoj
rogeriopradoj / launchctl_man.md
Created August 5, 2023 16:30 — forked from stevekm/launchctl_man.md
macOS OS X login items

[source]

This manual page is for Mac OS X version 10.9

If you are running a different version of Mac OS X, view the documentation locally:

    In Terminal, using the man(1) command

Reading manual pages
@rogeriopradoj
rogeriopradoj / entware zerotier
Created July 27, 2023 05:00 — forked from ssky87/entware zerotier
LibreElec / CoreElec ZeroTier
// install entware
installentware // for coreelec
wget -O - http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | sh // for libreelec rasbperry 3
// update && install zerotier
opkg update
opkg install zerotier
// start the daemon
@rogeriopradoj
rogeriopradoj / autostart.sh
Created July 27, 2023 04:47 — forked from beancurd1/autostart.sh
CoreELEC or LibreELEC autostart.sh to auto start scripts upon reboot
# this located in /storage/.config/autostart.sh on a CoreELEC box, run chmod +x to make it executable
# use nohup to run the script in the backgroud
# nohup /storage/freemyip/updateDynDNS.sh &
# use this to run once off tasks
(
# pause few seconds to wait for network & time services to start
sleep 5
DT=$(date +"%m-%d-%Y, %r")
echo "Box rebooted on $DT, running tasks in autostart.sh" >> /storage/freemyip/DynDNSUpdate.log
@rogeriopradoj
rogeriopradoj / .screenrc
Created November 4, 2022 16:46
Scroll inside Screen, or Pause Output && linux (gnu-) screen: remap Ctrl-a (default command key) to Alt-a in 'one go'
# ~/.screenrc
#
# https://unix.stackexchange.com/questions/700451/linux-gnu-screen-remap-ctrl-a-default-command-key-to-alt-a-in-one-go
escape ^Xa
#
# https://unix.stackexchange.com/questions/40242/scroll-inside-screen-or-pause-output
# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@
@rogeriopradoj
rogeriopradoj / purge_branches.sh
Created August 8, 2022 14:42 — forked from jsonberry/purge_branches.sh
Mass remove local git branches and prune remote tracking
// List all remotely tracked branches that do not exist in the remote repo
git remote prune origin --dry-run
// Prune all remotely tracked branches that do not exist in the remote repo
git remote prune origin
// List all local branches that were merged into master, explicitly exclude master from that list
git branch --merged master | grep -v 'master'
/*
@rogeriopradoj
rogeriopradoj / DecompressZip.pqm
Created May 24, 2022 18:42
Power Query M Formula Language - DecompressZip - function (ZIPFile as any) as any
= (ZIPFile) =>
// expects full path to the ZIP file, only extracts the first data file after getting its size from the central directory
// https://en.wikipedia.org/wiki/Zip_(file_format)#Structure
let
//read the entire ZIP file into memory - we'll use it often so this is worth it
Source = Binary.Buffer(File.Contents(ZIPFile)),
// get the full size of the ZIP file
Size = Binary.Length(Source),
//Find the start of the central directory at the sixth to last byte
@rogeriopradoj
rogeriopradoj / 1.md
Last active May 18, 2022 09:50
zerotier vpn raspberry pi nems
ip addr sh zt0 | grep 'inet'
ip a
ip addr sh zthnhjmvln | grep 'inet'
sudo nems-quickfix
sudo sysctl net.ipv4.ip_forward
sudo nano /etc/sysctl.conf
sudo sysctl -p
sudo sysctl net.ipv4.ip_forward
ip link show
@rogeriopradoj
rogeriopradoj / 1.Readme.MD
Created February 25, 2022 21:48 — forked from squeedee/1.Readme.MD
Adding your ssh key to lastpass

Setup

  1. Install lpass, the last pass command line tool
brew install lastpass-cli --with-pinentry
  1. Create a passphrase encrypted key and make sure you put the public key where you need it, eg: github
@rogeriopradoj
rogeriopradoj / zt_VPN.md
Created February 11, 2022 10:17 — forked from markus2120/zt_VPN.md
Route all traffic with a raspberry pi like a VPN