Check and optimize tables in MySQL

To check and optimize tables of a MySQL database: $> mysqlcheck -os <db_name> -u<username> -p To achieve the same for all databases of the respective MySQL server you can run the following command: $> mysqlcheck -Aos -u<username> -p Further information about check and optimize tables in MySQL To get a few more facts about how […]

Add Content In Magento Controller

If you want to add content to the rendered page inside a controller action, you can do it like that: $this->loadLayout(); $message = $this->getLayout() ->createBlock(‘core/text’, ‘ready-block’) ->setText(‘<h1>Testaction for Controller:</h1>’); $this->getLayout()->getBlock(‘content’)->insert($message); $this->renderLayout();  

Xdebug

Manual Install The following Instructions based on http://xdebug.org/wizard.php help you to install it manually: Download the latest version (xdebug-x.x.x.tgz) from  http://xdebug.org/download.php Unpack the downloaded file with: $> tar -xvzf xdebug-x.x.x.tgz On shell run: $> cd xdebug-2.2.3 $> phpize #(See the FAQ if you don’t have phpize. Result should be: Configuring for: … Zend Module Api […]

Virtual hosts (vHosts)

Activate a vHost $> a2ensite 000-ask-sheldon.com In this example 000-ask-sheldon.com refers to the vhost configuration that is defined under /etc/apache2/sites-available/000-ask-sheldon.com . a2ensite creates a symbolic link under /etc/apache2/sites-enabled with the name 000-ask-sheldon.com that points to the configuration file /etc/apache2/sites-available/000-ask-sheldon.com. So you can see, that you can do it manually too.  Deactivate a vHost $> a2dissite 000-ask-sheldon.com In contrast […]

Run multiple recoverabele sessions with screen

Sometime you nee to run a script or something like that on a remote host and you can’t be sure, that the remote session will preserve until the script has finished. Another case is mobile working. Sometimes you need the possibility to start a script on one place, send your disconnect the ssh client and open […]

Magerun

Magerun is a very useful commandline tool for dealing with daily Magento development problem like: clean / flush caches reindexing the indices set configuration values in the database (core_config_data) shorthand query syntax for database accesses … It’s developed by netz98 (http://www.netz98.de/) and made my daily business so much easier. Installation (Linux) $> wget https://raw.githubusercontent.com/netz98/n98-magerun/master/n98-magerun.phar $> […]

Get free disk space and partitions

Show free disk space for all existing partitions (disk free): $> df -haT Example output: Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/ubuntu–vg-root ext4 227G 177G 39G 83% / proc proc 0 0 0 – /proc sysfs sysfs 0 0 0 – /sys none tmpfs 4,0K 0 4,0K 0% /sys/fs/cgroup none fusectl 0 0 0 […]

Samba fileserver

All tricks round about samba fileserver goes here. Print Status: $> smbstatus -L Add User Steps to add a new samba user: add Linux-User(m creates a homedirs under /home/): $> useradd abrandt -d /home/abrandt -c “Annika Brandt” -G users -g users -m set Password: $> passwd abrandt set Samba-Password $> smbpasswd -a abrandt Samba reload […]

Sync files with rsync

To sync filesystems over ssh (with port): $> rsync -azvu –exclude-from=’./exclude.txt’ -e ‘ssh -p 26 -o StrictHostKeyChecking=no’ user@host:/PATH/TOREMOTE/FILE/ORFOLDER/ /PATH/TO/LOKAL/FILEORFOLDER; Useful parameters -o StrictHostKeyChecking=no –  tells the the source host to accept the ssh-key from the destination host –exclude-from=’./exclude.txt’ – in exclude.txt each line specifies a path to ignore through synchronization –dry-run – only simulate what would have been […]