Skip to content

Instantly share code, notes, and snippets.

View japaz's full-sized avatar
🏠
Tired of ...

Alberto Paz japaz

🏠
Tired of ...
View GitHub Profile
@japaz
japaz / fetch-all-repos.sh
Created February 18, 2025 08:05
Script o get all git repositories in the subdirectories
#!/bin/bash
# Loop through each subdirectory in the current directory
for dir in */; do
if [ -d "${dir}/.git" ]; then
echo "Processing repository: $dir"
(
# Enter the subdirectory
cd "$dir" || exit 1
@japaz
japaz / sync-branches.sh
Created February 18, 2025 07:59
Script to sync multiple git repositories from master to a given branch
#!/bin/bash
# Description: Syncs target branch with latest master, trying multiple clone paths if needed
# Usage: ./sync-branches.sh <target-branch> <repo1> <repo2> ...
set -eo pipefail
# Formatting
BOLD="\033[1m"
CYAN="\033[0;36m"
RED="\033[0;31m"

Keybase proof

I hereby claim:

  • I am japaz on github.
  • I am japaz (https://keybase.io/japaz) on keybase.
  • I have a public key whose fingerprint is D2EA 09A8 4001 DE12 31EE 7EE2 4D4C F3D6 8509 FAA0

To claim this, I am signing this object:

@japaz
japaz / cisco.osascript
Last active October 25, 2018 17:35 — forked from ahebrank/cisco.osascript
Automate Cisco AnyConnect VPN client with lastpass on OSX
-- 1. Open Security & Privacy System Preferences, go to Privacy, Accessibility
-- 2. Enable Applescript Editor
-- Usage: <script> gatewayHostName password
-- based on https://gist.github.com/andrewh/7135352 and https://github.com/seanfisk/juniper-network-connect-vpn-applescript/blob/master/juniper.applescript
on run argv
if (count of argv) is not equal to 2 then
return "Usage: <script> gatewayHostName password"
else
#compdef rscreen
# rscreen autocompletion for oh-my-zsh
# Requires: rscreen installed
_ssh
_arguments \
':hosts:_ssh_hosts' \
&& return 0
@japaz
japaz / rscreen
Last active November 11, 2020 13:04
Improved rscreen from autossh
#!/bin/sh
#
# sample script to use autossh to open up a remote screen
# session, or reconnect to an existing one.
#
# $Id: rscreen,v 1.4 2002/05/07 17:54:13 harding Exp $
#
if [ "X$1" = "X" ]; then
echo "usage: `basename $0` <host>"
exit 1
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
@japaz
japaz / Pouring.scala
Last active December 17, 2015 05:49 — forked from yankov/gist:5538283
package week7
class Pouring(capacity: Vector[Int]) {
// States
type State = Vector[Int]
val initialState = capacity map (x => 0)
// Moves
@japaz
japaz / logformat.txt
Created June 7, 2012 14:53
Web Server Stress Testing with Curl
%{url_effective},%{http_code},%{content_type},%{time_total},%{time_connect},%{time_starttransfer},%{size_download}\n
@japaz
japaz / .screenrc
Created December 22, 2011 15:59
Example .screenrc
defscrollback 5000
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'