Skip to content

Instantly share code, notes, and snippets.

@spinsch
spinsch / test.php
Created January 30, 2019 09:04
test script to find the correct method
<?php
$data = "123456";
$key = "17839778773fadde0066e4578710928988398877bb123789";
$options = 0;
$key = pack("H*", $key);
foreach (openssl_get_cipher_methods() as $method)
{
$enc = @openssl_encrypt($data, $method, $key, $options);
@spinsch
spinsch / test
Last active September 26, 2019 15:19
Test
▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏
▕ TEST ▕
▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏
@spinsch
spinsch / mozjpeg.sh
Last active June 19, 2024 09:31
optimize images with mozjpeg recursively
#!/bin/bash
#
# usage: bash mozjpeg.sh directory
#
find "$1" -type f -name '*.jpg' -print0 | while read -d $'\0' file
do
echo ${file}
mkdir -p opt/"$(dirname "$file")"
djpeg $file | cjpeg -quality 80 | jpegtran -optimize -progressive > opt/$file
done