Skip to content

Instantly share code, notes, and snippets.

View maverick193's full-sized avatar
💪
<strong>Grind to Greatness</strong>

Mohammed NAHHAS maverick193

💪
<strong>Grind to Greatness</strong>
View GitHub Profile
@maverick193
maverick193 / sign.sh
Created February 6, 2020 12:43 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
@maverick193
maverick193 / gist:a5d63de497723d5ccc86
Created December 22, 2014 14:18
Memcached et Can't get filling percentage
if ($memSize === null || $memUsed === null) {
$mem = $this->_memcache->getstats();
if (isset($mem['limit_maxbytes']) && $mem['limit_maxbytes'] > 0) {
return ((int) (100 * ($mem['bytes'] / $mem['limit_maxbytes'])));
} else {
return 100;
}
//ne renvoie plus d'exception
//Zend_Cache::throwException('Can\'t get filling percentage');
@maverick193
maverick193 / gist:9141987
Last active August 29, 2015 13:56
Create Magento Admin User
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('max_execution_time', 300);
ini_set('memory_limit', '1024M');
define('MAGENTO_ROOT', getcwd());
require_once(MAGENTO_ROOT . '/app/Mage.php');
Mage::setIsDeveloperMode(true);
@maverick193
maverick193 / gist:8556341
Created January 22, 2014 10:12
Dynamique Cron Expression System Configuration
+ Dans config.xml :
<config>
<crontab>
<jobs>
<cron_task_identifier>
<run>
<model>mon_module/cron::run</model>
</run>
</cron_task_identifier>
</jobs>
@maverick193
maverick193 / gist:8392722
Last active January 3, 2016 01:59
composer.json to install magento-cache-crawler
{
"name": "project name",
"require": {
"maverick/magento-cache-crawler": "*",
"magento-hackathon/magento-composer-installer": "*"
},
"repositories": [
{
"type": "vcs",
"url": "git://github.com/maverick193/magento-cache-crawler.git"