Базовые стили и полезные CSS-сниппеты

6b42d35a44d89ccc7bfd12c089003c05В этой статье собраны полезные  и «правильные» стили и сниппеты, которые помогут ускорить процесс разработки сайта, а также оптимизировать верстку.

1. Базовая HTML5 конструкция

Основной код любой страницы, которому многие разработчики уделяют недостаточно внимания. Подключены jQuery 1.8.2 и HTML5shiv для корректного отображения в старых браузерах.

<!doctype html>
<html lang="en-US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Default Page Title</title>
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="icon" href="favicon.ico">
  <link rel="stylesheet" type="text/css" href="styles.css">
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<!--[if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>

<body>

</body>
</html>

2. Сброс стандартных стилей браузеров

Один и тот же код в разных браузерах может отображаться по-разному. Сброс стилей поможет избежать таких проблем.

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  outline: none;
}
html { height: 101%; } /* always display scrollbars */
body { font-size: 62.5%; line-height: 1; font-family: Arial, Tahoma, Verdana, sans-serif; }

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
ol, ul { list-style: none; }

blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
strong { font-weight: bold; } 

input { outline: none; }

table { border-collapse: collapse; border-spacing: 0; }
img { border: 0; max-width: 100%; }

a { text-decoration: none; }
a:hover { text-decoration: underline; }

3. CSS3 градиенты

Представленный ниже код поможет кроссбраузерно отображать CSS-градиенты. Добавляется в нужный селектор, можно использовать rgba() для прозрачности.

background-color: #000;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bbb', endColorstr='#000');
background-image: -webkit-gradient(linear, left top, left bottom, from(#bbb), to(#000));
background-image: -webkit-linear-gradient(top, #bbb, #000);
background-image: -moz-linear-gradient(top, #bbb, #000);
background-image: -ms-linear-gradient(top, #bbb, #000);
background-image: -o-linear-gradient(top, #bbb, #000);
background-image: linear-gradient(top, #bbb, #000);

4. CSS3 Transform

Не очень популярное свойство из-за проблем в старых браузерах. Однако достаточно перспективное. Можно делать всплывающие подсказки или фигуры.

-webkit-transform: perspective(250) rotateX(45deg);
-moz-transform: perspective(250) rotateX(45deg);
-ms-transform: perspective(250) rotateX(45deg);
-o-transform: perspective(250) rotateX(45deg);
transform: perspective(250) rotateX(45deg);

5. Свой @font-face

Позволяет добавить собственные шрифты на страницу. Для конвертации в различные форматы полезно использовать сервис Font2Web.

@font-face{ 
  font-family: 'MyFont';
  src: url('myfont.eot');
  src: url('myfont.eot?#iefix') format('embedded-opentype'),
    url('myfont.woff') format('woff'),
    url('myfont.ttf') format('truetype'),
    url('myfont.svg#webfont') format('svg');
}

h1 { font-family: 'MyFont', sans-serif; }

6.  Мета-теги адаптивной верстки

Важные мета-теги для корректной работы адаптивного макета

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">

7. HTML5-медиа Конструкция подгрузки нескольких форматов видео и аудио для универсальной работы медиа-контента (убрать пробел в «s ource»)

<video poster="images/preview.png" width="1280" height="720" controls="controls" preload="none"> 
  <s_ource src="media/video.mp4" type="video/mp4"></s_ource> 
  <s_ource src="media/video.webm" type="video/webm"></s_ource> 
  <s_ource src="media/video.ogg" type="video/ogg"></s_ource>
</video>
<audio controls="controls" preload="none">
  <s_ource src="music.ogg" type="audio/ogg"></s_ource>
  <s_ource src="music.mp3" type="audio/mpeg"></s_ource>
</audio>

8.  Классы для упрощения верстки

Следующие сниппеты помогут сократить синтаксис при верстке. Техника широко применяется в различных CSS-фреймворках. Например управление свойством float:

.float-left /* Or whatever name you like */ {
    float: left;
}

.float-right /* Or whatever name you like */ {
    float: right;
}

Или отображением элементов:

.hide {
    display: none;
}

.show {
    display: block;
}

9. Сниппеты дизайна

Позволяют упрощать отображать контент. Простой пример: объявление в CSS-файле стилей шрифтов в зависимости от места на сайте, где располагается контент. Эта, вроде бы простая техника, часто игнорируется разработчиками.

.content {
    font: 1em/1.4 Segoe, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.title {
    font: 1.7em/1.2 Baskerville, "Baskerville old face", "Hoefler Text", Garamond, "Times New Roman", serif;
}

.code {
    font: 0.8em/1.6 Monaco, Mono-Space, monospace;
}

10. Сниппеты разработки

Сниппеты, помогающие более грамотно организовать верстку сайта. Вот очень простой пример, который позволяет правильно считать ширину какого-нибудь блока:

*, *:before, *:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

Еще один полезный инструмент — это clearfix, помогающий избавиться от несоответствий отображения элементов верстки в разных браузерах:

.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}

.clearfix:after {
    clear: both;
}

/* IE6/7 support */
.clearfix {
    *zoom: 1;
}

Слишком длинные URL могут ломать верстку страницы. Чтобы избежать этого, можно применять следующий сниппет (подробнее на css-tricks.com), не работает в Opera и IE ниже восьмой версии:

.break {
    -ms-word-break: break-all;
    word-break: break-all;

    word-break: break-word;

    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    hyphens: auto;
}

.ellipsis {
    width: 250px;
    white-space: nowrap;
    overflow: hidden;
    -ms-text-overflow: ellipsis; /* Required for IE8 */
    -o-text-overflow: ellipsis; /* Required for Opera */
    text-overflow: ellipsis;
}

Переносы текста в теге pre:

pre {
    white-space: pre-wrap;       /* Chrome amp; Safari */
    white-space: -moz-pre-wrap;  /* Mozilla since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

11. Подготовка страницы для печати

Перевод контента в черно-белые цвета, отображение подчеркивания у ссылок, отображение URL рядом в скобках:

@media print {
    * {
        background: none !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;

        /* Images, vectors and such */
        filter: Gray();                          /* IE4-8: depreciated */
        filter: url('desaturate.svg#grayscale'); /* SVG version for IE10, Firefox, Safari 5 and Opera */
        -webkit-filter: grayscale(100%);         /* Chrome + Safari 6 */
        -moz-filter: grayscale(100%);            /* Future proof */
        -ms-filter: grayscale(100%);             /* Future proof */
        -o-filter: grayscale(100%);              /* Future proof */
        filter: grayscale(100%);                 /* Future proof or polyfilled */
    }

    a {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")"; 
    }

    a[href="#"],
    a[href="javascript:"] {
        content: "";
    }
}
<!-- SVG version of grayscale filter: desaturate.svg -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
    <filter id="grayscale">
        <feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0
            0.3333 0.3333 0.3333 0 0
            0.3333 0.3333 0.3333 0 0
            0  0  0  1 0"/>
    </filter>
</svg>

 

Использованные материалы:

Взято с Хабра

Nginx: setup SSL reverse proxy (load balanced SSL proxy)

776px-Nginx-battleship.svgA reverse proxy is a proxy server that is installed in a server network. Typically, reverse proxies are used in front of Web servers such as Apache, IIS, and Lighttpd. How do I setup nginx web server as SSL reverse proxy?

When you’ve multiple backend web servers, encryption / SSL acceleration can be done by a reverse proxy. Nginx can act as SSL acceleration software. It provided the following benefits:

  • Easy of use : Nginx is easy to setup and upgrade.
  • Security : Nginx provide an additional layer of defense as Apache is behind the proxy. It can protect against common web-based attacks too.
  • Load Distribution : nginx use very little memory and can distribute the load to several Apache servers. It can even rewrite urls on fly.
  • Caching : Nginx act as a reverse proxy which offload the Web servers by caching static content, such as images, css, js, static html pages and much more.
  • Compression : Nginx can optimize and compress the content to speed up the load time.

Our Sample Setup

Internet--
         |
    =============                          |---- apache1 (192.168.1.15)
    | ISP Router|                          |
    =============                          |---- apache2 (192.168.1.16)
         |                                 |
         |                                 |---- db1 (192.168.1.17)
         |      |eth0 -> 192.168.1.11 ----/
         |-lb0==|                        /
         |      |eth1 -> 202.54.1.1:443-/
         |
         |      |eth0 -> 192.168.1.10 -\
         |-lb1==|                       \
                |eth1 -> 202.54.1.1:443--\     
                                          |---- apache1 (192.168.1.15)
                                          |
                                          |---- apache2 (192.168.1.16)
                                          |
                                          |---- db1 (192.168.1.17)
  • lb0 — Linux box directly connected to the Internet via eth1. This is master SSL load balancer.
  • lb1 — Linux box directly connected to the Internet via eth1. This is backup SSL load balancer. This will become active if master networking failed.
  • 202.54.1.1 A virtual IP address that moves between lb0 and lb1. It is managed by keepalived.
  • nginx — It is installed on lb0 and lb1.
  • SSL Certificate — You need to install ssl certificates on lb0 and lb1.

For demonstration purpose I’m going to use Self-signed SSL certificate, but you can use real SSL certificate signed by CAs.

+------+        +-------------+        +-------------------+
|Client| <----> |SSL-Nginx:443| <----> |Apache-HTTP_mode:80|
+------+        +-------------+        +-------------------+
  • You’ve the SSL connection between client and Nginx.
  • Then Nginx act as proxy server and makes unencrypted connection to Apache at port 80.
  • Nginx can cache all static file and other files.

Generating Self-signed Certificate
First, create required directories:

# cd /usr/local/nginx/conf
# mkdir ssl
# cd ssl

To create a private key, enter:

# openssl genrsa -des3 -out nixcraft.in.key 1024

Sample outputs:

openssl-private-key

Fig.01: OpenSSL — Create a Private Key
To create a CSR (Certificate Signing Request):

# openssl req -new -key nixcraft.in.key -out nixcraft.in.csr

Sample outputs:
openssl-create-csr

Fig.02: OpenSSL — Create a CSR (Certificate Signing Request)
Please enter your domain name that you want to associate with the certificate. For example, for the Command Name I entered nixcraft.in as I’m going to use https://nixcraft.in/.

How Do I Remove The Passphrase? (Optional)

You can remove the passphrase so nginx can start on boot without entering the passphrase. Type the following commands

# cp nixcraft.in.key nixcraft.in.key.bak
# openssl rsa -in nixcraft.in.key.bak -out nixcraft.in.key

Finally, you should see three files as follows (note I’ve created all files as vivek user and than moved lb0 and lb1 server /usr/local/ngnix/conf/ssl/ directory):

# ls -l

Sample outputs:

remove-ssl-passphrase

Fig.03: All the files in ssl directory

# openssl x509 -req -days 365 -in nixcraft.in.csr -signkey nixcraft.in.key -out nixcraft.in.crt

Sample outputs:

openssl-create-crt-file

Fig.04: Generating The Actual Self-signed SSL Certificate

How Do I Copy SSL Certificates Files To lb1?

You need to copy those files to lb1, enter:

# ssh root@lb1 mkdir /usr/local/ngnix/conf/ssl
# rsync -av /usr/local/ngnix/conf/ssl/* root@lb1:/usr/local/ngnix/conf/ssl/

Configure Nginx As SSL Reverse Proxy (lb0 and lb1)

Edit nginx.conf, enter (you need to edit files on both lb0 and lb1):

# vi /usr/local/ngnix/conf/nginx.conf

Edit / append as follows:

server {
	### server port and name ###
        listen          202.54.1.1:443;
	ssl 		on;
        server_name     nixcraft.in;

	### SSL log files ###
        access_log      logs/ssl-access.log;
        error_log       logs/ssl-error.log;

	### SSL cert files ###
        ssl_certificate      ssl/nixcraft.in.crt;
        ssl_certificate_key  ssl/nixcraft.in.key;

	### Add SSL specific settings here ###

	ssl_protocols        SSLv3 TLSv1 TLSv1.1 TLSv1.2;
	ssl_ciphers RC4:HIGH:!aNULL:!MD5;
     	ssl_prefer_server_ciphers on;
     	keepalive_timeout    60;
	ssl_session_cache    shared:SSL:10m;
     	ssl_session_timeout  10m;

	### We want full access to SSL via backend ###
     	location / {
	        proxy_pass  http://nixcraft;

		### force timeouts if one of backend is died ##
        	proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

		### Set headers ####
                proxy_set_header        Accept-Encoding   "";
	        proxy_set_header        Host            $host;
	        proxy_set_header        X-Real-IP       $remote_addr;
	        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

		### Most PHP, Python, Rails, Java App can use this header ###
		#proxy_set_header X-Forwarded-Proto https;##
		#This is better##
	        proxy_set_header        X-Forwarded-Proto $scheme;
		add_header              Front-End-Https   on;

		### By default we don't want to redirect it ####
	        proxy_redirect     off;
      }

Save and close the file. Reload nginx:

# /usr/local/nginx/sbin/nginx -t
# /usr/local/nginx/sbin/nginx -s reload

Verify port is opened:

# netstat -tulpn | grep :443

How Do I Test And Debug SSL Certificates From The Shell Prompt?
Use the openssl command as follows:

$ openssl s_client -connect nixcraft.in:443

Or better use the following command:

$ openssl s_client -connect nixcraft.in:443 -CApath /usr/share/ssl-cert/ -servername nixcraft.in

How Do I Cache Common Files?
Edit nginx.conf and add as follows to cache common files:

location ~* \.(jpg|png|gif|jpeg|css|js|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
        proxy_buffering           on;
        proxy_cache_valid 200 120m;
        expires 864000;
}

Save and close the file. Reload nginx:

# nginx -s reload

Nginx redirect all HTTP request to HTTPS rewrite rules

776px-Nginx-battleship.svgI have setup nginx as a secure reverse proxy server. How do I redirect all http://example.com/ requests (traffic) to https://example.com/ under nginx web server?

The syntax is as follows. You need to add the following in location or server directives:

 

if ($host ~* ^(example\.com|www\.example\.com)$ ){
rewrite ^/(.*)$ https://example.com/$1 permanent;
}

OR better use the following rewrite:

rewrite ^ https://$server_name$request_uri? permanent;

Edit nginx.conf, enter:

# vi nginx.conf

You need to define both http and https server as follows:

 
## our http server at port 80
server {
      listen      1.2.3.4:80 default;
      server_name example.com www.example.com;
      ## redirect http to https ##
      rewrite        ^ https://$server_name$request_uri? permanent;
}

## Our https server at port 443. You need to provide ssl config here###
server {
      access_log  logs/example.com/ssl_access.log main;
      error_log   logs/example.com/ssl_error.log;
      index       index.html;
      root        /usr/local/nginx/html;
      ## start ssl config ##
      listen      1.2.3.4:443 ssl;
      server_name example.com www.example.com;

     ## redirect www to nowww
      if ($host = 'www.example.com' ) {
         rewrite  ^/(.*)$  https://example.com/$1  permanent;
      }

    ### ssl config - customize as per your setup ###
     ssl_certificate      ssl/example.com/example.com_combined.crt;
     ssl_certificate_key  ssl/example.com/example.com.key_without_password;
     ssl_protocols        SSLv3 TLSv1 TLSv1.1 TLSv1.2;
     ssl_ciphers RC4:HIGH:!aNULL:!MD5;
     ssl_prefer_server_ciphers on;
     keepalive_timeout    70;
     ssl_session_cache    shared:SSL:10m;
     ssl_session_timeout  10m;

    ## PROXY backend
      location / {
        add_header           Front-End-Https    on;
        add_header  Cache-Control "public, must-revalidate";
        add_header Strict-Transport-Security "max-age=2592000; includeSubdomains";
        proxy_pass  http://exampleproxy;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      }
}

Save and close the file. Reload or restart the nginx:

# nginx -s reload

Test it:

$ curl -I http://example.com
$ curl -I http://example.com/foo/bar/file.html

Sample outputs:

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Sat, 01 Dec 2012 23:49:52 GMT
Content-Type: text/html
Content-Length: 178
Connection: keep-alive
Location: https://example.com/

Linux nginx: chroot (jail) setup

776px-Nginx-battleship.svgHow do I run Nginx web server in a chroot (jail) so that I can minimizes the damage done by a potential break-in by isolating the web server to a small section of the filesystem?

You can use traditional chroot kind of setup with nginx. Our sample setup:

  • Jail Directory : /nginx (D=/nginx)
  • Tested On : 64 Bit Linux Sytems (RHEL / CentOS / Fedora etc)
  • Nginx role : SSL and HTTP reverse proxy
  • Nginx 64 bit Libraries Path : /lib64 and /usr/lib64 (for 32 bit system use /lib and /usr/lib)

Step #1: Setup Chroot Directory

First, you need to define a chroot directory. Type the following commands:

# D=/nginx
# mkdir -p $D

Step #2: Create Isolated Environment

Type the following commands:

# mkdir -p $D/etc
# mkdir -p $D/dev
# mkdir -p $D/var
# mkdir -p $D/usr
# mkdir -p $D/usr/local/nginx
# mkdir -p $D/tmp
# chmod 1777 $D/tmp
# mkdir -p $D/var/tmp
# chmod 1777 $D/var/tmp
# mkdir -p $D/lib64

Step #3: Create Required Devices in $D/dev

You need to create the following three device entries so that nginx works without problem inside jail:

# ls -l /dev/{null,random,urandom}

Sample outputs:

crw-rw-rw- 1 root root 1, 3 Apr  5 11:03 /dev/null
crw-rw-rw- 1 root root 1, 8 Apr  5 11:03 /dev/random
cr--r--r-- 1 root root 1, 9 Apr  5 11:03 /dev/urandom

You need to use the mknod command to make block or character special files, enter:

# /bin/mknod -m 0666 $D/dev/null c 1 3
# /bin/mknod -m 0666 $D/dev/random c 1 8
# /bin/mknod -m 0444 $D/dev/urandom c 1 9

Step #4: Copy All Nginx Files In Directory

You need to copy /usr/local/nginx/ to $D/usr/local/nginx, enter:

# /bin/cp -farv /usr/local/nginx/* $D/usr/local/nginx

Step #5: Copy Required Libs To Jail

$D/usr/local/nginx/sbin/nginx depends upon various libraries, you need to copy them to $D/lib64 and $D/usr/lib64. To display shared library dependencies, enter:

# ldd /usr/local/nginx/sbin/nginx

Sample outputs:

	libpcre.so.0 => /lib64/libpcre.so.0 (0x000000316b800000)
	libssl.so.6 => /lib64/libssl.so.6 (0x0000003170400000)
	libcrypto.so.6 => /lib64/libcrypto.so.6 (0x000000316d400000)
	libdl.so.2 => /lib64/libdl.so.2 (0x000000316b000000)
	libz.so.1 => /usr/lib64/libz.so.1 (0x000000316c400000)
	libc.so.6 => /lib64/libc.so.6 (0x000000316ac00000)
	libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x000000316e400000)
	libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x0000003170000000)
	libcom_err.so.2 => /lib64/libcom_err.so.2 (0x000000316ec00000)
	libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x000000316f800000)
	/lib64/ld-linux-x86-64.so.2 (0x000000316a800000)
	libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x000000316fc00000)
	libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x000000316f000000)
	libresolv.so.2 => /lib64/libresolv.so.2 (0x000000316d800000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x000000316c000000)
	libsepol.so.1 => /lib64/libsepol.so.1 (0x000000316bc00000)

You need to copy all of the above files to $D using the cp command as follows:

# cp /lib64/libsepol.so.1 $D/lib64

To automate this procedure use our script called n2chroot:

# cd /tmp
# wget http://bash.cyberciti.biz/dl/527.sh.zip
# unzip 527.sh.zip
# mv 527.sh /usr/bin/n2chroot
# chmod +x /usr/bin/n2chroot

Edit script and set BASE directory:

# vi /usr/bin/n2chroot

Finally, run it as follows:

# n2chroot /usr/local/nginx/sbin/nginx
# /bin/cp -fv /lib64/* $D/lib64

Step #6: Copy /etc To Jail

Finally, copy /etc to $D, enter:

# cp -fv /etc/{group,prelink.cache,services,adjtime,shells,gshadow,shadow,hosts.deny,localtime,nsswitch.conf,nscd.conf,prelink.conf,protocols,hosts,passwd,ld.so.cache,ld.so.conf,resolv.conf,host.conf} $D/etc

And a few directories too:

# cp -avr /etc/{ld.so.conf.d,prelink.conf.d} $D/etc

How Do I Start Chrooted nginx?

First, kill existing nginx (if running):

# killall -9 nginx

To start chrooted nginx, type:

# /usr/sbin/chroot /nginx /usr/local/nginx/sbin/nginx -t
# /usr/sbin/chroot /nginx /usr/local/nginx/sbin/nginx

Make sure nginx starts when system reboots:

# echo '/usr/sbin/chroot /nginx /usr/local/nginx/sbin/nginx' >> /etc/rc.local

How Do I Reload Chrooted nginx?

Type the following command

# /usr/sbin/chroot /nginx /usr/local/nginx/sbin/nginx -s reload

How Do I Edit Chrooted nginx Configuration File?

Type the following commands:

# cd /nginx/usr/local/nginx/conf/
# vi nginx.conf

Save and close the file. Test and reload the same:

# /usr/sbin/chroot /nginx /usr/local/nginx/sbin/nginx -t
# /usr/sbin/chroot /nginx /usr/local/nginx/sbin/nginx -s reload

Gracefully restart Nginx after changes made in a config file

776px-Nginx-battleship.svgI know how to gracefully restart Apache web server under Unix like operating system. I made changes to nginx.conf. How do I gracefully restart Nginx web server? How do I make changes in a Nginx server config file to take effect without restarting the Nginx server itself without interrupting users’ current session?

From the nginx wiki pages

The master process can handle the following signals: TERM, INT Quick shutdown

  • QUIT Graceful shutdown
  • KILL Halts a stubborn process
  • HUP Configuration reload. Start the new worker processes with a new configuration. Gracefully shutdown the old worker processes
  • USR1 Reopen the log files
  • USR2 Upgrade Executable on the fly
  • WINCH Gracefully shutdown the worker processes

The syntax is as follows to

  kill -HUP $( cat /path/to/nginx.pid )

OR find nginx pid with the pgrep command or ps command:

pgrep nginx
ps aux | grep [n]ginx

Sample outputs:

root      4333  0.0  0.4  70776  9352 ?        Ss   Nov24   0:00 nginx: master process /usr/local/nginx/sbin/nginx
nginx     9921  1.0  0.5  70776  9888 ?        S    Dec05  19:24 nginx: worker process
nginx     9922  1.0  0.5  70776 10240 ?        S    Dec05  19:42 nginx: worker process
nginx     9923  0.0  0.4  70776  8724 ?        S    Dec05   0:00 nginx: cache manager process

Type the following command as root user:

kill -HUP 4333

If you are using Nginx version 0.7.53+
Pass the -s reload option:

# nginx -s reload

OR

# /usr/local/nginx/sbin -s reload

If you are using Debian / CentOS / RHEL / Fedora / Ubuntu Linux try

# /etc/init.d/nginx reload

If you are using FreeBSD try

# /usr/local/etc/rc.d/nginx reload

If you are using OpenBSD try

# /usr/sbin/nginx -s reload

OR

# /etc/rc.d/nginx reload

How do I reload / gracefully restart chrooted nginx server?
Type the following command:

/usr/sbin/chroot /jail /usr/local/nginx/sbin/nginx -s reload

Test Internet Connection Speed From Console Over SSH Command Line

aptestI have recently rented a dedicated server for my hobby projects and learning CentOS Linux server. I was informed that I am connected to the 100M/s port. How do I test my Internet connection download speed from the console over the ssh session without using HTML5 or Adobe flash/Java applets based websites? How do I test my upload speed from the console?

I recommend that you use lftp command to test Internet upload and download speed from console. You can run lftp using the ssh client:

[a] wget — Retrieves files from the web (download speed test).

[b] wput — A tiny wget-like ftp-client for uploading files (upload speed test).

[c] axel — Another light download accelerator.

[d] iperf — Perform network throughput tests.

Installation

You can use the following yum command to install lftp and iperf under RHEL / CentOS / Fedora Linux:

# yum install lftp iperf

OR use the following apt-get command under Debian or Ubuntu Linux:

$ sudo apt-get install lftp iperf

Step #1: Find out download url

You need a large size file to test download speed. For example, you can visit the home page of«Argonne National Laboratory Public Software Mirror» to grab Centos Linux ISO file.

Step #2: Use lftp command to test download speed

The syntax is:

lftp -e 'pget http://example.com/file.iso; exit; '
lftp -e 'pget http://speedtest.example.com/500M.bin; exit; '
lftp -e 'pget http://mirror.anl.gov/pub/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-LiveCD.iso; exit; '

Sample outputs:

Fig.01: lftp testing internet speed
You will also get the report as follows:

725617504 bytes transferred in 65 seconds (10.63M/s)

A note about wget command

You can use the wget command as follows for testing download speed:

$ wget -O /dev/null http://mirror.anl.gov/pub/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-LiveCD.iso

Sample outputs:

Fig.02: wget command in action

Step #3: Use lftp command to test upload speed
The sytnax is as follows:

lftp -u userName ftp.example.com -e 'put largecd1.avi; bye'
lftp -u userName,passWord ftp.example.com -e 'put largecd1.avi; bye'
lftp -u userName,passWord ftp.example.com -e 'put /path/to/large.iso; bye'

In this example, I am uploading a file to my private ftp server:

lftp -u admin homeserver -e 'cd video; put /home/vivek/Downloads/debian-testing-amd64-CD-1.iso; bye'

OR

lftp -u admin homeserver.public.ip.here -e 'cd video; put /home/vivek/Downloads/debian-testing-amd64-CD-1.iso; bye'

Sample outputs:

Fig.03: lftp upload speed test in action

How do I test network throughput rate between two Linux or Unix servers?
Consider the following setup:

+------------------+                            +----------------+
| Linux server A    +------- ISP Internet-------+ Linux server B +
+------------------+                            +----------------+
IP:202.54.1.1                                     IP:203.54.1.1
iperf server                                      iperf client

Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss. On server A start iperf as follows:

# iperf -s -B 202.54.1.1

On server B type the same command as follows:

# iperf -c 202.54.1.1 -d -t 60 -i 10

Sample outputs:

Fig.04: iperf client in action
Where,

  1. -s : Run in server mode.
  2. -B IP : Bind to IP, an interface or multicast address.
  3. -c IP : Run in client mode, connecting to IP.
  4. -d : Do a bidirectional test simultaneously.
  5. -t 60 : Time in seconds to transmit for (default 10).
  6. -i 10 : Pause n seconds between periodic bandwidth reports.

RECOMMENDED READINGS
See the following man pages for information:

man lftp
man wget
man iperf

Synology NAS: Run Fsck To Check and Repair a Linux File System

DS509+I own a Linux powered Synology dedicated Network Attached Storage (NAS) server for my home office use. How do I run fsck on Synology DiskStation that offers RAID storage using Linux command line options over an ssh session?

This server is powered by Linux operating system and comes with the e2fsck program that can be used to check the ext3/ext4 family of file systems.

Difficulty: Intermediate
Root privileges: Yes
Requirements: Synology server

First, you need to login using ssh interface. The syntax is as follows:

ssh root@nas01
ssh root@nas-server-ip-here

Once logged in you need to stop running services such as smb/nfs/pgsql and so. To see current volumes or mount point type the following command:

df

Sample outputs:

Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                 2451064    437412   1911252  19% /
/dev/root              2451064    437412   1911252  19% /
/tmp                    255700       272    255428   1% /tmp
/dev/vg1/volume_1    2879621632 176443652 2703075580   7% /volume1
/dev/vg1/volume_1    2879621632 176443652 2703075580   7% /opt

To see current services accessing the /volume1/ and /opt/, run:

lsof /opt/
lsof /volume1/

Sample outputs:

COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
postgres 5052 admin  cwd    DIR  253,0     4096      18 /volume1/@database/pgsql
postgres 5057 admin  cwd    DIR  253,0     4096      18 /volume1/@database/pgsql
postgres 5057 admin   17u   REG  253,0 16777216 3539006 /volume1/@database/pgsql/pg_xlog/000000010000000000000006
postgres 5058 admin  cwd    DIR  253,0     4096      18 /volume1/@database/pgsql
lsof     8284  root  txt    REG  253,0   125544 4068473 /opt/sbin/lsof
lsof     8285  root  txt    REG  253,0   125544 4068473 /opt/sbin/lsof

You need to stop pgsql service, enter:

/usr/syno/etc/rc.d/S20pgsql.sh stop

Sample outputs:

Stopping PostgreSQL...

In short, you need to stop services that are running and accessing data shares such as SMB,NFS,pgsql,mysql and so on. You can use web interface to stop these services too. cd to /usr/syno/etc/rc.d/ and stop all file sharing services. Finally, unmount volumes as follows:

umount /volume1/
umount /opt

Verify that /opt and /volume1/ are unmounted:

df

Sample outputs:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/md0               2451064    437408   1911256  19% /
/tmp                    255700       264    255436   0% /tmp

Run fsck on ext4 file system:

fsck.ext4 -v /dev/vg1/volume_1

OR

e2fsck -p -y -f -v /dev/vg1/volume_1

Sample outputs:

e2fsck 1.41.12 (17-May-2010)
1.41.12-2198: is cleanly umounted, 474816/182845440 files, 55587266/731381760 blocks
 (check after next mount)

Reboot the server:

reboot

HTML codes — characters and symbols

w3c

Standard ASCII set, HTML Entity names, ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1
Browser support: All browsers
ASCII HTML HTML
Dec Hex Symbol Number Name Description

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
20
21
22
23
24
25
26
27
28
29
2A
2B
2C
2D
2E
2F
!
»
#
$
%
&

(
)
*
+
,

.
/
&#32;
&#33;
&#34;
&#35;
&#36;
&#37;
&#38;
&#39;
&#40;
&#41;
&#42;
&#43;
&#44;
&#45;
&#46;
&#47;
&quot;&amp; space
exclamation point
double quotes
number sign
dollar sign
percent sign
ampersand
single quote
opening parenthesis
closing parenthesis
asterisk
plus sign
comma
minus sign — hyphen
period
slash
ASCII HTML HTML
Dec Hex Symbol Number Name Description

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
30
31
32
33
34
35
36
37
38
39
3A
3B
3C
3D
3E
3F
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
&#48;
&#49;
&#50;
&#51;
&#52;
&#53;
&#54;
&#55;
&#56;
&#57;
&#58;
&#59;
&#60;
&#61;
&#62;
&#63;
&lt;&gt; zero
one
two
three
four
five
six
seven
eight
nine
colon
semicolon
less than sign
equal sign
greater than sign
question mark
ASCII HTML HTML
Dec Hex Symbol Number Name Description

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
40
41
42
43
44
45
46
47
48
49
4A
4B
4C
4D
4E
4F
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
&#64;
&#65;
&#66;
&#67;
&#68;
&#69;
&#70;
&#71;
&#72;
&#73;
&#74;
&#75;
&#76;
&#77;
&#78;
&#79;
at symbol
ASCII HTML HTML
Dec Hex Symbol Number Name Description

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
50
51
52
53
54
55
56
57
58
59
5A
5B
5C
5D
5E
5F
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
&#80;
&#81;
&#82;
&#83;
&#84;
&#85;
&#86;
&#87;
&#88;
&#89;
&#90;
&#91;
&#92;
&#93;
&#94;
&#95;
opening bracket
backslash
closing bracket
caret — circumflex
underscore
ASCII HTML HTML
Dec Hex Symbol Number Name Description

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
60
61
62
63
64
65
66
67
68
69
6A
6B
6C
6D
6E
6F
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
&#96;
&#97;
&#98;
&#99;
&#100;
&#101;
&#102;
&#103;
&#104;
&#105;
&#106;
&#107;
&#108;
&#109;
&#110;
&#111;
grave accent
ASCII HTML HTML
Dec Hex Symbol Number Name Description

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
70
71
72
73
74
75
76
77
78
79
7A
7B
7C
7D
7E
7F
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
&#112;
&#113;
&#114;
&#115;
&#116;
&#117;
&#118;
&#119;
&#120;
&#121;
&#122;
&#123;
&#124;
&#125;
&#126;
opening brace
vertical bar
closing brace
equivalency sign — tilde
(not defined in HTML 4 standard)
ASCII HTML HTML
Dec Hex Symbol Number Name Description

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
80
81
82
83
84
85
86
87
88
89
8A
8B
8C
8D
8E
8F
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
ASCII HTML HTML
Dec Hex Symbol Number Name Description

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
90
91
92
93
94
95
96
97
98
99
9A
9B
9C
9D
9E
9F
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
(not defined in HTML 4 standard)
ASCII HTML HTML
Dec Hex Symbol Number Name Description

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
AA
AB
AC
AD
AE
AF
¡
¢
£
¤
¥
¦
§
¨
©
ª
«
¨
¯
&#160;
&#161;
&#162;
&#163;
&#164;
&#165;
&#166;
&#167;
&#168;
&#169;
&#170;
&#171;
&#172;
&#173;
&#174;
&#175;
&nbsp;
&iexcl;
&cent;
&pound;
&curren;
&yen;
&brvbar;
&sect;
&uml;
&copy;
&ordf;
&laquo;
&not;
&shy;
&reg;
&macr;
non-breaking space
inverted exclamation mark
cent sign
pound sign
currency sign
yen sign
broken vertical bar
section sign
spacing diaeresis — umlaut
copyright sign
feminine ordinal indicator
left double angle quotes
not sign
soft hyphen
registered trade mark sign
spacing macron — overline
ASCII HTML HTML
Dec Hex Symbol Number Name Description

176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
B0
B1
B2
B3
B4
B5
B6
B7
B8
B9
BA
BB
BC
BD
BE
BF
°
±
²
³
´
µ

·
¸
¹
º
»
¼
½
¾
¿
&#176;
&#177;
&#178;
&#179;
&#180;
&#181;
&#182;
&#183;
&#184;
&#185;
&#186;
&#187;
&#188;
&#189;
&#190;
&#191;
&deg;
&plusmn;
&sup2;
&sup3;
&acute;
&micro;
&para;
&middot;
&cedil;
&sup1;
&ordm;
&raquo;
&frac14;
&frac12;
&frac34;
&iquest;
degree sign
plus-or-minus sign
superscript two — squared
superscript three — cubed
acute accent — spacing acute
micro sign
pilcrow sign — paragraph sign
middle dot — Georgian comma
spacing cedilla
superscript one
masculine ordinal indicator
right double angle quotes
fraction one quarter
fraction one half
fraction three quarters
inverted question mark
ASCII HTML HTML
Dec Hex Symbol Number Name Description

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
À
Á
Â
Ã
Ä
Å
Æ
Ç
È
É
Ê
Ë
Ì
Í
Î
Ï
&#192;
&#193;
&#194;
&#195;
&#196;
&#197;
&#198;
&#199;
&#200;
&#201;
&#202;
&#203;
&#204;
&#205;
&#206;
&#207;
&Agrave;
&Aacute;
&Acirc;
&Atilde;
&Auml;
&Aring;
&AElig;
&Ccedil;
&Egrave;
&Eacute;
&Ecirc;
&Euml;
&Igrave;
&Iacute;
&Icirc;
&Iuml;
latin capital letter A with grave
latin capital letter A with acute
latin capital letter A with circumflex
latin capital letter A with tilde
latin capital letter A with diaeresis
latin capital letter A with ring above
latin capital letter AE
latin capital letter C with cedilla
latin capital letter E with grave
latin capital letter E with acute
latin capital letter E with circumflex
latin capital letter E with diaeresis
latin capital letter I with grave
latin capital letter I with acute
latin capital letter I with circumflex
latin capital letter I with diaeresis
ASCII HTML HTML
Dec Hex Symbol Number Name Description

208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DA
DB
DC
DD
DE
DF
Ð
Ñ
Ò
Ó
Ô
Õ
Ö
×
Ø
Ù
Ú
Û
Ü
Ý
Þ
ß
&#208;
&#209;
&#210;
&#211;
&#212;
&#213;
&#214;
&#215;
&#216;
&#217;
&#218;
&#219;
&#220;
&#221;
&#222;
&#223;
&ETH;
&Ntilde;
&Ograve;
&Oacute;
&Ocirc;
&Otilde;
&Ouml;
&times;
&Oslash;
&Ugrave;
&Uacute;
&Ucirc;
&Uuml;
&Yacute;
&THORN;
&szlig;
latin capital letter ETH
latin capital letter N with tilde
latin capital letter O with grave
latin capital letter O with acute
latin capital letter O with circumflex
latin capital letter O with tilde
latin capital letter O with diaeresis
multiplication sign
latin capital letter O with slash
latin capital letter U with grave
latin capital letter U with acute
latin capital letter U with circumflex
latin capital letter U with diaeresis
latin capital letter Y with acute
latin capital letter THORN
latin small letter sharp s — ess-zed
ASCII HTML HTML
Dec Hex Symbol Number Name Description

224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
E0
E1
E2
E3
E4
E5
E6
E7
E8
E9
EA
EB
EC
ED
EE
EF
à
á
â
ã
ä
å
æ
ç
è
é
ê
ë
ì
í
î
ï
&#224;
&#225;
&#226;
&#227;
&#228;
&#229;
&#230;
&#231;
&#232;
&#233;
&#234;
&#235;
&#236;
&#237;
&#238;
&#239;
&agrave;
&aacute;
&acirc;
&atilde;
&auml;
&aring;
&aelig;
&ccedil;
&egrave;
&eacute;
&ecirc;
&euml;
&igrave;
&iacute;
&icirc;
&iuml;
latin small letter a with grave
latin small letter a with acute
latin small letter a with circumflex
latin small letter a with tilde
latin small letter a with diaeresis
latin small letter a with ring above
latin small letter ae
latin small letter c with cedilla
latin small letter e with grave
latin small letter e with acute
latin small letter e with circumflex
latin small letter e with diaeresis
latin small letter i with grave
latin small letter i with acute
latin small letter i with circumflex
latin small letter i with diaeresis
ASCII HTML HTML
Dec Hex Symbol Number Name Description

240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
F0
F1
F2
F3
F4
F5
F6
F7
F8
F9
FA
FB
FC
FD
FE
FF
ð
ñ
ò
ó
ô
õ
ö
÷
ø
ù
ú
û
ü
ý
þ
ÿ
&#240;
&#241;
&#242;
&#243;
&#244;
&#245;
&#246;
&#247;
&#248;
&#249;
&#250;
&#251;
&#252;
&#253;
&#254;
&#255;
&eth;
&ntilde;
&ograve;
&oacute;
&ocirc;
&otilde;
&ouml;
&divide;
&oslash;
&ugrave;
&uacute;
&ucirc;
&uuml;
&yacute;
&thorn;
&yuml;
latin small letter eth
latin small letter n with tilde
latin small letter o with grave
latin small letter o with acute
latin small letter o with circumflex
latin small letter o with tilde
latin small letter o with diaeresis
division sign
latin small letter o with slash
latin small letter u with grave
latin small letter u with acute
latin small letter u with circumflex
latin small letter u with diaeresis
latin small letter y with acute
latin small letter thorn
latin small letter y with diaeresis
HTML 4.01, ISO 10646, ISO 8879, Latin extended A and B,
Browser support: Internet Explorer > 4, Netscape > 4
  HTML HTML
Dec Hex Symbol Number Name Description

338
339
352
353
376
402
152
153
160
161
178
192
Œ
œ
Š
š
Ÿ
ƒ
&#338;
&#339;
&#352;
&#353;
&#376;
&#402;
latin capital letter OE
latin small letter oe
latin capital letter S with caron
latin small letter s with caron
latin capital letter Y with diaeresis
latin small f with hook — function
  HTML HTML
Dec Hex Symbol Number Name Description

8211
8212
8216
8217
8218
8220
8221
8222
8224
8225
8226
8230
8240
8364
8482
2013
2014
2018
2019
201A
201C
201D
201E
2020
2021
2022
2026
2030
20AC
2122














&#8211;
&#8212;
&#8216;
&#8217;
&#8218;
&#8220;
&#8221;
&#8222;
&#8224;
&#8225;
&#8226;
&#8230;
&#8240;
&#8364;
&#8482;
&euro; en dash
em dash
left single quotation mark
right single quotation mark
single low-9 quotation mark
left double quotation mark
right double quotation mark
double low-9 quotation mark
dagger
double dagger
bullet
horizontal ellipsis
per thousand sign
euro sign
trade mark sign

Barracuda Green ST2000DL003

Seagate_Barracuda_GreenDrive specification
Formatted capacity (4096 bytes/sector)*: 2000GB
Guaranteed sectors: 3,907,029,168
Heads: 6
Disks: 3
Bytes per sector: 4096
Default sectors per track: 63
Default read/write heads: 16
Default cylinders: 16,383
Recording density (max): 1632kb/in
Track density (avg): 274 ktracks/in
Areal density (avg): 422Gb/in2
Spindle speed: 5900 RPM
Internal data transfer rate (max): 1928Mb/s
Sustained data transfer rate OD: 144MB/s
I/O data-transfer rate: 600MB/s
ATA data-transfer modes supported: PIO modes: 0 to 4, Multiword DMA modes: 0 to 2, Ultra DMA modes: 0 to 6
Cache buffer: 64MB
Height (max): 26.1mm / 1.028 in
Width (max): 101.85mm / 4.0 in (± 0.010 in)
Length (max): 147.00mm / 5.78 in
Weight (typical): 635g / 1.39 lb
Average latency: 4.16ms
Power-on to ready (max): <17s
Standby to ready (max): <17s
Track-to-track seek time (typical): <1.0ms read; <1.2ms write
Average seek (typical): <12ms read; <13ms write
Startup current (typical): 12V (peak) 2.1A
Voltage tolerance (including noise): 5V ±5% 12V ±10%
Ambient temperature: 0° to 60°C (operating), –40° to 70°C (nonoperating)
Temperature gradient (max): 20°C per hour (operating), 30°C per hour (nonoperating)
Relative humidity: 5% to 90% (operating), 5% to 95% (nonoperating)
Relative humidity gradient (max) 30% per hour 30% per hour
Wet bulb temperature (max): 37.7°C (operating), 40.0°C (nonoperating)
Altitude, operating: –304.8m to 3,048m (–1000 ft. to 10,000+ ft.)
Altitude, nonoperating (below mean sea level, max): –304.8m to 12,192m (–1000 ft. to 40,000+ ft.)
Operational Shock (max): 80 Gs at 2ms
Non-Operational Shock (max): 300 Gs at 2ms
Vibration, operating: 5Hz–22Hz: 0.25 Gs,
Limited displacement
22Hz–350Hz: 0.50 Gs
350Hz–500Hz: 0.25 Gs
Vibration, nonoperating 5Hz–22Hz: 3.0 Gs
22Hz–350Hz: 3.0 Gs
350Hz–500Hz: 3.0 Gs
Drive acoustics, sound power:
Idle**: 2.1 bels (typical), 2.3 bels (max)
Seek: 2.4 bels (typical), 2.5 bels (max)
Nonrecoverable read errors: 1 per 10^14 bits read
Annualized Failure Rate (AFR) 0.34% 0.34%
Load/Unload cycles: 300K at 25°C, 50% rel. humidity
Supports Hotplug operation per the Serial ATA Revision 3.0 specification: Yes

Viewsonic VP2650WB

77322_2254_draft_large«Основные характеристики»
Производитель ViewSonic
Модель VP2650WB |найти похожий монитор
Цвета, использованные в оформлении Черный
Диагональ 25.5″ (64.8 см)

«Матрица»
Тип LCD-матрицы TN
Подсветка LCD-матрицы Традиционная (CCFL)
Яркость матрицы 400 кд/м2 — типичная
Контрастность LCD-матрицы 1000:1 — типичная; 4000:1 — динамическая
Профили коррекции изображения Режим динамической контрастности
Поверхность экрана Матовая
Время отклика 3 мс GtG
Формат матрицы 16:10
Разрешение экрана 1920 x 1200
Угол обзора LCD-матрицы 160° по горизонтали, 160° по вертикали при CR>10

«Интерфейс, разъемы и выходы»
Интерфейс монитора DVI, VGA (15-пиновый коннектор D-sub) |Купить кабель
Поддержка HDCP Есть
USB-концентратор монитора 4 порта USB 2.0
Управление Механические кнопки

«Корпус и подставка»
Регулировка положения экрана Pivot/Высота/Поворот влево-вправо (swivel)
Поворот экрана на 90° Возможен поворот экрана на 90° (из landscape в portrait или наоборот)
Изменение высоты экрана 120 мм
Углы поворота относительно подставки ±60°
Блок питания монитора или телевизора Встроенный
Крепление монитора к стене VESA 100 x 100 мм; подставка снимается, кронштейн для крепления приобретается отдельно |крепеж к стене

«Комплект поставки и опции»
Комплект поставки Кабель питания, кабель VGA, кабель DVI, кабель USB, CD-диск |комплект №1

«Прочие характеристики»
TCO TCO’03
Потребление энергии 120 Вт — максимальное, 110 Вт — типичное
Размеры (ширина x высота x глубина) 595 x 468 x 388 мм
Вес 11.5 кг
Рабочая температура 0 ~ 40°C

«Логистика»
Размеры упаковки 68 x 55.5 x 48.5 см
Вес брутто 16.05 кг

«Внешние источники информации»
Горячая линия производителя 8-800-700-9979