Skip to content

Instantly share code, notes, and snippets.

View werdan's full-sized avatar

Andriy Samilyak werdan

View GitHub Profile
@werdan
werdan / Magento cron lister
Last active October 24, 2024 18:19
This script lists all Magento cronjobs in the following way: # php listAllCrons.php Job name m h dom mon dow Object::Method to execute enterprise_giftcardaccount_generage_codes_pool 30 * * * * enterprise_giftcardaccount/pool::applyCodesGeneration enterprise_logging_rotate_logs 1 2 * * * enterprise_logging/observer::rotateLogs enterprise_page_cac…
<?php
// shell/listAllCron.php
require_once 'abstract.php';
class Mage_Shell_CronLister extends Mage_Shell_Abstract
{
public function run()
{
$cronJobs = Mage::app()->getConfig()->getNode('crontab/jobs');
#################################
# Recipe that creates chrooted accounts for SFTP access
# Should be installed via adding a corresponding role "has_sftp_user"
# or if needed to install as a separate recipe, be sure that SSH server accepts logins with password
#
# Once installed, you should add a section in node root attributes level , like that:
#
# "ssh":{"chroots":{"import_csv":{"password":"$1$vtmvimM9$S5btvNNycEWa3KQAa.LqL1","folders":{"/var/www/shared/var":"upload"}}}}
#
# where "folders" - is an array of folder to chroot for user import_csv
exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '512723-1-1' for key 'PRIMARY'' in /var/www/releases/20130211085532-v3.6.1/lib/Zend/Db/Statement/Pdo.php:242
Stack trace:
#0 /var/www/releases/20130211085532-v3.6.1/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/releases/20130211085532-v3.6.1/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /var/www/releases/20130211085532-v3.6.1/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO cat...', Array)
#3 /var/www/releases/20130211085532-v3.6.1/lib/Varien/Db/Adapter/Pdo/Mysql.php(335): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO cat...', Array)
#4 /var/www/releases/20130211085532-v3.6.1/app/code/core/Mage/Index/Model/Mysql4/Abstract.php(159): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO cat...')
#5 /var/www/releases/20130211085532-v3.6.1/app/code/core/Mage/Index/Model/Mysql4/Abstract.php(
sudo apt-get remove phpunit
sudo apt-get upgrade pear
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit
#!/bin/csh
## Check beforehand:
## sudo apt-get install csh ffmpeg
## Usage
## ./convert.sh *.MTS
foreach f ($*)
ffmpeg -i $f -ar 44100 -ab 32 -f flv -s 720x480 -aspect 16:9 video.flv
@werdan
werdan / Amazon CloudFormation Template (AutoScaling)
Created December 24, 2012 11:31
Amazon CloudFormation Template (AutoScaling)
{
"Description" : "ProjectX scalable stack of frontal nodes",
"Parameters" : {
"InstanceType" : {
"Description" : "Type of EC2 instance to launch",
"Type" : "String",
"Default" : "m1.xlarge"
},
"SSHKeyName" : {
"Description" : "The EC2 Key Pair to allow SSH access to the instances",