Skip to content

Instantly share code, notes, and snippets.

@mklooss
mklooss / 1_database_export_import_readme.txt
Last active May 22, 2024 09:51
Export MySQL/MariaDB Database in Tables
Written on Debian Based Systems
usage: mysql_[import|export].sh DATABASENAME
Splits Database in to multplie files, based on Table Names
schema.sql will be also created!
i've an my_import.cnf / my_export.cnf or exists, this files will be used as Credentails, default is the debian default file.
Files: schema.sql, routines_triggers.sql
@mklooss
mklooss / find-old-debian-packages.php
Last active March 14, 2017 14:54
find old debian packages after upgrade
<?php
/* yeah i know, php buuuuuh */
exec('apt-cache dumpavail | grep "Package:" | awk \'{print $2}\' > packages.txt');
exec('dpkg -l | awk \'{print $2}\' > installed.txt');
$packages = file_get_contents('packages.txt');
$packages = str_replace("\r", '', $packages);
$packages = array_filter((array) explode("\n", $packages));
@mrw
mrw / paypal_cert_test.php
Last active April 9, 2018 22:42
PHP PayPal new certificate test
<?php
/*
File prepared by Matt Weinberg, www.vectormediagroup.com and www.cartthrob.com
EXPLANATION:
In 2018, PayPal will be updating their Live/Production environment.
Many servers, especially older ones, will not be able to connect to PayPal after the settings are changed.
@xandout
xandout / csvToObjArr.js
Last active August 29, 2015 14:02
JavaScript CSV to Array of Objects
function csv2objArr(data, strip, callback){
(strip instanceof Function) ? (callback = strip, strip = 0) : (strip = strip || 0); //Did the user specify strip?
data = data.split('\n' || '\r');
if(strip){
for(var elem in data){//loop to convert "val, val, val" to ["val", " val", " val"]
var tmpArr = data[elem].split(',');
for(var tmpElem in tmpArr){//loop to convert ["val", " val", " val"] to ["val", "val", "val"]
tmpArr[tmpElem] = tmpArr[tmpElem].trim();
}
data[elem] = tmpArr.join(); //convert ["val", "val", "val"] to "val,val,val"
@mklooss
mklooss / Observer.php
Created November 13, 2013 09:09
Magento form_key validation failed in 1.8 after upgrade from 1.7
<?php
class MyCompany_MyModul_Model_Observer
{
/**
*
*
*/
public function addDisableValidatFromKey(Varien_Event_Observer $observer)
{