Linux

Installing CentOS

Posted on

Установка CentOS LVM не используем По умолчанию на небольшой диск (< 2TB) Linux пытается установить MBR. Чтобы выбрать EUFI (GPT) либо выбираем ее как основной способ загрузки в BIOS, либо выбираем в качестве первого загрузочного устройства USB-флэшку, с которой проводим инсталляцию, тогда программа установки сама переключится на EUFI. Если используется EUFI, дополнительно к стандартным разделам […]

Linux

Unix monitoring and audit

Posted on

https://cisofy.com/lynis/ Lynis is an open source security auditing tool. Used by system administrators, security professionals, and auditors, to evaluate the security defenses of their Linux and Unix-based systems. It runs on the host itself, so it performs more extensive security scans than vulnerability scanners. It is also the client in our Lynis Enterprise offering. https://www.tecmint.com/linux-server-health-monitoring-script/  

Linux

Linux multihome host with rule based routing

Posted on

http://jensd.be/468/linux/two-network-cards-rp_filter rp_filter Since RHEL 6 (and CentOS 6), asymmetric routing doesn’t work anymore out of the box. The cause of the issue is a change in the default value for kernel parameter rp_filter. Rp_filter stands for reverse path filtering. The reverse path filter will check if the source of a packet that was received on a certain interface […]

Linux

Working with local sendmail queue

Posted on

https://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html Under Postfix MTA, just enter the following command to flush the mail queue: # postfix flush OR # postfix -f To see mail queue, enter: # mailq OR #  sendmail -bp To remove all mail from the queue, enter: # postsuper -d ALL To remove all mails in the deferred queue, enter: # postsuper […]

Linux

InitV and systemd parctical notes

Posted on

Nicely written reference https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Unit_Files.html Short cheat shit List services: # chkconfig –list # systemctl list-units This will show any unit that systemd loaded or attempted to load, regardless of its current state on the system. # systemctl list-units –all # systemctl list-units –all –state=inactive # systemctl list-units –type=service Since systemd will only read units that it […]

Linux

Sudoers syntax

Posted on

http://unix.stackexchange.com/questions/18877/what-is-the-proper-sudoers-syntax-to-add-a-user In the following sudo entry: superadm ALL=(ALL) ALL there are four fields: The first one specifies a user that will be granted privileges for some command(s). The second one is rarely used. It’s a list of hostnames on which this sudo entry will be effective. On standard setups only one host is relevant (localhost) […]

Linux

vmstat output explained

Posted on

Table 11-4 Output From the vmstat Command Category Field Name Description procs Reports on the following: r The number of kernel threads in the dispatch queue b The number of blocked kernel threads that are waiting for resources w The number of swapped out LWPs that are waiting for processing resources to finish memory Reports on usage of […]

Linux

Parallel and xargs commands

Posted on

1. Decypher gpg files find ./ -name “*.gpg” |  while read OUT; do echo ${OUT%.*}; done | /usr/local/bin/parallel -P 15 gpg –output {}  –decrypt {}.gpg 2. Unzip files find ./ -name “*.gz” |  /usr/local/bin/parallel -P 15 gunzip {} \; unzip into different directory: find ./ -name “*.gz” | while read OUT; do echo ${OUT%.*}; done […]

FreeBSD

Static routing

Posted on

Solaris: route add host 192.168.1.12 192.168.1.1 Solaris, route persistent between reboots: route -p add host 192.168.1.12 192.168.1.1 Linux RedHat: route add -host 192.168.1.12 gw 192.168.1.1 Linux persistent routes: /etc/sysconfig/network-scripts/route-XXX where XXX – name of interface http://www.softpanorama.org/Net/Netutils/route.shtml Q1. Which command manipulates the routing table ? A: route  Q2: Command to add a route to server1 via router1: […]

FreeBSD

NTP client troubleshooting

Posted on

http://support.f5.com/kb/en-us/solutions/public/10000/200/sol10240.html   Observe the output with references on the fields presented in the previous table. Example of a successful NTP peer server query If the local ntpd process can communicate or attempts to communicate with a declared NTP peer server, the output from the ntpq command appears similar to the following example: # ntpq -np remote           […]