Posted
on October 23, 2015, 6:44 am,
by admin,
under
bash,
linux.
Run optipng to optimize png files in directory:
for i in `ls`; do optipng -i0 -o7 -zm1-9 $i; done
Run optipng for a single file:
/usr/bin/optipng -i0 -o7 -zm1-9 upload/banner/kaspi132px.png
Run jpegoptim for a single file:
/usr/bin/jpegoptim –strip-all upload/banner/kaspi132px.jpg
Run gifscle for a single file:
/usr/bin/gifsicle -b -O2 upload/banner/kaspi132px.gif
Posted
on October 22, 2015, 10:53 am,
by admin,
under
mysql.
mysqldump -u -p db table1 table2 table3
Posted
on October 14, 2015, 8:26 am,
by admin,
under
yii.
Edit config/main.php (or config/web.php), add or remove the following code:
$config[‘bootstrap’][] = ‘debug’;
$config[‘modules’][‘debug’] = ‘yii\debug\Module’;
Posted
on October 10, 2015, 8:09 pm,
by admin,
under
mysql.
mysqlcheck -c databasename -uyourusername -pyourpassword
Posted
on October 9, 2015, 8:29 am,
by admin,
under
git.
If you want to rename a branch while pointed to any branch, simply do :
git branch -m oldname newname
If you want to rename the current branch, you can simply do:
Posted
on September 28, 2015, 1:01 pm,
by admin,
under
apache.
This setup excludes base url http://www.example.com from rewritting but any other url for example http://www.example.com/dis will be rewritten to http://www.example.net/dis
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]
Posted
on September 27, 2015, 9:22 am,
by admin,
under
apache.
For Debian/Ubuntu default installation no need to add NameVirtualHost directive.
working configuration:
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/path
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from none
ErrorLog ${APACHE_LOG_DIR}/error-yourdomain.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel error
CustomLog ${APACHE_LOG_DIR}/access-yourdomain.log combined
Posted
on September 24, 2015, 3:29 pm,
by admin,
under
php.
php library: https://github.com/bensquire/php-image-optim
png: advpng, optipng, pngout, pngquant, pngcrush
jpg: jpegoptim, jpegtran
gif: gifscle
Posted
on September 12, 2015, 1:31 pm,
by admin,
under
git.
Posted
on September 5, 2015, 11:29 am,
by admin,
under
beanstalk.
Tubes:
[ready]->[reserved: in processing]->[delayed: (timeout before again moving to ready tube)]