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 / 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 / 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
@rogeriopradoj
rogeriopradoj / stopwords.txt
Created December 29, 2021 01:37 — forked from alopes/stopwords.txt
Portuguese stop words
de
a
o
que
e
do
da
em
um
para
@rogeriopradoj
rogeriopradoj / proxy.md
Created May 22, 2021 14:00 — forked from yougg/proxy.md
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@rogeriopradoj
rogeriopradoj / git-subdirectory-tracking.md
Created May 12, 2021 00:18 — forked from tswaters/git-subdirectory-tracking.md
Adding subdirectory of a remote repo to a subdirectory in local repo

This is way more complicated than it should be. The following conditions need to be met :

  1. need to be able to track and merge in upstream changes
  2. don't want remote commit messages in master
  3. only interested in sub-directory of another repo
  4. needs to go in a subdirectory in my repo.

In this particular case, I'm interested in bringing in the 'default' template of jsdoc as a sub-directory in my project so I could potentially make changes to the markup it genereates while also being able to update from upstream if there are changes. Ideally their template should be a separate repo added to jsdoc via a submodule -- this way I could fork it and things would be much easier.... but, it is what it is.

After much struggling with git, subtree and git-subtree, I ended up finding this http://archive.h2ik.co/2011/03/having-fun-with-git-subtree/ -- it basically sets up separate branches from tracking remote, the particular sub-directory, and uses git subtree contrib module to pull it all togther. Following are