Skip to content

Instantly share code, notes, and snippets.

View jabinb's full-sized avatar

Jabin jabinb

  • Stock Story, Inc.
  • Sydney, Australia
View GitHub Profile
@jabinb
jabinb / f1stats.ps1
Created August 22, 2024 23:43
Freeshard protocol 0xF1 server stats
# Set your shard ip/port
$ipAddress = ""
$port = 2593
# Raw packet data
$byteArray = [byte[]](
0x00, 0x01, 0x02, 0x03, # Seed
0xF1, # Freeshard protocol stats packet id
0x00, 0x04, # Length
0xFF # Info type, 0xFF = extended, 0xFE = compact
@jabinb
jabinb / build-rpm.sh
Created February 27, 2019 03:38
Build source RPM from fedora rawhide
#!/bin/sh -ex
# Author: Jabin Bastian <jabin@simplywallst.com>
# ./build-rpm.sh
#
# This script builds an RPM using mock via the mmornati/mock-rpmbuilder docker container.
# The container requires privileged access in order to run, @see https://github.com/mmornati/docker-mock-rpmbuilder
# Source RPMs are fetched from the Fedora Rawhide repo.
#
# Variables:
@jabinb
jabinb / mirror_remote_directory_to_local_directory
Created September 21, 2018 01:25 — forked from pixeline/mirror_remote_directory_to_local_directory
Bash script using lftp to mirror remote directory to local directory, thus keeping the local directory synchronized with the remote one.
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
#
# FTP LOGIN
HOST='sftp://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
# DISTANT DIRECTORY
@jabinb
jabinb / SendgridAsmMigrator.php
Created July 21, 2017 04:27
Migrates ASM unsubscribes from one sendgrid account to another
<?php
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use GuzzleHttp\Client as Client;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;
@jabinb
jabinb / cfgparser.php
Created February 2, 2016 08:04
Small script for parsing POL (PenUltima Online) cfg files and converting them into JSON
<?php
class PolCfgParser
{
const ENTRY_REGEX = "/^(?<entry_type>\\w+)\\s+(?<entry_name>\\w+|\\d+)$\\s*\\{\\s*(?<entry_content>[\\w\\s\\d\\+\\:|\\'|\\\"]*)\\s*\\}/smi";
const PROP_REGEX = "/\\s*(?<cprop>CProp)*\\s*(?<param>\\w+)\\s+(?<value>[\\d|\\w|\\h|\\\"|\\'|\\:|\\+]+)/smi";
public $pattern;
public $recurse;
public $flags;
@jabinb
jabinb / cfgparser.php
Created February 2, 2016 08:04
Small script for parsing POL (PenUltima Online) cfg files and converting them into JSON
<?php
class PolCfgParser
{
const ENTRY_REGEX = "/^(?<entry_type>\\w+)\\s+(?<entry_name>\\w+|\\d+)$\\s*\\{\\s*(?<entry_content>[\\w\\s\\d\\+\\:|\\'|\\\"]*)\\s*\\}/smi";
const PROP_REGEX = "/\\s*(?<cprop>CProp)*\\s*(?<param>\\w+)\\s+(?<value>[\\d|\\w|\\h|\\\"|\\'|\\:|\\+]+)/smi";
public $pattern;
public $recurse;
public $flags;