Skip to content

Instantly share code, notes, and snippets.

<?php
function encrypt_mcrypt($msg, $key, $iv = null) {
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
if (!$iv) {
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
}
$pad = $iv_size - (strlen($msg) % $iv_size);
$msg .= str_repeat(chr($pad), $pad);
$encryptedMessage = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $msg, MCRYPT_MODE_CBC, $iv);
return base64_encode($iv . $encryptedMessage);
@riskydigital
riskydigital / osgeo_compile.sh
Created March 28, 2021 09:22 — forked from robinkraft/osgeo_compile.sh
compile and install GEOS, PROJ4 and GDAL from source on Ubuntu 12.0.4
# Compile/install GEOS. Taken from:
# http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#GEOS_2
cd /tmp
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
bunzip2 geos-3.4.2.tar.bz2
tar xvf geos-3.4.2.tar
cd geos-3.4.2
// Copyright 2017-2018 Pavitra, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
package com.pavitra;
import android.content.Context;
import android.util.Log;
import com.physicaloid.lib.*;
@riskydigital
riskydigital / hosts-anti-indihome
Last active June 30, 2019 21:12 — forked from abdilahrf/hosts
???????????????????????????????????????? INDIHOM* untuk linux tambahin di file /etc/hosts & windows /System32/drivers/etc/hosts
# INDIHOM*
127.0.0.1 x-tags.net
127.0.0.1 a01.uadexchange.com
127.0.0.1 cdn.uzone.id
127.0.0.1 cdn3.uzone.id
127.0.0.1 cfs.uzone.id
127.0.0.1 csf.uzone.id
127.0.0.1 d01.notifa.info
127.0.0.1 d31qbv1cthcecs.cloudfront.net
127.0.0.1 d5nxst8fruw4z.cloudfront.net