find . -iname *.jpg -exec jpegoptim -p -m60 –strip-all {} \;
Read moreCategory: Work Notes
Nginx: client intended to send too large body
Если у вас не загружаются файлы большого размера, и в логах вы видите ошибку: Nginx: client intended to send too large body Откройте конфигурационный файл […]
Read moreЛокали на Debian
Иногда бывает вот так: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = […]
Read moreИз доп. поля берем параметр и обновляем пост WordPress
$postid = get_the_ID(); echo $postid; $newposturl = get_post_meta( $postid, ‘permalink’ ); $newurl=$newposturl[“0”]; $my_post = array( ‘ID’ => $postid, ‘post_name’ => $newurl ); wp_update_post( $my_post );
Read morePHP парсинг таблицы
Используем библиотеку: http://simplehtmldom.sourceforge.net/ $html = file_get_html(‘http://flow935.com/playlist/flowhis.HTM’); foreach($html->find(‘tr’) as $row) { // Parse table row here } require(‘simple_html_dom.php’); $table = array(); $html = file_get_html(‘http://flow935.com/playlist/flowhis.HTM’); foreach($html->find(‘tr’) as […]
Read moreProtected: Школа Кайлас 1-я ступень (конспект)
There is no excerpt because this is a protected post.
Read moreПолезные однострочники BASH
Посчитать количество айпишников в логах apache или nginx: cat access.log |awk ‘{print $1}’ |sort |uniq -c |sort -n|tail Здесь есть еще: http://www.bashoneliners.com/
Read moreИзменить таймзону на Debian
Как изменить временную зону timezone на debian а вот так: dpkg-reconfigure tzdata
Read moreКак сделать chmod только для папок
Чтобы рекурсивно задать директориям права доступа чтение и выполнение пишем: find /path/to/base/dir -type d -exec chmod 755 {} + Чтобы рекурсивно задать папкам права доступа […]
Read morenginx + livestreet
В принципе работает с дефолтными настройками, но нужно добавить строку: try_files $uri $uri/ /index.php?$args; и тогда все будет хорошо.
Read more