Skip to content

Instantly share code, notes, and snippets.

View cjjavellana's full-sized avatar

Christian Javellana cjjavellana

View GitHub Profile
@cjjavellana
cjjavellana / install-rvm.sh
Created December 8, 2023 05:45
Installing RVM and Ruby 3.2.2 on MacOS M1
$ curl -sSL https://get.rvm.io | bash -s stable --ruby
# Install dependencies
$ brew install rust
$ brew install openssl@3.0
# Switch arch to intel otherwise compile will fail
$ env /usr/bin/arch -x86_64 /bin/zsh --login
# install ruby 3.2.2 via rvm
@cjjavellana
cjjavellana / init-openjdk-dev.sh
Last active October 22, 2023 08:33
Setting up an OpenJDK Development Ubuntu VM
#!/bin/bash
sudo apt update
# The openjdk is used as a bootstrap jdk, adjust your jdk version accordingly depending on the
# jdk you're trying to build from source
sudo apt install -y gdb make autoconf unzip zip openjdk-17-jdk gcc g++ libx11-dev libxext-dev \
libxrender-dev libxrandr-dev libxtst-dev libxt-dev libcups2-dev libfontconfig1-dev libasound2-dev
git clone --depth 1 -b jdk-17+8 https://github.com/openjdk/jdk.git
@cjjavellana
cjjavellana / Dockerfile
Last active July 24, 2023 14:38
Building Ruby 3.2.2 from source
FROM redhat/ubi8:latest
RUN yum install -y make gcc wget zlib perl
RUN cd /tmp && \
wget https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz && \
wget https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz && \
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1u/openssl-1.1.1u.tar.gz && \
wget https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz && \
tar xzvf ruby-3.2.2.tar.gz && \
@cjjavellana
cjjavellana / Dockerfile
Created June 27, 2021 03:16
Compile Python From Source for centos / rhel / fedora
FROM centos:latest
USER root
# We separate update as this step takes too long
RUN yum -y update
RUN yum -y groupinstall "Development Tools" && \
yum -y install gcc openssl-devel bzip2-devel libffi-devel && \
yum -y install wget
@cjjavellana
cjjavellana / md
Last active January 25, 2021 13:53
Reading MT Block 4 Tags
```
^:([A-Z0-9])+:(.|\n)+?((?=^:)|(?=^-}))
```
Sample
```
{1:F01SCBLGB2LAWEB4388030285}{2:I1010000200207ABCDSGSXXX4388030285200 } {3:{108:SPAYMENT}}{4:
:20:BLAHBLAH
:28D:1/1
:50H:/BLAHBLAH
@cjjavellana
cjjavellana / localstackfix.md
Last active May 10, 2019 16:12
Fixing localstack start error when using node 11.11

Problem:

Error: Command failed: /xxxxx/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];\ngyp ERR! stack   File "<string>", line 1\ngyp ERR! stack     
import sys; print "%s.%s.%s" % sys.version_info[:3];\ngyp ERR! stack                                
^\ngyp ERR! stack SyntaxError: invalid syntax\ngyp ERR! stack \ngyp ERR! stack     
at ChildProcess.exithandler (child_process.js:297:12)\ngyp ERR! stack     
at ChildProcess.emit (events.js:197:13)\ngyp ERR! stack     
at maybeClose (internal/child_process.js:984:16)\ngyp ERR! stack     
at Socket.stream.socket.on (internal/child_process.js:401:11)\ngyp ERR!
@cjjavellana
cjjavellana / chat.py
Created May 1, 2019 08:25
A Simple Telnet Chat App
#!/usr/bin/env python3
import _thread
import threading
import queue
import socket
import signal
import sys
class ClientInputReader(threading.Thread):
@cjjavellana
cjjavellana / gdbinit
Created April 20, 2019 11:21 — forked from chrislongo/gdbinit
.gdbinit - A user-friendly gdb configuration file
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.3 (16/04/2010)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: https://www.reverse-engineering.net
@cjjavellana
cjjavellana / gdb.md
Last active February 27, 2019 19:10
Fun With GDB

Dereferencing a pointer

(gdb) p argv
$3 = (char **) 0x7fffffffe7a8
(gdb) x/s *((char **) 0x7fffffffe7a8)
$ docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined