iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP
Tools
Записки программиста, обо всем и ни о чем. Но, наверное, больше профессионального.
2013-08-30
Защита SSH от брутфорса
Posted by Valentin at 12:30 0 comments
2013-08-29
Виндсерфинг видео
Ролик 2/2, Джем Холл продолжает раскрывать секреты правильной стойки в ситуации «режемся на ветер»:
original post http://vasnake.blogspot.com/2013/08/blog-post_28.html
Posted by Valentin at 12:30 0 comments
Labels: windsurfing
2013-08-28
Plone undo_form
Posted by Valentin at 12:30 0 comments
Labels: Zope(Plone)
2013-08-27
Учебник виндсерфинга
Posted by Valentin at 12:30 0 comments
Labels: windsurfing
2013-08-26
Видео
UPD:
На тот случай, если приятное видео запрещено Гугелем, вот альтернатива (без запретных песен): http://youtu.be/5O3SnkZPbcs
Posted by Valentin at 12:30 0 comments
Labels: windsurfing
2013-08-23
Гомоветер
original post http://vasnake.blogspot.com/2013/08/blog-post_23.html
Posted by Valentin at 12:30 0 comments
Labels: windsurfing
2013-08-22
Хрящик
- Operational Diagnostics 1 - a marketing sentiment analysis company uses it for quickly discovering problems in spreadsheets sent to them by their customers. The spreadsheets were often found to be subtly malformed, or had invalid values that could be difficult to find. gristle_determinator was used to quickly sanity-check and find outliers.
- Operational Diagnostics 2 - a large data warehousing team uses it whenever their bulk load process breaks on invalid data. Their database's bulkloader does not provide much info in this kind of a case, so they use gristle_freaker to quickly size up the nature of the data in a few problematic columns, gristle_viewer to examine individual records, and gristle_determinator to sanity-check the file structure. This has speed up the problem determination and resolution steps enormously.
- Feed Analysis - a large data warehousing team uses it whenever they have new potential data sources to analyze. The gristle_determinator quickly finds data quality issues, and identifies characteristics useful for data modeling. On some large complex feeds, it can sometimes perform 8-20 hours of initial analysis in just five minutes.
- gristle_determinator - Analyses csv files and prints information about the file structure and each field within it.
- gristle_slicer - Selects rows and columns out of csv file.
- gristle_freaker - Creates frequency distributions of one or more columns of a csv file.
- gristle_viewer - Displays a single record from a csv file organized in two columns, with labels to the left and values to the right.
Posted by Valentin at 12:30 0 comments
Labels: python
2013-08-21
Коррупция
original post http://vasnake.blogspot.com/2013/08/blog-post_21.html
Posted by Valentin at 12:30 0 comments
2013-08-20
timezone
su -l rm /etc/localtime ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime
Posted by Valentin at 12:30 0 comments
2013-08-19
Спрятать от поиска
original post http://vasnake.blogspot.com/2013/08/blog-post_19.html
Posted by Valentin at 12:30 0 comments
Labels: hack, Zope(Plone)
2013-08-16
Хостинг для сайта на Plone
- Цена: 6 EUR = 8.56 USD = 270 RUB.
- Оплата: PayPal, вебмани, яндексденьги, карты.
- Датацентры: Эстония, партнер Hetzner Online.
- Виртуализация: OpenVZ.
- ОС: Debian 6, CentOS 6.4
- Ресурсы: 800 мб ОП, 1200 Мгц проц, 1 ядро, 8 Гб диск, 1500 Гб трафик суммарный, 10 Мбит/сек.
- Возможность попробовать перед оплатой: тестовый период не предоставляется.
Posted by Valentin at 12:30 0 comments
Labels: internet provider, Zope(Plone)
2013-08-15
coolest ArcGIS JavaScript app you can write in 100 lines or less
- Realtime
Collaborative Mapping by Phil
Leggetter
- Bees by Stan
McShinsky
- Image
Geotagging by Ognian
Samokovliyski
original post http://vasnake.blogspot.com/2013/08/coolest-arcgis-javascript-app-you-can.html
Posted by Valentin at 16:50 0 comments
2013-08-14
Просто боевик какой-то
Posted by Valentin at 12:30 0 comments
2013-08-13
Zope admin password
./install.sh --password=12345678 --build-python --static-lxml=yes standalone
find /usr/local/Plone -type f -name inituser /usr/local/Plone/zinstance/parts/instance/inituser rm /usr/local/Plone/zinstance/parts/instance/inituser find /usr/local/Plone -type f -name access
Posted by Valentin at 13:30 0 comments
Labels: Zope(Plone)
2013-08-12
для передачи содержимого DVD достаточно 1 секунды, а диска Blu-Ray (25GB) - 5 секунд
Posted by Valentin at 13:30 0 comments
Labels: internet provider, linux
2013-08-09
Нагрузочное тестирование
Posted by Valentin at 13:30 0 comments
Labels: web-develop
2013-08-08
Plone in production
su -l pushd /usr/local/Plone/zinstance nano buildout.cfg [buildout] … find-links += http://dist.plone.org/release/4.3.1 https://github.com/vasnake/customplone.app.locales/tarball/clubwindsurf/customplone.app.locales-4.3.2.dev1.tar.gz ... eggs = ... collective.quickupload collective.ptg.allnewest xhostplus.gallery customplone.app.locales … zcml = customplone.app.locales xhostplus.gallery … [instance] ... environment-vars = zope_i18n_compile_mo_files true … [versions] ... customplone.app.locales = 4.3.2.dev1 EOF sudo -u plone_buildout /usr/local/Plone/zinstance/bin/buildout -nv |
su -l mv /home/valik/cms.zexp /usr/local/Plone/zinstance/var/instance/import/ sudo -u plone_daemon /usr/local/Plone/zinstance/bin/instance fg
su -l pushd /tmp/Plone-4.3.1r1-UnifiedInstaller/init_scripts/RedHat-FedoraCore/ cp plone-standalone /etc/rc.d/init.d/plone chmod 755 /etc/rc.d/init.d/plone chkconfig --add plone |
/usr/local/Plone/zinstance/var/log/ instance.log instance-Z2.log
[client1] recipe = plone.recipe.zope2instance ... event-log-max-size = 5 MB event-log-old-files = 5 access-log-max-size = 20 MB access-log-old-files = 10 |
su -l pushd /usr/local/Plone/zinstance nano buildout.cfg ... [instance] <= instance_base recipe = plone.recipe.zope2instance http-address = 8080 environment-vars = zope_i18n_compile_mo_files true ... |
... [instance] <= instance_base recipe = plone.recipe.zope2instance http-address = 8080 environment-vars = zope_i18n_compile_mo_files true event-log-max-size = 5 MB event-log-old-files = 5 access-log-max-size = 30 MB access-log-old-files = 9 ... |
service plone stop sudo -u plone_buildout /usr/local/Plone/zinstance/bin/buildout service plone start
ab -kc 3 -t 30 http://deploy.nhome.net:8080/cms
nano /etc/yum.repos.d/nginx.repo [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/6/i386/ gpgcheck=0 enabled=1 EOF yum check-update yum install nginx |
nano /etc/logrotate.conf ... compress delaycompress nano /etc/logrotate.d/nginx /var/log/nginx/*.log { daily missingok rotate 10 compress delaycompress notifempty create 640 nginx adm sharedscripts postrotate [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid` endscript } |
nano /etc/nginx/conf.d/deploy.nhome.net.conf upstream plone { server 127.0.0.1:8080; } server { listen 80; server_name www.deploy.nhome.net; rewrite ^/(.*) http://deploy.nhome.net/$1 permanent; } server { listen 80; server_name deploy.nhome.net; access_log /var/log/nginx/deploy.nhome.net.access.log; error_log /var/log/nginx/deploy.nhome.net.error.log; location / { proxy_pass http://plone/VirtualHostBase/http/deploy.nhome.net:80/cms/VirtualHostRoot/; } } EOF /etc/init.d/nginx configtest service nginx restart netstat -tulnpv |
system-config-firewall-tui service iptables restart service network restart iptables -L iptables -L -vn nano /etc/sysconfig/iptables |
ssh -v valik@deploy -L 8080:localhost:8080
su -l openssl req -new -x509 -days 3650 -nodes -out /etc/ssl/certs/www.pem -keyout /etc/ssl/certs/www.key ls -la /etc/ssl/certs/ chmod 600 /etc/ssl/certs/www* cp /etc/nginx/conf.d/example_ssl.conf /etc/nginx/conf.d/deploy.nhome.net_ssl.conf nano /etc/nginx/conf.d/deploy.nhome.net_ssl.conf #upstream plone { # server 127.0.0.1:8080; #} server { listen 443; server_name deploy.nhome.net; keepalive_timeout 70; ssl on; ssl_certificate /etc/ssl/certs/www.pem; ssl_certificate_key /etc/ssl/certs/www.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; access_log /var/log/nginx/deploy.nhome.net_ssl.access.log; error_log /var/log/nginx/deploy.nhome.net_ssl.error.log; location / { proxy_pass http://plone/VirtualHostBase/https/deploy.nhome.net:443/cms/VirtualHostRoot/; } } |
nano /etc/nginx/nginx.conf user nginx; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; include /etc/nginx/conf.d/*.conf; } EOF service nginx restart |
su -l mkdir -p /var/cache/nginx/proxy chown nginx /var/cache/nginx/proxy chmod 700 /var/cache/nginx/proxy nano /etc/nginx/conf.d/deploy.nhome.net.conf # http { upstream plone { server 127.0.0.1:8080; } # proxy_cache_path path [ levels = levels ] keys_zone = name : size [ inactive = time ] [ max_size = size ] [ loader_files = number ] [ loader_sleep = time ] [ loader_threshold = time ] # Zone size should be set proportional to number of pages to cache. The size of the metadata for one page (file) depends on the OS; currently it is 64 bytes for FreeBSD/i386, and 128 bytes for FreeBSD/amd64 # 1m = 1024 * 1024 / 128 = 8192 pages proxy_cache_path /var/cache/nginx/proxy levels=1:2 keys_zone=thecache:1m max_size=300m inactive=10m; proxy_temp_path /var/cache/nginx/proxy_temp; # commenting this cause 'MISS' in cache log for Plone pages views proxy_ignore_headers Expires Cache-Control; # key for caching, default: proxy_cache_key $scheme$proxy_host$uri$is_args$args; proxy_cache_key $proxy_host$uri$is_args$args; # response will not be taken from a cache proxy_cache_bypass $cookie___ac; # response will not be saved to a cache - when users are logged in (detect by cookie) proxy_no_cache $cookie___ac; log_format cache '$remote_addr $time_local ' '$upstream_cache_status ' 'Cache-Control: $upstream_http_cache_control ' 'Expires: $upstream_http_expires ' '"$request" $status ' '"$http_user_agent" $scheme$proxy_host$uri$is_args$args'; # Redirect all www traffic to the www-less domain server { listen 80; server_name www.deploy.nhome.net; rewrite ^/(.*) http://deploy.nhome.net/$1 permanent; } server { listen 80; server_name deploy.nhome.net; access_log /var/log/nginx/deploy.nhome.net.access.log; # log for cache hits. access_log /var/log/nginx/deploy.nhome.net.cache.log cache; error_log /var/log/nginx/deploy.nhome.net.error.log; # proxy to Plone backend location / { # redirect PURGE requests from siteAdmin (root Zope access) rewrite ^/cms/(.*)$ /$1 break; # bcause of Plone VHM - turn off replacing text in Location and Refresh headers proxy_redirect off; # set extra headers for backend proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # maximum request Content-Length client_max_body_size 10m; # RAM buffer size for request body client_body_buffer_size 128k; # timeout for write to backend proxy_send_timeout 90; # buffer size for first part of backend response proxy_buffer_size 4k; # number and size of buffers for backend response, even pictures less that 128KB proxy_buffers 4 32k; # buffers size busy sending response to client - half of proxy_buffers proxy_busy_buffers_size 64k; # buffer size for writing tmp file while buffering backend response proxy_temp_file_write_size 64k; # timeout for establishing a connection with backend proxy_connect_timeout 30; # timeout between two succesive reads from backend proxy_read_timeout 60; # turn cache on by cache name proxy_cache thecache; # make Plone's 'purge cache' possible proxy_cache_purge PURGE from 127.0.0.1; # cache time for response 200, 301, and 302; 404; any proxy_cache_valid 10m; proxy_cache_valid 404 10m; proxy_cache_valid any 10m; # change $proxy_host to 'plone' in key, bcause purge module can't get that variable proxy_cache_key plone$uri$is_args$args; # protocol and address of a backend proxy_pass http://plone/VirtualHostBase/http/deploy.nhome.net:80/cms/VirtualHostRoot/; } } EOF service nginx restart tail -f /var/log/nginx/deploy.nhome.net.cache.log |
proxy_cache_purge PURGE from 127.0.0.1;
proxy_cache_key plone$uri$is_args$args;
# response will not be taken from a cache proxy_cache_bypass $cookie___ac; # response will not be saved to a cache - when users are logged in (detect by cookie) proxy_no_cache $cookie___ac; |
proxy_ignore_headers Expires Cache-Control;
su -l wget http://nginx.org/download/nginx-1.4.2.tar.gz wget http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz tar -xvf nginx-1.4.2.tar.gz tar -xvf ngx_cache_purge-2.1.tar.gz cd nginx-1.4.2 nginx -V configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --add-module=/root/ngx_cache_purge-2.1 error: the HTTP rewrite module requires the PCRE library. yum install -y httpd-devel pcre perl pcre-devel zlib zlib-devel GeoIP GeoIP-devel # повторить конфигур make service nginx stop make install service nginx restart |
proxy_cache_purge PURGE from 127.0.0.1;
sh valik@deploy -L 8080:localhost:8080
- pstree -a
- ps aux|less
- netstat -ntlp
- netstat -nulp
- netstat -nxlp
- free -m
- less /proc/meminfo
- vmstat
- uptime
- top
- iostat
- iostat -kx 2
- mpstat 2 10
- dstat --top-io –top-bio
- vgs
- pvs
- lvs
- df -h
- mount
- lsof
- ss -s
- dmesg
- less /var/log/messages
- less /var/log/secure
- less /var/log/auth
- tail -f /var/log/nginx/deploy.nhome.net.cache.log
- tail -f /var/log/nginx/*.log
- tail -f /usr/local/Plone/zinstance/var/log/instance.log
- tail -f /usr/local/Plone/zinstance/var/log/instance-Z2.log
Posted by Valentin at 13:30 0 comments
Labels: Zope(Plone)
Архив блога
-
▼
2013
(240)
-
▼
августа
(22)
- Защита SSH от брутфорса
- Виндсерфинг видео
- Plone undo_form
- Учебник виндсерфинга
- Видео
- Гомоветер
- Хрящик
- Коррупция
- timezone
- Спрятать от поиска
- Хостинг для сайта на Plone
- coolest ArcGIS JavaScript app you can write in 100...
- Просто боевик какой-то
- Zope admin password
- для передачи содержимого DVD достаточно 1 секунды,...
- Нагрузочное тестирование
- Plone in production
- ШГ
- LiveCD USB Flash drive 4 BIOS upgrade
- Nginx with MariaDB and PHP on CentOS 6
- Глиссирование, правильная стойка
- С чего начать разборки
-
▼
августа
(22)