Skip to content

Instantly share code, notes, and snippets.

View fbrnc's full-sized avatar

Fabrizio Branca fbrnc

  • AOE
  • Wiesbaden, Germany
  • X @fbrnc
View GitHub Profile
Verifying that +fabrizio is my blockchain ID. https://onename.com/fabrizio
@fbrnc
fbrnc / gist:8527270
Created January 20, 2014 19:22
Install Guest Additions
# Select "Install Guest Additions" in the VirtualBox Gui
apt-get update
apt-get install build-essential linux-headers-$(uname -r)
mkdir /media/cdrom
mount /dev/cdrom1 /media/cdrom
cd /media/cdrom
./VirtualBoxAdditions.run
@fbrnc
fbrnc / gist:7244237
Created October 31, 2013 04:05
Minimum script to troubleshoot Magento database connection problems
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
set_include_path('lib' . PATH_SEPARATOR . get_include_path());
spl_autoload_register('autoload');
function autoload($class)
@fbrnc
fbrnc / gist:7051932
Last active December 25, 2015 22:39
DISCLAIMER: This is experimental! Never run this on a production database and create database backups before running this script in every case. Magento EE 1.13 populates some MySQL change log tables using triggers. but some of them might not be needed and won't be processed if the corresponding indexer is not being used (e.g. flat tables or full…
<?php
$table = 'catalogsearch_fulltext_cl';
// $table = 'catalog_product_flat_cl';
// $table = 'catalog_category_flat_cl';
$db = new mysqli('host', 'user', 'password', 'dbname');
if ($db->connect_errno > 0) {
die('Unable to connect to database [' . $db->connect_error . ']');
}
@fbrnc
fbrnc / gist:5864315
Last active December 18, 2015 23:49
Install some dev-tools
TARGETFOLDER="/usr/local/bin"
sudo curl -sSo $TARGETFOLDER/modman https://raw.github.com/colinmollenhour/modman/master/modman && sudo chmod +x $TARGETFOLDER/modman
sudo curl -sSo $TARGETFOLDER/n98-magerun.phar https://raw.github.com/netz98/n98-magerun/master/n98-magerun.phar && sudo chmod +x $TARGETFOLDER/n98-magerun.phar
sudo curl -sSo $TARGETFOLDER/phpunit.phar https://phar.phpunit.de/phpunit.phar && sudo chmod +x $TARGETFOLDER/phpunit.phar
sudo curl -sSo $TARGETFOLDER/phploc.phar https://phar.phpunit.de/phploc.phar && sudo chmod +x $TARGETFOLDER/phploc.phar
sudo curl -sS https://getcomposer.org/installer | php -- --install-dir=$TARGETFOLDER
@fbrnc
fbrnc / gist:5784176
Last active December 18, 2015 12:39
Seeing "Warning: include(): Failed opening 'File.php' for inclusion" errors in your logs?Check your cache settings in local.xml. The correct value is "File", otherwise it will still work because of the fallback but look up a non-existing file and flood your logs)
<config>
<global>
<cache>
<backend>File</backend>
<!-- not "Files", "files", or "file" (Although this mentioned in app/etc/local.xml.additional. It will work because it will fallback to the file backend, but it will flood your error log... -->
</cache>
</global>
</config>
@fbrnc
fbrnc / gist:5672355
Last active December 17, 2015 21:09
~/.bashrc
alias ll='ls -lha --color'
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
export HISTSIZE=1000000
export HISTFILESIZE=1000000000
export SVN_EDITOR=vi
#export GREP_OPTIONS='--color=always'
# see: https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps
shopt -s histappend
@fbrnc
fbrnc / gist:5672325
Created May 29, 2013 17:59
~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[1~": beginning-of-line
"\e[4~": end-of-line
@fbrnc
fbrnc / gist:5579585
Created May 14, 2013 21:12
Adding Varien_Profiler statements for easier Profiling using Aoe_Profiler
<?php
class Mage_Core_Block_Abstract {
public function getChildHtml($name='', $useCache=true, $sorted=false)
{
Varien_Profiler::start('getChildHtml: '.$name);
if ('' === $name) {
if ($sorted) {
$children = array();
@fbrnc
fbrnc / gist:5548375
Created May 9, 2013 15:58
C:\Users\<USER>\AppData\Roaming\Mozilla\Firefox\Profiles\<PROFILE>\chrome\userContent.css
pre, code {
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
}