Archive for alifer

Latest Wireshark from Source on Debian

Установим все зависимости wireshark:
$ sudo apt-get build-dep wireshark

Установим некоторые нужные пакеты:
$ sudo apt-get install build-essential checkinstall libcurl4-openssl-dev

Распакуем архив:
$ tar xjf wireshark-*.tar.bz2

Конфигурация и установка:
$ cd wireshark-*
$ ./configure --with-ssl --enable-setcap-install --with-dumpcap-group=wireshark
$ make -j4
$ sudo checkinstall --fstrans=no
$ sudo ldconfig

Запуск без root:
$ sudo groupadd wireshark
$ sudo usermod -a -G wireshark your-user-name
$ sudo chgrp wireshark /usr/local/bin/dumpcap
$ sudo chmod 4750 /usr/local/bin/dumpcap

(https://scottlinux.com/2013/06/07/how-to-install-the-latest-wireshark-from-source-on-debian-or-ubuntu-linux/)

Информация об установленных пакетах с помощью YUM

yum list installed
yum info installed

Как отключить IPv6 в RHEL6 / CentOS 6 / etc

Правильный способ отключения IPv6 в RedHat Linux 6 / CentOS 6

/etc/sysctl.conf : net.ipv6.conf.all.disable_ipv6 = 1

/etc/sysconfig/network : NETWORKING_IPV6=no

/etc/sysconfig/network-scripts/ifcfg-eth0 : IPV6INIT=”no”

disable ip6tables – chkconfig –level 345 ip6tables off

reboot

(http://blog.acsystem.sk/linux/rhel-6-centos-6-disabling-ipv6-in-system)

Cisco ASA show VPN and SSH users

VPN:

IPSec Remote VPN Clients
sh vpn-sessiondb remote
L2L Tunnels
sh vpn-sessiondb l2l
SSL VPN / Anyconnect Clients
sh vpn-sessiondb svc

SSH:

show users connected to ASA via SSH
sh ssh sessions

(http://www.dslreports.com/forum/r22984757-Cisco-ASA-show-VPN-and-SSH-users)

Команда show interface в Cisco IOS.

http://blogthefirst.ru/chto-nam-rasskazhet-cisco-fastethernet-interface-status/#.UoMf_sOmWuA

Serial port to network proxy.

http://ser2net.sourceforge.net/

ser2net предоставляет возможность подключения из локальной сети к последовательному порту.

Пример из конфигурационного файла ser2net.conf

...
2100:telnet:600:/dev/cuau0:9600 NONE 1STOPBIT 8DATABITS -XONXOFF LOCAL -RTSCTS
2200:telnet:600:/dev/cuau2:9600 NONE 1STOPBIT 8DATABITS -XONXOFF LOCAL -RTSCTS
2300:telnet:600:/dev/cuau3:9600 NONE 1STOPBIT 8DATABITS -XONXOFF LOCAL -RTSCTS
2400:telnet:600:/dev/cuau4:9600 NONE 1STOPBIT 8DATABITS -XONXOFF LOCAL -RTSCTS
2500:telnet:600:/dev/cuau5:9600 NONE 1STOPBIT 8DATABITS -XONXOFF LOCAL -RTSCTS
...

Бэкап конфигурации Cisco с помощью kron.

Switch> enable
Switch# configure terminal
Switch# kron policy-list backup
Switch(config-kron-policy)# cli copy startup-config ftp://x.x.x.x
Switch(config-kron-policy)# exit
Switch(config)# ip ftp username cisco
Switch(config)# ip ftp password cisco
Switch(config)# file prompt quiet
Switch(config)# kron occurrence backup at 2:50 recurring
Switch(config)# exit
Switch# wr

Для просмотра текущих заданий kron:
show kron schedule

(http://subnets.ru/blog/?p=529)

Обновление Adobe flash plugin в Debian GNU\Linux.

sudo /usr/sbin/update-flashplugin-nonfree --install --verbose

Сброс пароля root в MySQL

1). Останавливаем службу MySQL:
/etc/init.d/mysql stop
Stopping MySQL database server: mysqld.

2). Запускаем службу с опцией —skip-grant-tables
mysqld_safe --skip-grant-tables &

3). Подключаемся с серверу MySQL при помощи клиента mysql:
mysql -u root
...
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

4). Вводим новый пароль для root:
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

5). Останавливаем сервер MySQL:
/etc/init.d/mysql stop
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+ Done mysqld_safe --skip-grant-table

6). Запускаем MySQL-сервер и логинимся с новым паролем:
/etc/init.d/mysql start
mysql -u root -p

(http://www.youisbee.ru/howto/mysql/66-ustanovka-izmenenie-i-sbros-parolya-root-v-mysql.html)

Convert Squid unixtime logs in human-readable ones

perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e' < /var/log/squid/access.log

cat access.log | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'