Skip to content

Instantly share code, notes, and snippets.

View paramonovav's full-sized avatar
🏠
Working from home

Anton Paramonov paramonovav

🏠
Working from home
View GitHub Profile

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@paramonovav
paramonovav / ImageOptimize
Last active August 29, 2015 14:25 — forked from Spir/ImageOptimize
Simple command for Laravel 4 to optimize your images using jpegoptim and optipng. Fill in the $imagesFolders array and run. http://freecode.com/projects/jpegoptim http://optipng.sourceforge.net/
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class ImageOptimize extends Command {
/**
* The console command name.
@paramonovav
paramonovav / filters.php
Last active August 29, 2015 14:26 — forked from zackify/filters.php
Cache Everything in laravel with 4 extra lines of code!
App::before(function($request)
{
$key = Str::slug($request->url());
if(Cache::has($key)) return Cache::get($key);
});
App::after(function($request, $response)
{
$key = Str::slug($request->url());
@paramonovav
paramonovav / install-nginx-with-spdy.sh
Last active September 9, 2015 08:25
Install NGINX 1.8.0 (--with-threads) with OpenSSL 1.0.2d and SPDY (support TLSv1.1, TLSv1.2) on CentOS
cd /usr/local/src/
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -xvf nginx-1.8.0.tar.gz
wget https://www.openssl.org/source/openssl-1.0.2d.tar.gz
tar -xvf openssl-1.0.2d.tar.gz
cd nginx-1.8.0/
@paramonovav
paramonovav / ip2nation.php
Created August 8, 2015 16:14
ip2nation.com
<?php
$server = ''; // MySQL hostname
$username = ''; // MySQL username
$password = ''; // MySQL password
$dbname = ''; // MySQL db name
$db = mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
@paramonovav
paramonovav / raid_status.sh
Last active August 29, 2015 14:27
show raid 1 status on CentOS 6
#show raid status
mdadm --detail /dev/md0
lsraid -a /dev/md0
#http://www.tecmint.com/create-raid1-in-linux/
@paramonovav
paramonovav / monitoring_raid.sh
Created August 9, 2015 22:09
Monitoring RAID arrays
mdadm --monitor --mail=root@localhost --delay=1800 /dev/md2
#should release a mdadm daemon to monitor /dev/md2. The delay parameter means that polling will be done in intervals of 1800 seconds. Finally, critical events and fatal errors should be e-mailed to the system manager. That's RAID monitoring made easy.
#Finally, the --program or --alert parameters specify the program to be run whenever an event is detected.
@paramonovav
paramonovav / systemd.md
Last active August 29, 2015 14:27
Управление логгированием в systemd

##Управление логгированием в systemd

###Установка времени

Одним из существенных недостатков syslog является сохранение записей без учёта часового пояса. В journal этот недостаток устранён: для логгируемых событий можно указывать как местное время, так и универсальное координированное время (UTC). Установка времени осуществляется с помощью утилиты timedatectl. Просмотреть список часовых поясов можно при помощи команды:

$ timedatectl list-timezones

Установка нужного часового пояса осуществляется так:

@paramonovav
paramonovav / sticky_footer.html
Created August 18, 2015 20:53
Footer Sticky At Bottom With Flexible Height
@paramonovav
paramonovav / .sh
Created August 21, 2015 14:12
How to use Jpegoptim recursively
find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \;