Skip to content

Instantly share code, notes, and snippets.

mklooss / 1_database_export_import_readme.txt
Last active November 13, 2023 06:58
Export MySQL/MariaDB Database in Tables
View 1_database_export_import_readme.txt
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 / find-old-debian-packages.php
Last active March 14, 2017 14:54
find old debian packages after upgrade
View find-old-debian-packages.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 / paypal_cert_test.php
Last active April 9, 2018 22:42
PHP PayPal new certificate test
View paypal_cert_test.php
File prepared by Matt Weinberg, and
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 / csvToObjArr.js
Last active August 29, 2015 14:02
JavaScript CSV to Array of Objects
View csvToObjArr.js
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');
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 / Observer.php
Created November 13, 2013 09:09
Magento form_key validation failed in 1.8 after upgrade from 1.7
View Observer.php
class MyCompany_MyModul_Model_Observer
public function addDisableValidatFromKey(Varien_Event_Observer $observer)