Высоконагруженность здесь ни причём. Просто ООП — говно.
http://habrahabr.ru/company/vkontakte/blog/214877/#comment_7381757
TVSTRANGERTHINGS

PR's Tumblrdome
AnasAbdin
Monterey Bay Aquarium
we're not kids anymore.
noise dept.

JVL
2025 on Tumblr: Trends That Defined the Year
NASA

Discoholic 🪩
taylor price

Kiana Khansmith

ojovivo
"I'm Dorothy Gale from Kansas"
PUT YOUR BEARD IN MY MOUTH
Claire Keane
Jules of Nature

seen from United States

seen from Germany
seen from United States
seen from United States

seen from United States
seen from United States

seen from United States

seen from United States
seen from Russia

seen from United States
seen from United States
seen from United States

seen from United States
seen from United States
seen from United States

seen from United States
seen from Australia

seen from United Kingdom

seen from Lithuania

seen from United States
@tech-nix
Высоконагруженность здесь ни причём. Просто ООП — говно.
http://habrahabr.ru/company/vkontakte/blog/214877/#comment_7381757

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
fail2ban nginx jails
Put in /etc/fail2ban/jail.conf
[nginx-ddos] # Based on apache-badbots but a simple IP check (any IP requesting more than # 240 pages in 60 seconds, or 4p/s average, is suspicious) # Block for two full days. # @author Yannick Warnier enabled = true port = http,https filter = nginx-ddos logpath = /var/log/nginx*/*access*.log findtime = 60 bantime = 172800 maxretry = 240 [nginx-auth] enabled = true port = http,https filter = nginx-auth logpath = /var/log/nginx*/*error*.log bantime = 600 # 10 minutes maxretry = 6 [nginx-badbots] enabled = true port = http,https filter = apache-badbots logpath = /var/log/nginx*/*access*.log bantime = 86400 # 1 day maxretry = 1 [nginx-proxy] enabled = true port = http,https filter = nginx-proxy logpath = /var/log/nginx*/*access*.log maxretry = 0 bantime = 86400 # 1 day
Create files /etc/fail2ban/filter.d/nginx-ddos.conf
# Fail2Ban configuration file # # Generated on Fri Jun 08 12:09:15 EST 2012 by BeezNest # # Author: Yannick Warnir # # $Revision: 1 $ # [Definition] # Option: failregex # Notes.: Regexp to catch a generic call from an IP address. # Values: TEXT # failregex = ^ -.*"(GET|POST).*HTTP.*"$ # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. # Values: TEXT # ignoreregex =
/etc/fail2ban/filter.d/nginx-proxy.conf
# Proxy filter /etc/fail2ban/filter.d/proxy.conf: # # Block IPs trying to use server as proxy. # # Matches e.g. # 192.168.1.1 - - "GET http://www.something.com/ # [Definition] failregex = ^ -.*GET http.* ignoreregex =
/etc/fail2ban/filter.d/nginx-auth.conf
# # Auth filter /etc/fail2ban/filter.d/nginx-auth.conf: # # Blocks IPs that fail to authenticate using basic authentication # [Definition] failregex = no user/password was provided for basic authentication.*client: user .* was not found in.*client: user .* password mismatch.*client: ignoreregex =
Инфа в motd
apt-get install landscape-common
Вообще что бы не устраивать танцев с бубнами при импорте CSV файла в Excel линейке инструментов, есть таб «Данные» (Data), и в ней кнопка — «из текстового файла» (From text). При этом поднимается Мастер который по шагам вам поможет импортировать файл. Где в том числе спрашивается какой знак является разделителем. Все остальное — от не знания :)
http://habrahabr.ru/company/mailru/blog/129476/#comment_4286673
Simple virus scanner
#!/bin/sh if [ -f dkdmd5.txt ] then mv dkdmd5.txt dkdmd5.old.txt fi for i in php htaccess js do find /home/deukduser/public_html/ -iname "*.$i*" -exec md5sum "{}" \; >> dkdmd5.txt done if [ -f dkdmd5.old.txt ] then diff dkdmd5.txt dkdmd5.old.txt > dkdmd5.diff fi if [ -s dkdmd5.diff ] then cat dkdmd5.diff | mail -s "deutsch-kd.ru - file integrity check failed" [email protected] < dkdmd5.diff

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
koding fix upstaert errors
Got it myself! when new jobs are inserted into /etc/init then the update is not noticed until the next check. Myscript is at lot faster then check frenquence so the update needs to be initiation ny hand:
sudo initctl reload-configuration
Example of a complex dynamic query with subqueries in Drupal 7
I often find it hard to find good examples of Drupal 7 dynamic queries – especially when you are joining on to dynamically created tables so have put this up here for reference:
// sub query 1 $sq_visitors = db_select('ab_visitors', 'a')->fields('a', array('nid')); $sq_visitors->addExpression('COUNT(ref)', 'count'); $sq_visitors->groupBy('nid'); // sub query 2 $sq_clicks = db_select('ab_actions', 'a')->fields('v', array('nid')); $sq_clicks->join('ab_visitors', 'v', 'v.ref = a.ref'); $sq_clicks->addExpression('COUNT(a.id)', 'clicks'); $sq_clicks->groupBy('v.nid'); // sub query 3 $sq_details = db_select('ab_visitors', 'a')->fields('a', array('nid')); $sq_details->isNotNull('a.name'); $sq_details->addExpression('COUNT(ref)', 'details'); $sq_details->groupBy('nid'); // main query $query = db_select('node', 'n') ->fields('n', array('nid', 'title')) ->fields('a', array('field_a_or_b_value')) ->fields('s', array('field_sister_page_target_id')) ->fields('x', array('count')) ->fields('y', array('clicks')) ->fields('z', array('details')) ->condition('n.type', 'landing_page'); $query->join('field_data_field_a_or_b', 'a', 'a.entity_id = n.nid'); $query->join('field_data_field_sister_page', 's', 's.entity_id = n.nid'); $query->addJoin('LEFT OUTER', $sq_visitors, 'x', 'x.nid = n.nid'); $query->addJoin('LEFT OUTER', $sq_clicks, 'y', 'y.nid = n.nid'); $query->addJoin('LEFT OUTER', $sq_details, 'z', 'z.nid = n.nid'); $result = $query->execute()->fetchAll();
Resize than crop imagemagick
convert myPhoto.jpg -resize 200x200^ -gravity Center -crop 200x200+0+0 +repage myThumb.png
Не срабатывает ssh-add
ssh-add Could not open a connection to your authentication agent.
Не мытьем, так катаньем
eval `ssh-agent -s` ssh-add
Munin и MySQL
Missing dependency Cache::Cache
Делаем
apt-get install libwww-perl libcache-cache-perl
После чего включаем и конфигурируем плагины
munin-node-configure --suggest 2>/dev/null |grep mysql
munin-node-configure --shell | grep mysql | sh

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Нас, с другой стороны, считали безнадежными бюрократами. После того как Microsoft потеряла исходный код последней сборки OS/2, которая была уже отправлена в магазины, я нашел ошибку, происходившую при двойном клике на Chkdisk: программа запускалась в двух экземплярах, оба пытались исправить диск и портили данные. Я написал, что «это может расходится с той задачей, ради которой пользователь запускал программу». Они сочли это ошибкой пользователя и какой-то парень по фамилии Баллмер спросил, почему я так «одержим» качеством кода.
Dominic Connor
Дебиан после установки сыпет ошибками
Например такими
locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory
Полечим строчкой
localedef ru_RU.UTF-8 -i ru_RU -fUTF-8
Optimize only fragmented tables in MySQL
in/sh echo -n "MySQL username: " ; read username echo -n "MySQL password: " ; stty -echo ; read password ; stty echo ; echo mysql -u $username -p"$password" -NBe "SHOW DATABASES;" | grep -v 'lost+found' | while read database ; do mysql -u $username -p"$password" -NBe "SHOW TABLE STATUS;" $database | while read name engine version rowformat rows avgrowlength datalength maxdatalength indexlength datafree autoincrement createtime updatetime checktime collation checksum createoptions comment ; do if [ "$datafree" -gt 0 ] ; then fragmentation=$(($datafree * 100 / $datalength)) echo "$database.$name is $fragmentation% fragmented." mysql -u "$username" -p"$password" -NBe "OPTIMIZE TABLE $name;" "$database" fi done done
Yep. But,
mysqlcheck -o –all-databases
this single line command replaces that script and it’s easier to use…
Improve ubuntu performance.
Всего-то нужно дописать в /etc/sysctl.conf
vm.swappiness = 0
И применить без перезагрузки
sysctl vm.swappiness=0
Посмотреть текущий можно командой
cat /proc/sys/vm/swappiness
Второй монитор
Чтобы добавить второй монитор как продолжение первого пропишем в автозапуск
xrandr --output DVI-0 --auto --output DVI-1 --auto --right-of DVI-0

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Apache status
Если apache упорно отдаёт Drupal вместо статуса, нужно добавить следующую строку
RewriteCond %{REQUEST_URI} !=/server-status
в .htaccess, в блок
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]