Skip to content

Instantly share code, notes, and snippets.

View mubbashar's full-sized avatar

Mubbashar Husain mubbashar

View GitHub Profile
@eoli3n
eoli3n / encryption.php
Last active April 1, 2024 20:08
Encrypt - Decrypt AES from/to Python PyCryptodome from/to PHP openssl
<?php
// use to generate key : 'openssl rand -hex 32'
function my_encrypt($data, $passphrase) {
$secret_key = hex2bin($passphrase);
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));
$encrypted_64 = openssl_encrypt($data, 'aes-256-cbc', $secret_key, 0, $iv);
$iv_64 = base64_encode($iv);
$json = new stdClass();
$json->iv = $iv_64;
@sshymko
sshymko / install_mysql_client.sh
Last active March 14, 2024 20:10
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client
@bwicklund
bwicklund / s3_file_combine.py
Last active March 12, 2023 08:27
S3 file Concatenation/Combination. S3 Spark file merge.
import argparse
import boto3
import os
import threading
from fnmatch import fnmatch
# S3 multi-part upload parts must be larger than 5mb
MIN_S3_SIZE = 6000000
LOG_LEVEL = 'INFO'
@vector-kerr
vector-kerr / laravel-queue-worker.pm2.yml
Created November 22, 2017 23:01
Laravel Queue Worker PM2 Application Definition
#
# This file provides an application definition that can be used with
# PM2 ("Production Process Manager").
#
# PM2 "allows you to keep applications alive forever, to reload them
# without downtime and to facilitate common system admin tasks."
#
# Use this file by running it with PM2. For example:
# $> pm2 start laravel-queue-worker.pm2.yml
#