Skip to content

Instantly share code, notes, and snippets.

View bcatubig's full-sized avatar

Brandon Catubig bcatubig

View GitHub Profile
@bcatubig
bcatubig / java.sh
Created June 27, 2025 21:59
Java OSX Aliases
export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
export JAVA_11_HOME=$(/usr/libexec/java_home -v11)
export JAVA_17_HOME=$(/usr/libexec/java_home -v17)
export JAVA_18_HOME=$(/usr/libexec/java_home -v18)
export JAVA_19_HOME=$(/usr/libexec/java_home -v19)
export JAVA_21_HOME=$(/usr/libexec/java_home -v21)
alias java8='export JAVA_HOME=$JAVA_8_HOME'
alias java11='export JAVA_HOME=$JAVA_11_HOME'
alias java17='export JAVA_HOME=$JAVA_17_HOME'
@bcatubig
bcatubig / tmux.sh
Last active June 27, 2025 21:58
Tmux Helper Functions
function tnew() {
local session_name="$1"
tmux new-session -d -s "${session_name}" "nvim" >/dev/null
tmux rename-window -t "${session_name}":1 "vim"
tmux new-window -t "${session_name}"
tmux rename-window -t "${session_name}":2 "terminal"
tmux select-window -t "${session_name}":1
tmux a -t "${session_name}"
}
@bcatubig
bcatubig / kitty.conf
Created May 1, 2025 15:09
kitty.conf
font_family JetBrainsMono Nerd Font
font_size 13.0
window_padding_width 5
background_opacity 0.98
enable_audio_bell no
tab_bar_style powerline
# Colors - https://github.com/olimorris/onedarkpro.nvim
background #282c34
@bcatubig
bcatubig / .zshrc
Created April 27, 2025 18:52
.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time Oh My Zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@bcatubig
bcatubig / .wezterm.lua
Last active March 27, 2025 19:43
wezterm osx
-- Pull in the wezterm API
local wezterm = require("wezterm")
local act = wezterm.action
local config = wezterm.config_builder()
config.color_scheme = "onedarkpro_onedark"
config.font = wezterm.font("JetBrainsMono Nerd Font", { weight = "Medium" })
config.font_size = 16
config.scrollback_lines = 20000
@bcatubig
bcatubig / .tmux.conf
Last active April 28, 2025 22:04
tmux config
# Fix Colors
set -g default-terminal "screen-256color"
set -as terminal-features ",xterm-256color:RGB"
# easy reload config
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
# set window split
bind-key v split-window -h
bind-key b split-window
@bcatubig
bcatubig / keybase.md
Last active March 16, 2020 04:07
keybase.md

Keybase proof

I hereby claim:

  • I am bcatubig on github.
  • I am bcatubig (https://keybase.io/bcatubig) on keybase.
  • I have a public key ASBnb33d8bf6_dOpQCwgLXGIQVBZPXqUAjx9-3JQiJ-t3Ao

To claim this, I am signing this object:

@bcatubig
bcatubig / r8169.md
Created August 24, 2019 01:10
r8169 Arch Linx

module bricks networking after resuming from sleep

either remove the blacklist file

/etc/modprobe.d
❯ sudo rm r8169_blacklist.conf 

or run

Numbers

Text

  • Reverse a String – Enter a string and the program will reverse it and print it out.
  • Pig Latin – Pig Latin is a game of alterations played on the English language game. To create the Pig Latin form of an English word the initial consonant sound is transposed to the end of the word and an ay is affixed (Ex.: "banana" would yield anana-bay). Read Wikipedia for more information on rules.
  • Count Vowels – Enter a string and the program counts the number of vowels in the text. For added complexity have it report a sum of each vowel found.
  • Check if Palindrome – Checks if the string entered by the user is a palindrome. That is that it reads the same forwards as backwards like “racecar”
  • Count Words in a String – Counts the number of individual words in a string. For added complexity read these strings in from a text file and generate a summary.
@bcatubig
bcatubig / ssh.sh
Last active June 12, 2020 03:25
Passwordless SSH Function - inject your ssh key into a server without actually typing your password in; lastpass does that for you!
# Works with Bash and ZSH
# Copy this into your ~/.bashrc or ~/.zshrc
# Install Lastpass cli -- https://github.com/lastpass/lastpass-cli
# Install sshpass
# OSX: $ brew install http://git.io/sshpass.rb
# Be sure to change <MYLASTPASS-PASSWORD-ID> in the install_keys() function
function install_keys (){
echo "INFO: No SSH Key on server. Grabbing password from lastpass"
export SSHPASS=$(lpass show <MYLASTPASS-PASSWORD-ID> --password)
/usr/local/bin/sshpass -e ssh-copy-id $1 || return 255