Skip to content

Instantly share code, notes, and snippets.

View werdan's full-sized avatar

Andriy Samilyak werdan

View GitHub Profile
@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",
#!/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
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
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(
#################################
# 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
@werdan
werdan / Magento cron lister
Last active July 2, 2021 22:15
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');
@werdan
werdan / gist:5910290
Created July 2, 2013 15:28
Swimsuitsdirect DNS changes
swimsuitsdirect.com TXT v=spf1 a ptr ip4:23.23.225.84 ptr:23.23.225.84 include:23.23.225.84 mx:swimsuitsdirect.com ?all
_amazonses.swimsuitsdirect.com TXT 5nIqTI017sXQZ0F8E40s9YS0C0KPdNF6V/pXNBjw4D8=
m6mkxy44lpdu2dn4qvflf4fkye474lc3._domainkey.swimsuitsdirect.com CNAME m6mkxy44lpdu2dn4qvflf4fkye474lc3.dkim.amazonses.com
3reahlxgnvydkapxw5lv4ej2afrmu4dc._domainkey.swimsuitsdirect.com CNAME 3reahlxgnvydkapxw5lv4ej2afrmu4dc.dkim.amazonses.com
2r7234p4cfowygzb5va5pzskuxjag4nq._domainkey.swimsuitsdirect.com CNAME 2r7234p4cfowygzb5va5pzskuxjag4nq.dkim.amazonses.com
@werdan
werdan / 0_reuse_code.js
Created November 14, 2013 10:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
_amazonses.togas.ru TXT I7nNrhOJlkMat8PT47xh+NGWTxbSBa/xq4QPJ1WY7uI=
6gek6j6ifrxp5otptw23cj5anchzx5bv._domainkey.togas.ru CNAME 6gek6j6ifrxp5otptw23cj5anchzx5bv.dkim.amazonses.com
2xsitoapbi3gz7gy5wzv3wfnw6tlhnuw._domainkey.togas.ru CNAME 2xsitoapbi3gz7gy5wzv3wfnw6tlhnuw.dkim.amazonses.com
gwm6p5omfhfljes7ac6urcpuivepklsy._domainkey.togas.ru CNAME gwm6p5omfhfljes7ac6urcpuivepklsy.dkim.amazonses.com
@werdan
werdan / gist:9516335
Last active August 29, 2015 13:57
DB updates
update sales_flat_order set status = 'ready' where increment_id like '100001656' limit 1 \G;
update sales_flat_order_grid set status='ready' where increment_id like "%1656%"\G;
select entity_id from sales_flat_order where increment_id like "100001716";
### 1648
insert into sales_flat_order_status_history values(null, 1648, 0, 1, "Изменён статус заказа", 'ready', NOW() , 'order', 'Support');
update sales_flat_order set state="pending_payment", status = 'pending_payment' where increment_id like '100001716' limit 1 \G;
update sales_flat_order_grid set status='pending_payment' where increment_id like "100001716" \G;
select entity_id from sales_flat_order where increment_id like "100001716";