Skip to content

Instantly share code, notes, and snippets.

View jolbax's full-sized avatar
💪
learning, enjoying, growing..

José Luis Barahona jolbax

💪
learning, enjoying, growing..
View GitHub Profile
@jolbax
jolbax / LangGraph.md
Created June 17, 2025 07:03 — forked from razhangwei/LangGraph.md
LangGraph cheatsheet

This is an excellent LangGraph cheat sheet! It provides a comprehensive and practical overview of LangGraph's key features and usage. Here's a slightly refined version with added clarity and formatting for better readability:


LangGraph Cheat Sheet

1. Import Necessary Modules

from typing import TypedDict, Dict, Any, Callable
from langchain_core.runnables import Runnable

Install the operator using the Manual approval strategy, see the attached screenshot.

An install plan has been created but not executed as it has not been approved:

oc get installplan -n openshift-logging
NAME            CSV                                    APPROVAL   APPROVED
install-dq68d   clusterlogging.4.5.0-202007012112.p0   Manual     false
@jolbax
jolbax / 00 Node on ARM & x86
Created January 13, 2022 14:23 — forked from soueldi/00 Node on ARM & x86
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)
# Node.js on Apple Silicon
Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations.
The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.
## TODO
- find a way how to run the same node version on both platforms
@jolbax
jolbax / install.sh
Created January 13, 2022 08:27 — forked from kiding/install.sh
Heterogeneous Homebrew: Apple Silicon & Intel Rosetta 2 side-by-side
# Install Homebrew at /opt/homebrew (for Apple Silicon)
arch -arm64e /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Homebrew at /usr/local (for Intel Rosetta 2)
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add these lines to ~/.zshrc
alias za="arch -arch arm64e /bin/zsh"
alias zi="arch -arch x86_64 /bin/zsh"
if [[ $(arch) == "arm64" ]]; then
@jolbax
jolbax / lsof_find_port_app.sh
Created April 7, 2020 12:29
Mac OS X: find the program running on a port
$ sudo lsof -i :80 # checks port 80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ruby 64888 wg 6u IPv4 0x6ddd270 0t0 TCP *:gds_db (LISTEN)

Keybase proof

I hereby claim:

  • I am jolbax on github.
  • I am jolbax (https://keybase.io/jolbax) on keybase.
  • I have a public key ASAkt9Usx6-RhqeU4rB1evP9yJjqUXVuAK-5Q1B62sXXGgo

To claim this, I am signing this object:

# 2.3. Debugging Bash scripts
## 2.3.1. Debugging on the entire script
When things don't go according to plan, you need to determine what exactly causes the script to fail. Bash provides extensive debugging features. The most common is to start up the subshell with the -x option, which will run the entire script in debug mode. Traces of each command plus its arguments are printed to standard output after the commands have been expanded but before they are executed.
This is the commented-script1.sh script ran in debug mode. Note again that the added comments are not visible in the output of the script.
```
willy:~/scripts> bash -x script1.sh
+ clear
@jolbax
jolbax / tmux_build_from_source_CentOS.sh
Last active May 7, 2019 08:57 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.9
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
curl -LOk https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@jolbax
jolbax / elastic_restore.py
Created February 19, 2018 09:41 — forked from yodlegists/elastic_restore.py
elastic restore script
import elasticsearch # https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/index.html
import curator # http://curator.readthedocs.io/en/v3.4.1/examples.html
import sys
PROD_PREFIX = "prod_"
REPOSITORY = "Your repository here
HOST_LIST = [{"host": "Friendly-hostname-here", "port": 9200}]
def main():
@jolbax
jolbax / pyscript.py
Created February 9, 2018 09:44 — forked from nhoffman/pyscript.py
Python script template
#!/usr/bin/env python
"""A simple python script template.
"""
from __future__ import print_function
import os
import sys
import argparse