<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://gluek.info/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel>
        <title>GluekWiki linux</title>
        <description></description>
        <link>https://gluek.info/wiki/</link>
        <lastBuildDate>Fri, 01 May 2026 18:52:55 +0300</lastBuildDate>
        <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
        <image>
            <url>https://gluek.info/wiki/lib/images/favicon.ico</url>
            <title>GluekWiki</title>
            <link>https://gluek.info/wiki/</link>
        </image>
        <item>
            <title>apcupsd - APC UPS Power Management (daemon)</title>
            <link>https://gluek.info/wiki/linux/apcupsd</link>
            <description>


&lt;h1&gt;&lt;a name=&quot;apcupsd-apc-ups-power-management-daemon&quot; id=&quot;apcupsd-apc-ups-power-management-daemon&quot;&gt;apcupsd - APC UPS Power Management (daemon)&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;apcupsd - APC UPS Power Management (daemon)&quot; [1-59] --&gt;
&lt;h2&gt;&lt;a name=&quot;opisanie&quot; id=&quot;opisanie&quot;&gt;Описание&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class='box round left' style='width: 90%;'&gt;
  &lt;b class='xtop'&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;/b&gt;
  &lt;div class='xbox'&gt;
&lt;p class='box_title'&gt;&lt;a href=&quot;http://www.apcupsd.com/&quot; class=&quot;urlextern&quot; title=&quot;http://www.apcupsd.com/&quot;&gt;Apcupsd, a daemon for controlling APC UPSes&lt;/a&gt;&lt;/p&gt;
&lt;div class='box_content'&gt;&lt;p&gt;
Apcupsd can be used for power mangement and controlling most of APC&amp;#039;s UPS models on Unix and Windows machines. Apcupsd works with most of APC&amp;#039;s Smart-UPS models as well as most simple signalling models such a Back-UPS, and BackUPS-Office. During a power failure, apcupsd will inform the users about the power failure and that a shutdown may occur. If power is not restored, a system shutdown will follow when the battery is exhausted, a timeout (seconds) expires, or runtime expires based on internal APC calculations determined by power consumption rates. Apcupsd is licensed under the &lt;acronym title=&quot;GNU General Public License&quot;&gt;GPL&lt;/acronym&gt; version 2.
&lt;/div&gt;
  &lt;/div&gt;
  &lt;b class='xbottom'&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;/b&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Описание&quot; [60-792] --&gt;
&lt;h2&gt;&lt;a name=&quot;konfiguracija&quot; id=&quot;konfiguracija&quot;&gt;Конфигурация&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Мой файл настроек &lt;code&gt;/etc/apcupsd/apcupsd.conf&lt;/code&gt; в Kubuntu 7.10 для &lt;a href=&quot;https://gluek.info/wiki/hardware/apc-back-ups-es-700va&quot; class=&quot;wikilink1&quot; title=&quot;hardware:apc-back-ups-es-700va&quot;&gt;APC Back-UPS ES 700VA&lt;/a&gt;:
&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;
#
#  for apcupsd release 3.14.1 (04 May 2007) - debian
#
# &amp;quot;apcupsd&amp;quot; POSIX config file

#
# ========= General configuration parameters ============
#

# UPSNAME xxx
#   Use this to give your UPS a name in log files and such. This
#   is particulary useful if you have multiple UPSes. This does not
#   set the EEPROM. It should be 8 characters or less.
UPSNAME apc700

# UPSCABLE &amp;lt;cable&amp;gt;
#   Defines the type of cable connecting the UPS to your computer.
#
#   Possible generic choices for &amp;lt;cable&amp;gt; are:
#     simple, smart, ether, usb
#
#   Or a specific cable model number may be used:
#     940-0119A, 940-0127A, 940-0128A, 940-0020B,
#     940-0020C, 940-0023A, 940-0024B, 940-0024C,
#     940-1524C, 940-0024G, 940-0095A, 940-0095B,
#     940-0095C, M-04-02-2000
#
#UPSCABLE smart
UPSCABLE usb

# To get apcupsd to work, in addition to defining the cable
# above, you must also define a UPSTYPE, which corresponds to
# the type of UPS you have (see the Description for more details).
# You must also specify a DEVICE, sometimes referred to as a port.
# For USB UPSes, please leave the DEVICE directive blank. For
# other UPS types, you must specify an appropriate port or address.
#
# UPSTYPE   DEVICE           Description
# apcsmart  /dev/tty**       Newer serial character device,
#                            appropriate for SmartUPS models using
#                            a serial cable (not USB).
#
# usb       &amp;lt;BLANK&amp;gt;          Most new UPSes are USB. A blank DEVICE
#                            setting enables autodetection, which is
#                            the best choice for most installations.
#
# net       hostname:port    Network link to a master apcupsd
#                            through apcupsd&amp;#039;s Network Information
#                            Server. This is used if you don&amp;#039;t have
#                            a UPS directly connected to your computer.
#
# snmp      hostname:port:vendor:community
#                            SNMP Network link to an SNMP-enabled
#                            UPS device. Vendor is the MIB used by
#                            the UPS device: can be &amp;quot;APC&amp;quot;, &amp;quot;APC_NOTRAP&amp;quot;
#                            or &amp;quot;RFC&amp;quot; where APC is the powernet MIB,
#                            &amp;quot;APC_NOTRAP&amp;quot; is powernet with SNMP trap
#                            catching disabled, and RFC is the IETF&amp;#039;s
#                            rfc1628 UPS-MIB. You usually want &amp;quot;APC&amp;quot;.
#                            Port is usually 161. Community is usually
#                            &amp;quot;private&amp;quot;.
#
# dumb      /dev/tty**       Old serial character device for use
#                            with simple-signaling UPSes.
#
# pcnet    ipaddr:username:passphrase
#                            PowerChute Network Shutdown protocol
#                            which can be used as an alternative to SNMP
#                            with AP9617 family of smart slot cards.
#                            ipaddr is the IP address of the UPS mgmt
#                            card. username and passphrase are the
#                            credentials for which the card has been
#                            configured.
#
#UPSTYPE apcsmart
#DEVICE /dev/ttyS0

UPSTYPE usb
DEVICE

# LOCKFILE &amp;lt;path to lockfile&amp;gt;
#   Path for device lock file. Not used on Win32.
LOCKFILE /var/lock

# SCRIPTDIR &amp;lt;path to script directory&amp;gt;
#   Directory in which apccontrol and event scripts are located.
SCRIPTDIR /etc/apcupsd

# PWRFAILDIR &amp;lt;path to powerfail directory&amp;gt;
#   Directory in which to write the powerfail flag file. This file
#   is created when apcupsd initiates a system shutdown and is
#   checked in the OS halt scripts to determine if a killpower
#   (turning off UPS output power) is required.
PWRFAILDIR /etc/apcupsd

# NOLOGINDIR &amp;lt;path to nologin directory&amp;gt;
#   Directory in which to write the nologin file. The existence
#   of this flag file tells the OS to disallow new logins.
NOLOGINDIR /etc


#
# ======== Configuration parameters used during power failures ==========
#

# The ONBATTERYDELAY is the time in seconds from when a power failure
#   is detected until we react to it with an onbattery event.
#
#   This means that, apccontrol will be called with the powerout argument
#   immediately when a power failure is detected.  However, the
#   onbattery argument is passed to apccontrol only after the
#   ONBATTERYDELAY time.  If you don&amp;#039;t want to be annoyed by short
#   powerfailures, make sure that apccontrol powerout does nothing
#   i.e. comment out the wall.
ONBATTERYDELAY 6

#
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
# the first that occurs will cause the initation of a shutdown.
#

# If during a power failure, the remaining battery percentage
# (as reported by the UPS) is below or equal to BATTERYLEVEL,
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 5

# If during a power failure, the remaining runtime in minutes
# (as calculated internally by the UPS) is below or equal to MINUTES,
# apcupsd, will initiate a system shutdown.
MINUTES 3

# If during a power failure, the UPS has run on batteries for TIMEOUT
# many seconds or longer, apcupsd will initiate a system shutdown.
# A value of 0 disables this timer.
#
#  Note, if you have a Smart UPS, you will most likely want to disable
#    this timer by setting it to zero. That way, you UPS will continue
#    on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
#    or the remaining battery runtime drops to or below MINUTES.  Of course,
#    if you are testing, setting this to 60 causes a quick system shutdown
#    if you pull the power plug.
#  If you have an older dumb UPS, you will want to set this to less than
#    the time you know you can run on batteries.
TIMEOUT 0

#  Time in seconds between annoying users to signoff prior to
#  system shutdown. 0 disables.
ANNOY 300

# Initial delay after power failure before warning users to get
# off the system.
ANNOYDELAY 60

# The condition which determines when users are prevented from
# logging in during a power failure.
# NOLOGON &amp;lt;string&amp;gt; [ disable | timeout | percent | minutes | always ]
NOLOGON disable

# If KILLDELAY is non-zero, apcupsd will continue running after a
# shutdown has been requested, and after the specified time in
# seconds attempt to kill the power. This is for use on systems
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY &amp;lt;seconds&amp;gt;  0 disables
KILLDELAY 0

#
# ==== Configuration statements for Network Information Server ====
#

# NETSERVER [ on | off ] on enables, off disables the network
#  information server. If netstatus is on, a network information
#  server process will be started for serving the STATUS and
#  EVENT data over the network (used by CGI programs).
NETSERVER on

# NISIP &amp;lt;dotted notation ip address&amp;gt;
#  IP address on which NIS server will listen for incoming connections.
#  This is useful if your server is multi-homed (has more than one
#  network interface and IP address). Default value is 0.0.0.0 which
#  means any incoming request will be serviced. Alternatively, you can
#  configure this setting to any specific IP address of your server and
#  NIS will listen for connections only on that interface. Use the
#  loopback address (127.0.0.1) to accept connections only from the
#  local machine.
NISIP 127.0.0.1

# NISPORT &amp;lt;port&amp;gt; default is 3551 as registered with the IANA
#  port to use for sending STATUS and EVENTS data over the network.
#  It is not used unless NETSERVER is on. If you change this port,
#  you will need to change the corresponding value in the cgi directory
#  and rebuild the cgi programs.
NISPORT 3551

# If you want the last few EVENTS to be available over the network
# by the network information server, you must define an EVENTSFILE.
EVENTSFILE /var/log/apcupsd.events

# EVENTSFILEMAX &amp;lt;kilobytes&amp;gt;
#  By default, the size of the EVENTSFILE will be not be allowed to exceed
#  10 kilobytes.  When the file grows beyond this limit, older EVENTS will
#  be removed from the beginning of the file (first in first out).  The
#  parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
#  to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10

#
# ========== Configuration statements used if sharing =============
#            a UPS with more than one machine

# NETTIME &amp;lt;int&amp;gt;
#   Interval (in seconds) at which the NIS client polls the server.
#   Used only when this apcupsd is a network client (UPSTYPE net).
#NETTIME 60

#
# Remaining items are for ShareUPS (APC expansion card) ONLY
#

# UPSCLASS [ standalone | shareslave | sharemaster ]
#   Normally standalone unless you share an UPS using an APC ShareUPS
#   card.
UPSCLASS standalone

# UPSMODE [ disable | share ]
#   Normally disable unless you share an UPS using an APC ShareUPS card.
UPSMODE disable

#
# ===== Configuration statements to control apcupsd system logging ========
#

# Time interval in seconds between writing the STATUS file; 0 disables
STATTIME 0

# Location of STATUS file (written to only if STATTIME is non-zero)
STATFILE /var/log/apcupsd.status

# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if
#       you turn this on, be sure that the
#       file defined in syslog.conf for LOG_NOTICE is a named pipe.
#  You probably do not want this on.
LOGSTATS off

# Time interval in seconds between writing the DATA records to
#   the log file. 0 disables.
DATATIME 0

# FACILITY defines the logging facility (class) for logging to syslog.
#          If not specified, it defaults to &amp;quot;daemon&amp;quot;. This is useful
#          if you want to separate the data logged by apcupsd from other
#          programs.
#FACILITY DAEMON

#
# ========== Configuration statements used in updating the UPS EPROM =========
#

#
# These statements are used only by apctest when choosing &amp;quot;Set EEPROM with conf
# file values&amp;quot; from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD.
#

# UPS name, max 8 characters
#UPSNAME UPS_IDEN

# Battery date - 8 characters
#BATTDATE mm/dd/yy

# Sensitivity to line voltage quality (H cause faster transfer to batteries)
# SENSITIVITY H M L        (default = H)
#SENSITIVITY H

# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300   (default = 0)
#WAKEUP 60

# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600    (default = 20)
#SLEEP 180

# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 106 103 100 097
#    M 177 172 168 182
#    A 092 090 088 086
#    I 208 204 200 196     (default = 0 =&amp;gt; not valid)
#LOTRANSFER  208

# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 127 130 133 136
#    M 229 234 239 224
#    A 108 110 112 114
#    I 253 257 261 265     (default = 0 =&amp;gt; not valid)
#HITRANSFER 253

# Battery charge needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15

# Alarm delay
# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
# BEEPSTATE 0 T L N        (default = 0)
#BEEPSTATE T

# Low battery warning delay in minutes
# LOWBATT 02 05 07 10      (default = 02)
#LOWBATT 2

# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined by last letter
#  of FIRMWARE or APCMODEL. Some representative values are:
#    D 115
#    M 208
#    A 100
#    I 230 240 220 225     (default = 0 =&amp;gt; not valid)
#OUTPUTVOLTS 230

# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
# SELFTEST 336 168 ON OFF  (default = 336)
#SELFTEST 336
&lt;/pre&gt;

&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Конфигурация&quot; [793-12762] --&gt;
&lt;h2&gt;&lt;a name=&quot;log-fajl&quot; id=&quot;log-fajl&quot;&gt;Лог-файл&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Посмотреть отчет по работе демона apcupsd можно, просмотрев &lt;code&gt;/var/log/apcupsd.events&lt;/code&gt;, например командой &lt;code&gt;tail /var/log/apcupsd.events&lt;/code&gt; (вырезал кусок лога, который информирует об отключении питания и выключении системы после 15-ти минут работы от батарей):
&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;
Sun Jan 27 11:46:45 MSK 2008  Power failure.
Sun Jan 27 11:46:51 MSK 2008  Running on UPS batteries.
Sun Jan 27 12:00:56 MSK 2008  Reached remaining time percentage limit on batteries.
Sun Jan 27 12:00:56 MSK 2008  Initiating system shutdown!
Sun Jan 27 12:00:56 MSK 2008  User logins prohibited
Sun Jan 27 12:01:09 MSK 2008  apcupsd exiting, signal 15
Sun Jan 27 12:01:09 MSK 2008  apcupsd shutdown succeeded
&lt;/pre&gt;


&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Лог-файл&quot; [12763-] --&gt;</description>
        <category>linux</category>
            <pubDate>Fri, 01 Feb 2008 03:05:05 +0300</pubDate>
        </item>
        <item>
            <title>backup.sh - резервное копирование файлов и базы mySQL</title>
            <link>https://gluek.info/wiki/linux/backup-sh</link>
            <description>


&lt;h1&gt;&lt;a name=&quot;backupsh-rezervnoe-kopirovanie-fajlov-i-bazy-mysql&quot; id=&quot;backupsh-rezervnoe-kopirovanie-fajlov-i-bazy-mysql&quot;&gt;backup.sh - резервное копирование файлов и базы mySQL&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;

Скрипт для заметки: &lt;a href=&quot;http://gluek.info/2007/08/18/backup/&quot; class=&quot;urlextern&quot; title=&quot;http://gluek.info/2007/08/18/backup/&quot;&gt;Настраиваю backup на сервере, попытка 1&lt;/a&gt; (комментировать можно там)
&lt;/p&gt;

&lt;p&gt;
Простой скрипт для бэкапа файлов и базы mySQL. Резервная копия базы данных отправляется на почту, а файлы приходится скачивать вручную через ftp. Вариант для второй попытки: сделать инкрементальное копирование в один файл latest.tar.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt; и забирать его с моего компьютера через ftp, тоже автоматически, по cron’у.
&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# *** Backup script by Gluek, 18.08.2007 ***&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# [ mrgluek@gmail.com |  http://gluek.info ]&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# 0. VARIABLES&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;EMAIL&lt;/span&gt;=&lt;span class=&quot;st0&quot;&gt;&amp;quot;gluek.info@gmail.com&amp;quot;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;DATE&lt;/span&gt;=&lt;span class=&quot;sy0&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;date&lt;/span&gt; +&lt;span class=&quot;sy0&quot;&gt;%&lt;/span&gt;Y&lt;span class=&quot;sy0&quot;&gt;%&lt;/span&gt;m&lt;span class=&quot;sy0&quot;&gt;%&lt;/span&gt;d-&lt;span class=&quot;sy0&quot;&gt;%&lt;/span&gt;H&lt;span class=&quot;sy0&quot;&gt;%&lt;/span&gt;M&lt;span class=&quot;sy0&quot;&gt;%&lt;/span&gt;S-&lt;span class=&quot;sy0&quot;&gt;%&lt;/span&gt;Z&lt;span class=&quot;sy0&quot;&gt;`&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# 1. BACKUP PROCEDURE FOR FILES&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;tar&lt;/span&gt; zcf backup&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;gluek.info-&lt;span class=&quot;re1&quot;&gt;$DATE&lt;/span&gt;.tar.gz gluek.info&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# 2. BACKUP PRODECURE FOR MYSQL DATABASE&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;HOSTNAME&lt;/span&gt;=имя_сервера_mysql
&lt;span class=&quot;re2&quot;&gt;DBNAME&lt;/span&gt;=имя_базы
&lt;span class=&quot;re2&quot;&gt;DBPASS&lt;/span&gt;=мой_пароль
&lt;span class=&quot;re2&quot;&gt;DBUSER&lt;/span&gt;=имя_пользователя
&amp;nbsp;
mysqldump &lt;span class=&quot;re5&quot;&gt;--opt&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-h&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$HOSTNAME&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$DBUSER&lt;/span&gt; -p&lt;span class=&quot;re1&quot;&gt;$DBPASS&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$DBNAME&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; backup.sql
&lt;span class=&quot;kw2&quot;&gt;gzip&lt;/span&gt; backup.sql
&lt;span class=&quot;kw2&quot;&gt;mv&lt;/span&gt; backup.sql.gz &lt;span class=&quot;re1&quot;&gt;$HOSTNAME&lt;/span&gt;-&lt;span class=&quot;re1&quot;&gt;$DBNAME&lt;/span&gt;-&lt;span class=&quot;re1&quot;&gt;$DATE&lt;/span&gt;.sql.gz
&lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Backup of &lt;span class=&quot;es2&quot;&gt;$DBNAME&lt;/span&gt; @ &lt;span class=&quot;es2&quot;&gt;$HOSTNAME&lt;/span&gt; from &lt;span class=&quot;es2&quot;&gt;$DATE&lt;/span&gt; is attached&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; mutt &lt;span class=&quot;re5&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$HOSTNAME&lt;/span&gt;-&lt;span class=&quot;re1&quot;&gt;$DBNAME&lt;/span&gt;-&lt;span class=&quot;re1&quot;&gt;$DATE&lt;/span&gt;.sql.gz &lt;span class=&quot;re1&quot;&gt;$EMAIL&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;MySQL Backup of &lt;span class=&quot;es2&quot;&gt;$DBNAME&lt;/span&gt; @ &lt;span class=&quot;es2&quot;&gt;$HOSTNAME&lt;/span&gt;&amp;quot;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$HOSTNAME&lt;/span&gt;-&lt;span class=&quot;re1&quot;&gt;$DBNAME&lt;/span&gt;-&lt;span class=&quot;re1&quot;&gt;$DATE&lt;/span&gt;.sql.gz backup&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# DONE!&lt;/span&gt;&lt;/pre&gt;


&lt;/p&gt;

&lt;/div&gt;
</description>
        <category>linux</category>
            <pubDate>Wed, 11 Jun 2008 18:24:54 +0300</pubDate>
        </item>
        <item>
            <title>Bash Keyboard Shortcuts</title>
            <link>https://gluek.info/wiki/linux/bashkeyboardshortcuts</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:41 +0300</pubDate>
        </item>
        <item>
            <title>Горячие клавиши в Bash</title>
            <link>https://gluek.info/wiki/linux/bashkeyboardshortcutsru</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:40 +0300</pubDate>
        </item>
        <item>
            <title>Блокируем спам с помощью iptables</title>
            <link>https://gluek.info/wiki/linux/blockspamwithiptables</link>
            <description>


&lt;h1&gt;&lt;a name=&quot;blokiruem-spam-s-pomoschju-iptables&quot; id=&quot;blokiruem-spam-s-pomoschju-iptables&quot;&gt;Блокируем спам с помощью iptables&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Поизучал сегодня логи сервера и заметил, что 99% спама идет из пары десятков подсетей &lt;em&gt;(позор вам, китайские открытые прокси!)&lt;/em&gt;. Спам фильтры для Wordpress - это &lt;a href=&quot;http://gluek.info/2006/12/17/akismet-spam-karma-2/&quot; class=&quot;urlextern&quot; title=&quot;http://gluek.info/2006/12/17/akismet-spam-karma-2/&quot;&gt;вещь хорошая&lt;/a&gt;, но проверка каждого комментария довольно сильно нагружает сервер (каждый комментарий - это лишний httpd процесс + обращение к mysql базе).
&lt;/p&gt;

&lt;p&gt;
Так что самым правильным решением я выбрал блокировку эти подсетей на уровне ядра. Для этого в Linux есть замечательная штука - iptables (английская справка - &lt;em&gt;man iptables&lt;/em&gt;, русская - &lt;a href=&quot;http://www.opennet.ru/docs/RUS/iptables/&quot; class=&quot;urlextern&quot; title=&quot;http://www.opennet.ru/docs/RUS/iptables/&quot;&gt;здесь)&lt;/a&gt;. Итак, что у нас получилось:

&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Отслеживаем отправку комментариев:&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
   &lt;pre class=&quot;code&quot;&gt;tail -f accesslog | grep &amp;#039;post.php&amp;#039;&lt;/pre&gt;

&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Спамеров - блокируем:&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
   &lt;pre class=&quot;code&quot;&gt;iptables -A INPUT -s 66.199.252.0/255.255.255.0 -p tcp -m multiport --dports 21,22,80,443 -j DROP&lt;/pre&gt;

&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Контролируем результат:&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
   &lt;pre class=&quot;code&quot;&gt;iptables -L -v -n --line-numbers&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;
В итоге - нагрузка сервера упала на порядок. Эффект достигнут! &lt;sup&gt;&lt;a href=&quot;#fn__1&quot; name=&quot;fnt__1&quot; id=&quot;fnt__1&quot; class=&quot;fn_top&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt;

&lt;/p&gt;

&lt;/div&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;div class=&quot;fn&quot;&gt;&lt;sup&gt;&lt;a href=&quot;#fnt__1&quot; id=&quot;fn__1&quot; name=&quot;fn__1&quot; class=&quot;fn_bot&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt; 
Оригинал статьи опубликован в моем блоге 27.12.2006: &lt;a href=&quot;http://gluek.info/2006/12/27/block-spam-with-iptables/&quot; class=&quot;urlextern&quot; title=&quot;http://gluek.info/2006/12/27/block-spam-with-iptables/&quot;&gt;Блокируем спам с помощью iptables&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
        <category>linux</category>
            <pubDate>Wed, 25 Apr 2007 23:45:26 +0300</pubDate>
        </item>
        <item>
            <title>Chmod</title>
            <link>https://gluek.info/wiki/linux/chmod</link>
            <description>


&lt;h1&gt;&lt;a name=&quot;chmod&quot; id=&quot;chmod&quot;&gt;Chmod&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; &lt;strong&gt;u&lt;/strong&gt;ser &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; &lt;strong&gt;g&lt;/strong&gt;roup &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; &lt;strong&gt;o&lt;/strong&gt;ther &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; rwx &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; r-x &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; r– &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; 7 &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 5 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 4 &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; r &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; w &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; x &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; 4 &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 2 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 1 &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

4+2+1=7, rwx = 7
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Chmod&quot; [1-140] --&gt;
&lt;h2&gt;&lt;a name=&quot;ssylki&quot; id=&quot;ssylki&quot;&gt;Ссылки&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.intuit.ru/department/os/linux/6/linux_6.html&quot; class=&quot;urlextern&quot; title=&quot;http://www.intuit.ru/department/os/linux/6/linux_6.html&quot;&gt;INTUIT.ru - Операционная система Linux - Права доступа&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Ссылки&quot; [141-] --&gt;</description>
        <category>linux</category>
            <pubDate>Tue, 26 Jun 2007 15:55:57 +0300</pubDate>
        </item>
        <item>
            <title>Цвета в Shell</title>
            <link>https://gluek.info/wiki/linux/colorsinshell</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:40 +0300</pubDate>
        </item>
        <item>
            <title>Преобразование различных образов дисков в формат ISO</title>
            <link>https://gluek.info/wiki/linux/convertingvariousimageformatstoiso</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:39 +0300</pubDate>
        </item>
        <item>
            <title>Crontab</title>
            <link>https://gluek.info/wiki/linux/crontab</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:40 +0300</pubDate>
        </item>
        <item>
            <title>DCOP</title>
            <link>https://gluek.info/wiki/linux/dcop</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:39 +0300</pubDate>
        </item>
        <item>
            <title>Проблема с локалью в Kubuntu 7.10</title>
            <link>https://gluek.info/wiki/linux/locale</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:41 +0300</pubDate>
        </item>
        <item>
            <title>Linux</title>
            <link>https://gluek.info/wiki/linux/main-page</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:39 +0300</pubDate>
        </item>
        <item>
            <title>Мой .vimrc</title>
            <link>https://gluek.info/wiki/linux/my-vimrc</link>
            <description>


&lt;h1&gt;&lt;a name=&quot;moj-vimrc&quot; id=&quot;moj-vimrc&quot;&gt;Мой .vimrc&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;

&lt;pre class=&quot;code&quot;&gt;
&amp;quot; Gluek&amp;#039;s .vimrc config file for VIM, version 2009-01-08.
&amp;quot;
&amp;quot; Feel free to contact me if you have any questions/suggestions.
&amp;quot; Email and Jabber: [ mrgluek@gmail.com ] or Skype: [ gluek42 ]
&amp;quot;
&amp;quot; Get latest version of this file at: [ http://gluek.info/wiki/linux/my-vimrc ]

&amp;quot; *** Basic options ***
syntax on &amp;quot; turn syntax highlighting on
filetype on &amp;quot; filetype detection on

&amp;quot; *** Set section ***
set mouse=a &amp;quot; enable mouse support
set background=dark &amp;quot; force dark background
set hlsearch &amp;quot; search selected word by pressing * (asterisk)
set incsearch &amp;quot; on search instantly go to found text when typing
set backup &amp;quot; create backup files (by default: &amp;lt;oldname&amp;gt;~)
set listchars+=precedes:&amp;lt;,extends:&amp;gt; &amp;quot; show &amp;quot;&amp;gt;&amp;quot; or &amp;quot;&amp;lt;&amp;quot; if text string is longer than screen
set ignorecase &amp;quot; ingore lower/UPPER case on search
set backspace=indent,eol,start whichwrap+=&amp;lt;,&amp;gt;,[,] &amp;quot; allow to use backspace instead of &amp;quot;x&amp;quot;
&amp;quot; encoding is utf-8 by default:
set encoding=utf-8
set termencoding=utf-8
&amp;quot;set statusline=%&amp;lt;%f%h%m%r%=%b\ %{&amp;amp;encoding}\ 0x%B\ \ %l,%c%V\ %P
set statusline=%&amp;lt;%f%h%m%r%=format=%{&amp;amp;fileformat}\ file=%{&amp;amp;fileencoding}\ enc=%{&amp;amp;encoding}\ %b\ 0x%B\ %l,%c%V\ %P

&amp;quot; *** Key bindings ***

&amp;quot; CTRL-C and CTRL-Insert are Copy
vnoremap &amp;lt;C-C&amp;gt; &amp;quot;+y
vnoremap &amp;lt;C-Insert&amp;gt; &amp;quot;+y
map &amp;lt;C-V&amp;gt; &amp;quot;+gP
map &amp;lt;S-Insert&amp;gt; &amp;quot;+gP
imap &amp;lt;S-Insert&amp;gt; &amp;lt;C-V&amp;gt;
vmap &amp;lt;S-Insert&amp;gt; &amp;lt;C-V&amp;gt;

&amp;quot; Make shift-insert work like in Xterm
map &amp;lt;S-Insert&amp;gt; &amp;lt;MiddleMouse&amp;gt;
map! &amp;lt;S-Insert&amp;gt; &amp;lt;MiddleMouse&amp;gt;

&amp;quot; map Ctrl-y to delete lines
inoremap &amp;lt;c-y&amp;gt; &amp;lt;esc&amp;gt;ddi

&amp;quot; Exit on F10
imap &amp;lt;F10&amp;gt; &amp;lt;Esc&amp;gt;:qa&amp;lt;CR&amp;gt;
nmap &amp;lt;F10&amp;gt; :qa&amp;lt;CR&amp;gt;

&amp;quot;imap &amp;lt;Tab&amp;gt; &amp;lt;C-N&amp;gt; &amp;quot; autocompletion by Tab

nmap &amp;lt;F7&amp;gt; &amp;lt;C-W&amp;gt;k&amp;lt;C-W&amp;gt;_ &amp;quot; окно вверх
imap &amp;lt;F7&amp;gt; &amp;lt;Esc&amp;gt;&amp;lt;C-W&amp;gt;k&amp;lt;C-W&amp;gt;_a &amp;quot; окно вверх
&amp;quot;nmap &amp;lt;F8&amp;gt; &amp;lt;C-W&amp;gt;j&amp;lt;C-W&amp;gt;_ &amp;quot; окно вниз
&amp;quot;imap &amp;lt;F8&amp;gt; &amp;lt;Esc&amp;gt;&amp;lt;C-W&amp;gt;j&amp;lt;C-W&amp;gt;_a &amp;quot; окно вниз

&amp;quot; Save current buffer (file)
imap &amp;lt;F2&amp;gt; &amp;lt;Esc&amp;gt;:w&amp;lt;CR&amp;gt;a
nmap &amp;lt;F2&amp;gt; :w&amp;lt;CR&amp;gt;

&amp;quot; On/off line numbers by F11
imap &amp;lt;F11&amp;gt; &amp;lt;Esc&amp;gt;:set&amp;lt;Space&amp;gt;nu!&amp;lt;CR&amp;gt;a
nmap &amp;lt;F11&amp;gt; :set&amp;lt;Space&amp;gt;nu!&amp;lt;CR&amp;gt;
&lt;/pre&gt;


&lt;/p&gt;

&lt;/div&gt;
</description>
        <category>linux</category>
            <pubDate>Thu, 08 Jan 2009 17:43:25 +0300</pubDate>
        </item>
        <item>
            <title>mysqldump help</title>
            <link>https://gluek.info/wiki/linux/mysqldump-help</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:41 +0300</pubDate>
        </item>
        <item>
            <title>Настройка квотирования</title>
            <link>https://gluek.info/wiki/linux/quotas</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:40 +0300</pubDate>
        </item>
        <item>
            <title>screen terminal window manager</title>
            <link>https://gluek.info/wiki/linux/screen</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:41 +0300</pubDate>
        </item>
        <item>
            <title>Мониторинг температуры в Linux</title>
            <link>https://gluek.info/wiki/linux/temperaturemonitoringinlinux</link>
            <description>


&lt;h1&gt;&lt;a name=&quot;monitoring-temperatury-v-linux&quot; id=&quot;monitoring-temperatury-v-linux&quot;&gt;Мониторинг температуры в Linux&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;

Решил заняться контролем системы и проверить температуру процессора и жестких дисков, а также скорости вращения вентиляторов. Для этого мною используются две консольные утилиты: &lt;a href=&quot;http://www.lm-sensors.org&quot; class=&quot;urlextern&quot; title=&quot;http://www.lm-sensors.org&quot;&gt;lm_sensors&lt;/a&gt; и &lt;a href=&quot;http://www.guzu.net/linux/hddtemp.php&quot; class=&quot;urlextern&quot; title=&quot;http://www.guzu.net/linux/hddtemp.php&quot;&gt;hddtemp&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Не стану подробно писать о настройке, т.к. уже написана очень хорошая статья, с которой рекомендую ознакомиться:
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;&lt;a href=&quot;http://mydebianblog.blogspot.com/2006/07/blog-post_24.html&quot; class=&quot;urlextern&quot; title=&quot;http://mydebianblog.blogspot.com/2006/07/blog-post_24.html&quot;&gt;Мониторинг железа в Дебиан&lt;/a&gt;&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
На моей системе &lt;em&gt;(openSUSE 10.1 / 2.6.16.21-0.25-default)&lt;/em&gt; все необходимое уже было, и ядро пересобирать мне не пришлось, что конечно радует:
&lt;/p&gt;

&lt;p&gt;
&lt;em&gt;Для того, чтобы все установленные утилиты заработали, требуется иметь в ядре I2C и Hardware Monitoring включёнными монолитно, а так же модульно все драйверы для вашей материнской платы.&lt;/em&gt;
&lt;/p&gt;

&lt;p&gt;
После запуска &lt;code&gt;sensors-detect&lt;/code&gt; и ответа на вопросы программы &lt;em&gt;(которые у меня, впрочем, свелись к нажатию несколько раз на Enter)&lt;/em&gt; все датчики моего ПК нашлись и заработали - команда &lt;code&gt;sensors&lt;/code&gt; стала отображать напряжения, температуры и скорости вентиляторов. Для наглядного графического отображения показаний у себя &lt;em&gt;(KDE 3.5.5)&lt;/em&gt; я решил воспользоваться &lt;a href=&quot;http://ksensors.sourceforge.net/&quot; class=&quot;urlextern&quot; title=&quot;http://ksensors.sourceforge.net/&quot;&gt;KSensors&lt;/a&gt;, которую даже не пришлось ставить отдельно:
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://gluek.info/wiki/lib/exe/fetch.php?hash=18511b&amp;amp;media=http%3A%2F%2Fgluek.info%2Fimages%2F2007%2F01%2Fksensors.png&quot; class=&quot;media&quot; title=&quot;http://gluek.info/images/2007/01/ksensors.png&quot;&gt;&lt;img src=&quot;https://gluek.info/wiki/lib/exe/fetch.php?hash=18511b&amp;amp;media=http%3A%2F%2Fgluek.info%2Fimages%2F2007%2F01%2Fksensors.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
В случае удаленного мониторинга, например через ssh, помогает добавить в .bashrc такую строку &lt;em&gt;(конечно, поменяв temp2 и &lt;acronym title=&quot;IDE Primary Slave device (Linux)&quot;&gt;hdb&lt;/acronym&gt; на значения для своей конфигурации)&lt;/em&gt;:
&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;# temperature monitoring
alias t=\&amp;#039;echo -en &amp;quot;\\E[1;31;40mSensors status for &amp;quot;; date -R; sensors | grep temp2; hddtemp /dev/hdb; echo -ne &amp;quot;\\033[0m&amp;quot;;\&amp;#039;&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;
В результате, набрав в консоли &lt;code&gt;t&lt;/code&gt;, получаем желаемое:
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://gluek.info/wiki/lib/exe/fetch.php?hash=18c924&amp;amp;media=http%3A%2F%2Fgluek.info%2Fimages%2F2007%2F01%2Ft.png&quot; class=&quot;media&quot; title=&quot;http://gluek.info/images/2007/01/t.png&quot;&gt;&lt;img src=&quot;https://gluek.info/wiki/lib/exe/fetch.php?hash=18c924&amp;amp;media=http%3A%2F%2Fgluek.info%2Fimages%2F2007%2F01%2Ft.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;sup&gt;&lt;a href=&quot;#fn__1&quot; name=&quot;fnt__1&quot; id=&quot;fnt__1&quot; class=&quot;fn_top&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt;

&lt;/p&gt;

&lt;/div&gt;
&lt;div class=&quot;footnotes&quot;&gt;
&lt;div class=&quot;fn&quot;&gt;&lt;sup&gt;&lt;a href=&quot;#fnt__1&quot; id=&quot;fn__1&quot; name=&quot;fn__1&quot; class=&quot;fn_bot&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt; 
Оригинал статьи опубликован в моем блоге 07.01.2006: &lt;a href=&quot;http://gluek.info/2007/01/07/monitoring-temperaturyi-v-linux/&quot; class=&quot;urlextern&quot; title=&quot;http://gluek.info/2007/01/07/monitoring-temperaturyi-v-linux/&quot;&gt;Мониторинг температуры в Linux&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
        <category>linux</category>
            <pubDate>Wed, 25 Apr 2007 23:51:12 +0300</pubDate>
        </item>
        <item>
            <title>~/.toprc</title>
            <link>https://gluek.info/wiki/linux/toprc</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:40 +0300</pubDate>
        </item>
        <item>
            <title>Программы для мониторинга ИБП</title>
            <link>https://gluek.info/wiki/linux/ups-software</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:40 +0300</pubDate>
        </item>
        <item>
            <title>Полезные консольные команды Linux</title>
            <link>https://gluek.info/wiki/linux/usefulshellcommands</link>
            <description>


&lt;h1&gt;&lt;a name=&quot;poleznye-konsolnye-komandy-linux&quot; id=&quot;poleznye-konsolnye-komandy-linux&quot;&gt;Полезные консольные команды Linux&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Полезные консольные команды Linux&quot; [1-76] --&gt;
&lt;h2&gt;&lt;a name=&quot;informacija-o-sisteme&quot; id=&quot;informacija-o-sisteme&quot;&gt;Информация о системе&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Посмотреть, кто залогинен в систему в данный момент: &lt;code&gt;who&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Свободное место на жестких дисках: &lt;code&gt;df -h | grep /hd&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Наблюдать за свободной памятью (выход – Ctrl+C): &lt;code&gt;watch free&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Uptime + кто залогинен: &lt;code&gt;w&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Данные с &lt;a href=&quot;https://gluek.info/wiki/linux/temperaturemonitoringinlinux&quot; class=&quot;wikilink1&quot; title=&quot;linux:temperaturemonitoringinlinux&quot;&gt;температурных датчиков&lt;/a&gt;: &lt;code&gt;sensors&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Информация о «железе»: &lt;code&gt;hwinfo&lt;/code&gt; (о конкретной части: &lt;code&gt;hwinfo cpu&lt;/code&gt; или, к примеру, &lt;code&gt;hwinfo memory&lt;/code&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Информация DMI (&lt;a href=&quot;http://en.wikipedia.org/wiki/SMBIOS&quot; class=&quot;interwiki iw_wp&quot; title=&quot;http://en.wikipedia.org/wiki/SMBIOS&quot;&gt;SMBIOS&lt;/a&gt;) в читабельном виде: &lt;code&gt;dmidecode&lt;/code&gt; (в «нечитабельном»: &lt;code&gt;sudo dd if=/dev/mem bs=64k skip=15 count=1 | strings | less&lt;/code&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Информация о процессах, памяти, диске и сетевых интерфейсах на одном экране: &lt;code&gt;saidar&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Информация о системе&quot; [77-1094] --&gt;
&lt;h2&gt;&lt;a name=&quot;rabota-s-fajlovoj-sistemoj&quot; id=&quot;rabota-s-fajlovoj-sistemoj&quot;&gt;Работа с файловой системой&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Создание нескольких вложенных директорий: &lt;code&gt;mkdir -p tmp/a/b/c&lt;/code&gt; или даже так: &lt;code&gt;mkdir -p project/{lib/ext,bin,src,doc/{html,info,pdf},demo/stat/a}&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Вывод листинга текущей директории с описанием содержимого файлов: &lt;code&gt;ls -1 | xargs file&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Фильтр файлов за определенную дату: &lt;code&gt;ls -l | awk \&amp;#039;$6 == «2006-12-24»\&lt;/code&gt;&amp;#039;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Посмотреть, какой процесс мешает размонтировать устройство: &lt;code&gt;sudo lsof /dev/sda1&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Удалить &lt;acronym title=&quot;Master boot record&quot;&gt;MBR&lt;/acronym&gt; диска &lt;acronym title=&quot;IDE Primary Master device (Linux)&quot;&gt;hda&lt;/acronym&gt;: &lt;img src=&quot;https://gluek.info/wiki/lib/images/smileys/icon_exclaim.gif&quot; class=&quot;middle&quot; alt=&quot;:!:&quot; /&gt; &lt;code&gt;dd if=/dev/zero of=/dev/&lt;acronym title=&quot;IDE Primary Master device (Linux)&quot;&gt;hda&lt;/acronym&gt; bs=512 count=1&lt;/code&gt; &lt;img src=&quot;https://gluek.info/wiki/lib/images/smileys/icon_exclaim.gif&quot; class=&quot;middle&quot; alt=&quot;:!:&quot; /&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Управление и мониторинг &lt;acronym title=&quot;Redundant Array of Inexpensive Disks&quot;&gt;RAID&lt;/acronym&gt;-массивов: &lt;code&gt;mdadm&lt;/code&gt; (читайте &lt;code&gt;man mdadm&lt;/code&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Преобразование кодировок в названии файлов: &lt;code&gt;convmv&lt;/code&gt; (удобно при скачивании виндовых торрентов/архивов)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Работа с файловой системой&quot; [1095-2156] --&gt;
&lt;h3&gt;&lt;a name=&quot;poisk-fajlov&quot; id=&quot;poisk-fajlov&quot;&gt;Поиск файлов&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Поиск файлов с именем filename в текущей и всех вложенных директориях и вывод их листинга: &lt;code&gt;find ./ -name «filename» -print | xargs ls -alp&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Поиск и подсветка цветом строки &lt;code&gt;text&lt;/code&gt; в папке &lt;code&gt;/home/gluek/Documents&lt;/code&gt; в выводом имени найденных файлов: &lt;code&gt;grep -EHnr –color text /home/gluek/Documents&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Поиск файлов&quot; [2157-2630] --&gt;
&lt;h3&gt;&lt;a name=&quot;zapis-diskov&quot; id=&quot;zapis-diskov&quot;&gt;Запись дисков&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Найти пишущий привод: &lt;code&gt;sudo cdrecord -scanbus dev=ATAPI&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Запись дисков&quot; [2631-2749] --&gt;
&lt;h3&gt;&lt;a name=&quot;raid&quot; id=&quot;raid&quot;&gt;RAID&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Создаем &lt;acronym title=&quot;Redundant Array of Inexpensive Disks&quot;&gt;RAID&lt;/acronym&gt; 1:&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hdb1 /dev/hdc1&lt;/pre&gt;

&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Смотрим статус &lt;acronym title=&quot;Redundant Array of Inexpensive Disks&quot;&gt;RAID&lt;/acronym&gt; 1: &lt;code&gt;cat /proc/mdstat&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Создаем файловую систему на &lt;acronym title=&quot;Redundant Array of Inexpensive Disks&quot;&gt;RAID&lt;/acronym&gt; разделе:  &lt;code&gt;mkfs.ext3 /dev/md0&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Проверка диска в массиве &lt;strong&gt;(запускать от root)&lt;/strong&gt;: &lt;code&gt;mdadm -E /dev/hdb1&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Отправка отчета в случае сбоя на почту &lt;strong&gt;(добавить в crontab root&amp;#039;а)&lt;/strong&gt;: — &lt;a href=&quot;http://www.opennet.ru/tips/info/881.shtml&quot; class=&quot;urlextern&quot; title=&quot;http://www.opennet.ru/tips/info/881.shtml&quot;&gt;Мониторинг и восстановление программного RAID в Linux&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;*/30 * * * * root mdadm --monitor --scan -1 --mail=mrgluek@gmail.com&lt;/pre&gt;

&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;RAID&quot; [2750-3491] --&gt;
&lt;h2&gt;&lt;a name=&quot;rabota-s-arxivami-i-obrazami&quot; id=&quot;rabota-s-arxivami-i-obrazami&quot;&gt;Работа с архивами и образами&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Запаковать папку /home в архив file.tar.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt;: &lt;code&gt;tar zcvf file.tar.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt; /home&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Распаковать архив file.tar.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt;: &lt;code&gt;tar zxvf file.tar.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Распаковать архив file.tar.bz2: &lt;code&gt;tar jxvf file.tar.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Подключить iso образ myiso.iso в файловую систему: &lt;code&gt;sudo mkdir /mnt/myiso/; sudo mount myiso.iso /mnt/myiso/ -o ro,loop=/dev/loop0&lt;/code&gt; — &lt;a href=&quot;https://gluek.info/wiki/linux/convertingvariousimageformatstoiso&quot; class=&quot;wikilink1&quot; title=&quot;linux:convertingvariousimageformatstoiso&quot;&gt;Преобразование различных образов дисков в формат ISO&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Создать загрузочную дискету с FreeDOS: &lt;code&gt;makebootdisk&lt;/code&gt; &lt;em&gt;(удобно для обновления прошивок железа)&lt;/em&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Перенести файлы с сервера на сервер: &lt;code&gt;tar -cf - path_to_archive | gzip - | ssh login@domain «cat - &amp;gt; archive.tar.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt;»&lt;/code&gt; — &lt;a href=&quot;http://xpoint.ru/forums/computers/os/unix/thread/40371.xhtml&quot; class=&quot;urlextern&quot; title=&quot;http://xpoint.ru/forums/computers/os/unix/thread/40371.xhtml&quot;&gt;источник&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Работа с архивами и образами&quot; [3492-4521] --&gt;
&lt;h3&gt;&lt;a name=&quot;rabota-s-obrazami-diskov&quot; id=&quot;rabota-s-obrazami-diskov&quot;&gt;Работа с образами дисков&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Сделать упакованную резервную копию всего диска: &lt;code&gt;dd if=/dev/sda | gzip -9cn &amp;gt; image.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Восстановить обратно: &lt;code&gt;gzip -cd image.&lt;acronym title=&quot;.gz, the file extension for gzip files (GNU zip, a file compression program)&quot;&gt;gz&lt;/acronym&gt; &amp;gt; /dev/sda&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Работа с образами дисков&quot; [4522-4795] --&gt;
&lt;h2&gt;&lt;a name=&quot;rabota-v-graficheskoj-srede&quot; id=&quot;rabota-v-graficheskoj-srede&quot;&gt;Работа в графической среде&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Информация о X сервере: &lt;code&gt;xdpyinfo&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Узнать, какой шрифт будет использован, если приложение запросило serif: &lt;code&gt;fc-match serif&lt;/code&gt; (подробнее: &lt;a href=&quot;http://gq.net.ru/2007/11/08/fontconfigs-fonts-priority/&quot; class=&quot;urlextern&quot; title=&quot;http://gq.net.ru/2007/11/08/fontconfigs-fonts-priority/&quot;&gt;Задание приоритета шрифтов в fontconfig at GQ’s blog&lt;/a&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Работа в графической среде&quot; [4796-5229] --&gt;
&lt;h3&gt;&lt;a name=&quot;rabota-v-kde&quot; id=&quot;rabota-v-kde&quot;&gt;Работа в KDE&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Свернуть приложение в трей (в примере — Konsole): &lt;code&gt;ksystraycmd –window &amp;#039;Konsole&amp;#039; –hidden&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; Для поиска нужного окна можно пользоваться такой командой: &lt;code&gt;sleep 3; xwininfo&lt;/code&gt; &lt;em&gt;(пауза 3 секунды сделана специально — чтобы успеть переключиться из консоли в нужное окно, а затем кликнуть на него; информация об окне будет в консоли, нам нужен Window id, а точнее то, что находится в кавычках)&lt;/em&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Работа в KDE&quot; [5230-5908] --&gt;
&lt;h2&gt;&lt;a name=&quot;rabota-v-seti&quot; id=&quot;rabota-v-seti&quot;&gt;Работа в сети&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Статистки сетевых соединений: &lt;code&gt;iptraf&lt;/code&gt; (см. &lt;a href=&quot;http://iptraf.seul.org/&quot; class=&quot;urlextern&quot; title=&quot;http://iptraf.seul.org/&quot;&gt;http://iptraf.seul.org/&lt;/a&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Информация о сетевой карте (скорость и тип соединения): &lt;code&gt;sudo ethtool eth0&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Смена мак-адреса сетевой карты (до перезагрузки): &lt;code&gt;sudo ifconfig eth0 hw ether xx:xx:Xx:xx&lt;/code&gt; &lt;a href=&quot;http://mydebianblog.blogspot.com/2007/02/blog-post_24.html подробнее...&quot; class=&quot;urlextern&quot; title=&quot;http://mydebianblog.blogspot.com/2007/02/blog-post_24.html подробнее...&quot;&gt;http://mydebianblog.blogspot.com/2007/02/blog-post_24.html подробнее...&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Список windows shares в сети: &lt;code&gt;nmap -p 139 192.168.1.1-255&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Список доступных shares на машине: &lt;code&gt;smbclient -N -L 192.168.1.1&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Работа в сети&quot; [5909-6570] --&gt;
&lt;h2&gt;&lt;a name=&quot;ssylki&quot; id=&quot;ssylki&quot;&gt;Ссылки&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.allcommands.com/&quot; class=&quot;urlextern&quot; title=&quot;http://www.allcommands.com/&quot;&gt;Universal Command Guide for Operating Systems&lt;/a&gt; — действительно большой справочник по командам различных ОС.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Ссылки&quot; [6571-] --&gt;</description>
        <category>linux</category>
            <pubDate>Wed, 12 Mar 2008 02:34:44 +0300</pubDate>
        </item>
        <item>
            <title>Расширения VIM</title>
            <link>https://gluek.info/wiki/linux/vim-scripts</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:39 +0300</pubDate>
        </item>
        <item>
            <title>Редактор VIM: Советы и секреты</title>
            <link>https://gluek.info/wiki/linux/vim-tips</link>
            <description>


&lt;h1&gt;&lt;a name=&quot;redaktor-vimsovety-i-sekrety&quot; id=&quot;redaktor-vimsovety-i-sekrety&quot;&gt;Редактор VIM: Советы и секреты&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;div class='box round left' style='width: 40%;'&gt;
  &lt;b class='xtop'&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;/b&gt;
  &lt;div class='xbox'&gt;
&lt;p class='box_title'&gt;&lt;a href=&quot;http://gluek.info/2007/05/04/gvimportable/&quot; class=&quot;urlextern&quot; title=&quot;http://gluek.info/2007/05/04/gvimportable/&quot;&gt;GVimPortable - носим Vim на флешке&lt;/a&gt;&lt;/p&gt;
&lt;div class='box_content'&gt;&lt;p&gt;
К &lt;a href=&quot;http://twitter.com/numberone/statuses/48276722&quot; class=&quot;urlextern&quot; title=&quot;http://twitter.com/numberone/statuses/48276722&quot;&gt;вопросу&lt;/a&gt; о выборе правильного редактора: пользователи Windows, обратите внимание на знаменитый &lt;a href=&quot;http://iar.spb.ru/why/vim&quot; class=&quot;urlextern&quot; title=&quot;http://iar.spb.ru/why/vim&quot;&gt;редактор Vim&lt;/a&gt;, а точнее — на его “переносную” версию под Windows: &lt;a href=&quot;http://portablegvim.sourceforge.net/index.html&quot; class=&quot;urlextern&quot; title=&quot;http://portablegvim.sourceforge.net/index.html&quot;&gt;GVim Portable&lt;/a&gt;.
&lt;p&gt;
И не забудьте посетить сайт &lt;a href=&quot;http://www.vim.org/index.php&quot; class=&quot;urlextern&quot; title=&quot;http://www.vim.org/index.php&quot;&gt;vim online&lt;/a&gt;, содержащий хорошую подборку &lt;a href=&quot;http://www.vim.org/docs.php&quot; class=&quot;urlextern&quot; title=&quot;http://www.vim.org/docs.php&quot;&gt;документации по Vim&lt;/a&gt;.

&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;b class='xbottom'&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;div class='box round left green' style='width: 30%;'&gt;
  &lt;b class='xtop'&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;/b&gt;
  &lt;div class='xbox'&gt;
&lt;p class='box_title'&gt;Ссылки на дружественные vim&amp;#039;у ресурсы&lt;/p&gt;
&lt;div class='box_content'&gt;&lt;p&gt;&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://iar.spb.ru/why/vim&quot; class=&quot;urlextern&quot; title=&quot;http://iar.spb.ru/why/vim&quot;&gt;Немного о редакторе vim&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://iar.spb.ru/tips/vim-scripts&quot; class=&quot;urlextern&quot; title=&quot;http://iar.spb.ru/tips/vim-scripts&quot;&gt;Расширения vim&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://lib.ru/unixhelp/vibegin.txt&quot; class=&quot;urlextern&quot; title=&quot;http://lib.ru/unixhelp/vibegin.txt&quot;&gt;Редактор VI. Список команд&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;b class='xbottom'&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;/b&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Редактор VIM: Советы и секреты&quot; [1-1172] --&gt;
&lt;h2&gt;&lt;a name=&quot;poisk-i-zamena-teksta&quot; id=&quot;poisk-i-zamena-teksta&quot;&gt;Поиск и замена текста&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class='box round' style='width: 80%;'&gt;
  &lt;b class='xtop'&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;/b&gt;
  &lt;div class='xbox'&gt;
&lt;p class='box_title'&gt;&lt;a href=&quot;http://www.vim.org/tips/tip.php?tip_id=31&quot; class=&quot;urlextern&quot; title=&quot;http://www.vim.org/tips/tip.php?tip_id=31&quot;&gt;Tip #31: Find and Replace&lt;/a&gt;&lt;/p&gt;
&lt;div class='box_content'&gt;&lt;p&gt;
To find and replace one or more occurences of a given text pattern with a
new text string, use the s[ubstitute] command.
&lt;p&gt;
There are a variety of options, but these are what you most probably want:

&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;code&gt;:%s/foo/bar/g&lt;/code&gt;          &lt;/td&gt;&lt;td class=&quot;col1&quot; colspan=&quot;2&quot;&gt; find each occurance of &amp;#039;foo&amp;#039; and replace it with &amp;#039;bar&amp;#039; without asking for confirmation&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;code&gt;:%s/foo/bar/gc&lt;/code&gt;         &lt;/td&gt;&lt;td class=&quot;col1&quot; colspan=&quot;2&quot;&gt; find each occurance of &amp;#039;foo&amp;#039; and replace it with &amp;#039;bar&amp;#039; asking for confirmation first&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;code&gt;:%s/&amp;lt;foo&amp;gt;/bar/gc&lt;/code&gt;     &lt;/td&gt;&lt;td class=&quot;col1&quot; colspan=&quot;2&quot;&gt; find (match exact word only) and replace each occurance of &amp;#039;foo&amp;#039; with &amp;#039;bar&amp;#039;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;code&gt;:%s/foo/bar/gci&lt;/code&gt;        &lt;/td&gt;&lt;td class=&quot;col1&quot; colspan=&quot;2&quot;&gt; find (case insensitive) and replace each occurance of &amp;#039;foo&amp;#039; with &amp;#039;bar&amp;#039;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;code&gt;:%s/foo/bar/gcI&lt;/code&gt;        &lt;/td&gt;&lt;td class=&quot;col1&quot; colspan=&quot;2&quot;&gt; find (case sensitive) and replace each occurance of &amp;#039;foo&amp;#039; with &amp;#039;bar&amp;#039;&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;div class=&quot;noteclassic&quot;&gt;Without the &amp;#039;g&amp;#039; flag, replacement occurs only for the first occurrence in each line.
&lt;/div&gt;

&lt;p&gt;
For a full description and some more interesting examples of the substitute command refer to
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;:help substitute&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
See also:
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;:help cmdline-ranges&lt;/code&gt;&lt;br/&gt;

&lt;code&gt;:help pattern&lt;/code&gt;&lt;br/&gt;

&lt;code&gt;:help gdefault&lt;/code&gt;

&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;b class='xbottom'&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;div class='box round' style='width: 80%;'&gt;
  &lt;b class='xtop'&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;/b&gt;
  &lt;div class='xbox'&gt;
&lt;p class='box_title'&gt;&lt;a href=&quot;http://vim.sourceforge.net/tips/tip.php?tip_id=1501&quot; class=&quot;urlextern&quot; title=&quot;http://vim.sourceforge.net/tips/tip.php?tip_id=1501&quot;&gt;Tip #1501 - substitute last search : vim online&lt;/a&gt;&lt;/p&gt;
&lt;div class='box_content'&gt;&lt;p&gt;
Замена результатов предыдущего поиска:
&lt;pre class=&quot;code&quot;&gt;
/ищем-что-то
:%s//меняем-на-другое/g
&lt;/pre&gt;

В итоге будет произведена замена &lt;code&gt;ищем-что-то&lt;/code&gt; на строку &lt;code&gt;меняем-на-другое&lt;/code&gt;. Плюс в том, что не надо дважды вводить выражение для поиска, и исключается возможность ошибки в написании.
&lt;/div&gt;
  &lt;/div&gt;
  &lt;b class='xbottom'&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;/b&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Поиск и замена текста&quot; [1173-2973] --&gt;
&lt;h2&gt;&lt;a name=&quot;copy-and-paste-text&quot; id=&quot;copy-and-paste-text&quot;&gt;Copy and paste text&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class='box round' style='width: 80%;'&gt;
  &lt;b class='xtop'&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;/b&gt;
  &lt;div class='xbox'&gt;
&lt;p class='box_title'&gt;&lt;a href=&quot;http://www.tech-recipes.com/unix_tips219.html&quot; class=&quot;urlextern&quot; title=&quot;http://www.tech-recipes.com/unix_tips219.html&quot;&gt;Copy and paste text with vi or vim&lt;/a&gt;&lt;/p&gt;
&lt;div class='box_content'&gt;&lt;p&gt;
The command &amp;#039;Y&amp;#039; or &amp;#039;yy&amp;#039; copies (yanks) one or more lines. To copy one line, two lines, 10 lines, and all lines to the end of the file, respectively:
&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;
Y
2Y
10Y
yG
&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;
To paste the text contained in the buffer above (uppercase P) or below the current cursor position (lowercase p), respectively:
&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;
P
p
&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;
It is also possible to yank text within a line. The following commands yank text from the current cursor position to the end of the word and the end of the line, respectively:
&lt;/p&gt;

&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;
yw
y$
&lt;/pre&gt;

&lt;/p&gt;

&lt;p&gt;
The same commands paste the text within a line. Lower case p pastes after the cursor position and upper case P pastes before.
&lt;/p&gt;

&lt;p&gt;
Paste will also work with deleted text, either lines or parts of lines. Be careful not to execute any other commands prior to pasting as this will empty the buffer.

&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;b class='xbottom'&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;/b&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Copy and paste text&quot; [2974-3933] --&gt;
&lt;h2&gt;&lt;a name=&quot;showhide-line-numbers&quot; id=&quot;showhide-line-numbers&quot;&gt;Show/hide line numbers&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class='box round' style='width: 80%;'&gt;
  &lt;b class='xtop'&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;/b&gt;
  &lt;div class='xbox'&gt;
&lt;p class='box_title'&gt;&lt;a href=&quot;http://www.vim.org/tips/tip.php?tip_id=19&quot; class=&quot;urlextern&quot; title=&quot;http://www.vim.org/tips/tip.php?tip_id=19&quot;&gt;Tip #19 - line numbers...&lt;/a&gt;&lt;/p&gt;
&lt;div class='box_content'&gt;&lt;p&gt;
&lt;pre class=&quot;code&quot;&gt;:set number&lt;/pre&gt;

or shorter:
&lt;pre class=&quot;code&quot;&gt;:set nu&lt;/pre&gt;

&lt;/p&gt;&lt;div class=&quot;notetip&quot;&gt;An even better way, if you like maps: Put this in your .vimrc file:&lt;br/&gt;

&lt;code&gt;:nmap &amp;lt;C-N&amp;gt;&amp;lt;C-N&amp;gt; :set invnumber &amp;lt;CR&amp;gt;&lt;/code&gt;&lt;br/&gt;

By pressing Ctrl-N twice  (or some other shortcut you fancy) in normal mode, you can toggle between showing and hiding line numbers.
&lt;/div&gt;&lt;p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;b class='xbottom'&gt;&lt;b class='xb4'&gt;&lt;/b&gt;&lt;b class='xb3'&gt;&lt;/b&gt;&lt;b class='xb2'&gt;&lt;/b&gt;&lt;b class='xb1'&gt;&lt;/b&gt;&lt;/b&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Show/hide line numbers&quot; [3934-] --&gt;</description>
        <category>linux</category>
            <pubDate>Sat, 19 May 2007 22:50:12 +0300</pubDate>
        </item>
        <item>
            <title>VMware</title>
            <link>https://gluek.info/wiki/linux/vmware</link>
            <description></description>
        <category>linux</category>
            <pubDate>Fri, 04 Aug 2023 02:32:40 +0300</pubDate>
        </item>
    </channel>
</rss>
