Skip to content

Instantly share code, notes, and snippets.

@arizawan
arizawan / wordpress_install_mariadb.sh
Last active October 26, 2023 06:36
Wordpress Install Script with mariadb + php8.1
## Usage:
##
## wget https://gist.githubusercontent.com/arizawan/37e3be7fa4f42516765acb49eb20375d/raw/wordpress_install_mariadb.sh
## chmod +x wordpress_install_mariadb.sh
## ./wordpress_install_mariadb.sh YOUR_WEBSITE_DOMAIN
##
##
#!/bin/bash
@arizawan
arizawan / _Magento2_DeleteTestData.md
Last active May 26, 2022 05:17 — forked from leek/_Magento2_DeleteTestData.md
Magento 2 - Delete All Test Data

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@arizawan
arizawan / Laravel Voyeger Timezone Select dropdown FormField.json
Created November 14, 2020 06:16
Laravel Voyeger Timezone Select dropdown FormField
{
"default":"Etc/UTC",
"options":{
"Africa/Abidjan":"Africa/Abidjan",
"Africa/Accra":"Africa/Accra",
"Africa/Algiers":"Africa/Algiers",
"Africa/Bissau":"Africa/Bissau",
"Africa/Cairo":"Africa/Cairo",
"Africa/Casablanca":"Africa/Casablanca",
"Africa/Ceuta":"Africa/Ceuta",
### Keybase proof
I hereby claim:
* I am arizawan on github.
* I am arizawan (https://keybase.io/arizawan) on keybase.
* I have a public key ASC3LqLAQLyUo7sG032Vec7eQxB9IVqhagAm2qE5pETxGQo
To claim this, I am signing this object:
@arizawan
arizawan / sequelieze-field-encrypt.js
Created August 6, 2018 07:37 — forked from ajmas/sequelieze-field-encrypt.js
Code to encrypt a Sequelize fields
// Code to encrypt data in sequelize fields
// We are using ascii85 as a way save on storage. Also, note that
// the space delimiter we are using is a bit of an abuse since in
// normal cases ascii85 will skip over it, but since we are using
// after encoding and before encoding, it shouldn't be an issue.
//
// Fields are broken down to facilitate unit testing.
//
// based on code here: http://vancelucas.com/blog/stronger-encryption-and-decryption-in-node-js/
@arizawan
arizawan / s3-in-laravel.php
Created March 10, 2018 05:02 — forked from ukautz/s3-in-laravel.php
Using S3 client directly in Laravel
<?php
/** @var \Illuminate\Filesystem\FilesystemAdapter $fs */
$fs = \Storage::disk('object_storage');
/** @var \League\Flysystem\Filesystem $driver */
$driver = $fs->getDriver();
/** @var \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter */
$adapter = $driver->getAdapter();
@arizawan
arizawan / build-zip-from-s3.php
Created March 10, 2018 05:02 — forked from jeremeamia/build-zip-from-s3.php
Create a zip from objects from S3.
<?php
// These are just the basics for how to do this. Notes:
// - Not fully tested.
// - Not suitable for production.
// - May not work well if large ammounts of data.
// - Requires AWS SDK for PHP and http://php.net/manual/en/book.zip.php
require '/path/to/sdk-or-autoloader';

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@arizawan
arizawan / using-aws-kms.php
Created January 20, 2018 15:36 — forked from lysender/using-aws-kms.php
Using AWS KMS API via PHP SDK
<?php
use Aws\Kms\KmsClient;
// Somewhere in the controller or model
$this->load->config('aws');
// Not needed for EC2 instance role based authorization - for my local instance only
$key = $this->config->item('aws_s3_access_key');
$secret = $this->config->item('aws_s3_secret_key');
@arizawan
arizawan / crypto-ctr.js
Created June 29, 2016 15:18 — forked from chris-rock/crypto-ctr.js
Encrypt and decrypt text in nodejs
// Part of https://github.com/chris-rock/node-crypto-examples
// Nodejs encryption with CTR
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq';
function encrypt(text){
var cipher = crypto.createCipher(algorithm,password)
var crypted = cipher.update(text,'utf8','hex')