Skip to content

Instantly share code, notes, and snippets.

Brandon Catubig bcatubig

Block or report user

Report or block bcatubig

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bcatubig
bcatubig / citrix.md
Last active Dec 20, 2018
Ubuntu 18.10 Citrix Reciever
View citrix.md
View the-programmers-idea.md

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.
View 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 whose fingerprint is B224 32CC 77B4 6000 3EC8 6B30 DA19 BFA4 8C1E 036B

To claim this, I am signing this object:

@bcatubig
bcatubig / .tmux.conf
Created Oct 24, 2017
Updated Tmux Tony Mods
View .tmux.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set-option -g mouse on
set-option -g prefix C-a
bind-key C-a last-window
set -g base-index 1
View zshrc
source ~/antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
antigen bundle pip
antigen bundle command-not-found
antigen bundle docker
View tmux osx
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'arcticicestudio/nord-tmux'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
View 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 ASA_Oy9gxLs7k0kL8vtwYBTw4Z8kaHzZPTX19OAzTdHsNwo

To claim this, I am signing this object:

@bcatubig
bcatubig / ssh.sh
Last active Feb 21, 2017
Passwordless SSH Function - inject your ssh key into a server without actually typing your password in; lastpass does that for you!
View ssh.sh
# 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
View ansible multiprocessing
#!/usr/bin/env python
import subprocess
from multiprocessing import Pool
from functools import partial
import argparse
import sys
from itertools import chain
def execute_playbook(ansible_string, pb):
View gist:5a9b430bb49ccc45d611bc347bd13226
import subprocess
ps = []
def main():
for i in range(1,5):
p = subprocess.Popen("ansible all -i localhost, -c local -a 'date'", shell=True)
ps.append(p)
while True:
ps_status = [p.poll() for p in ps]
if all([x is not None for x in ps_status]):
break
You can’t perform that action at this time.