Rsync full system backup Kategoria: Linux | Tagi: Rsync | Autor: Bartłomiej Gałęzia

# rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder

https://wiki.archlinux.org/index.php/full_system_backup_with_rsync

Rsync backup na innym porcie niż 22 Kategoria: Linux | Autor: Bartłomiej Gałęzia

rsync -rtv -e 'ssh -p 12345' --progress user@host:/home/user /home/user

Codeigniter 3.1 - puste załączniki w Email Kategoria: Codeigniter | Autor: Bartłomiej Gałęzia

W wersji CI 3.1 e-mail wysłany z załącznikiem jest błędnie kodowany i dociera do adresata z pustym załącznikiem mimo, że wiadomość zajmuje tyle miejsca jakby zawierała załącznik.

WARNING! This attachment is suspicious because its type doesn't match the type declared in the message. If you do not trust the sender, you shouldn't open it in the browser because it may contain malicious contents.

Expected: application/pdf (.pdf); found: application/x-empty

Zobacz całość

Cockpit Monitor Kategoria: Linux | Tagi: monitoring, performance, linux | Autor: Franciszek Musiel

http://www.tecmint.com/cockpit-monitor-multiple-linux-servers-via-web-browser/

"Cockpit is an easy-to-use, lightweight and simple yet powerful remote manager for GNU/Linux servers, it’s an interactive server administration user interface that offers a live Linux session via a web browser.

It can run on several Linux distributions including Debian, Ubuntu, Fedora, CentOS, RHEL, Arch Linux among others.

Cockpit makes Linux discoverable thereby enabling system administrators to easily and reliably carry out tasks such as starting containers, managing storage, network configurations, log inspections coupled with several others."

CENTOS

yum install cockpit sos -y
systemctl enable --now cockpit.socket
firewall-cmd --add-service=cockpit
firewall-cmd --add-service=cockpit --permanent

REDHAT

subscription-manager repos --enable rhel-7-server-extras-rpms
yum install cockpit sos -y
systemctl enable --now cockpit.socket
firewall-cmd --add-service=cockpit
firewall-cmd --add-service=cockpit --permanent

https://server.domain.com:9090

Autologowanie SSH - wymiana kluczy Kategoria: Linux | Autor: Bartłomiej Gałęzia

ssh-autologin
mv ssh-autologin /bin/ssh-autologin
chmod +x /bin/ssh-autologin
ssh-autologin -l login -g host

Zobacz całość

QRadar SIEM - recovery admin password Kategoria: Linux | Tagi: PASSWORD, QRADAR, SIEM | Autor: Franciszek Musiel

To recover the Admin password (eg. the password for the web interface) on a v7.7.2.x Siem installation, you can use the command:

# /opt/qradar/support/changePasswd.sh -a

# /etc/init.d/tomcat restart

 

ex: 0602-108 screen is not a recognized terminal type. 

# export TERM=xterm
# vi file.conf

How to remove array from MDADM Raid Kategoria: Linux | Autor: Bartłomiej Gałęzia

https://ubuntuforums.org/showthread.php?t=884556

sudo fdisk -l
sudo mdadm --detail /dev/md0
sudo umount /dev/md0
sudo mdadm --stop /dev/md0
sudo mdadm --zero-superblock /dev/sdax
sudo mdadm --zero-superblock /dev/sdbx

Firewalld NFS rule Kategoria: Linux | Tagi: firewalld, linux | Autor: Franciszek Musiel

### NFS

firewall-cmd --permanent --add-service=nfs

firewall-cmd --permanent --add-service=mountd

firewall-cmd --permanent --add-service=rpc-bind

firewall-cmd --reload

CentOS7 Installing nmon on Linux Kategoria: Linux | Tagi: monitoring, NMON, stats, linux | Autor: Franciszek Musiel

http://www.cyberciti.biz/faq/nmon-performance-analyzer-linux-server-tool/

 

# Get Root
sudo su

# Download NMON archive
cd /tmp
wget http://nmon.sourceforge.net/docs/MPG_nmon_for_Linux_14a_binaries.zip

# Install unzip if you don't have
yum install unzip

# Unzip archive
unzip MPG_nmon_for_Linux_14a_binaries.zip

# Copy nmon file
cp nmon_x86_64_centos5 /usr/local/bin/
chmod a+x /usr/local/bin/nmon_x86_64_centos5

# Create symbolic link
ln -s /usr/local/bin/nmon_x86_64_centos5 /usr/local/bin/nmon

# vim ~/.bashrc
   alias nmon='. ~/.bashrc'

# . ~/.bashrc

AIX TSM6 restart scheduler Kategoria: AIX | Tagi: DSMCAD, TSM, TSM SCHED, AIX | Autor: Franciszek Musiel

https://www.ibm.com/support/knowledgecenter/SSTG2D_6.3.0/com.ibm.itsm.tshoot.doc/r_pdg_strtstopcli.html

#!/bin/ksh

# Use the following script to kill the currently running instance
# of the TSM scheduler, and restart the scheduler in nohup mode.
#
# This script will not work properly if more than one scheduler
# process is running.
# If necessary, the following variables can be customized to allow an
# alternate options file to be used.
# export DSM_DIR=
# export DSM_CONFIG=
# export PATH=$PATH:$DSM_DIR
# Extract the PID for the running TSM Scheduler

PID=$(ps -ef | grep "dsmc sched" | grep -v "grep" | awk {'print $2'});
print "Original TSM scheduler process using PID=$PID"

# Kill the scheduler
kill -9 $PID

# Restart the scheduler with nohup, redirecting all output to NULL
# Output will still be logged in the dsmsched.log
nohup dsmc sched 2>&1 > /dev/null &

# Extract the PID for the running TSM Scheduler
PID=$(ps -ef | grep "dsmc sched" | grep -v "grep" | awk {'print $2'});
print "New TSM scheduler process using PID=$PID"

NTP Linux Windows Kategoria: Linux | Autor: Bartłomiej Gałęzia

Wine - całkowite odinstalowanie i wyczyszczenie Kategoria: Linux | Tagi: linux, ubuntu, Wine | Autor: Franciszek Musiel

Całkowite usunięcie i wyczyszczenie systemu po  WINE


sudo apt-get remove wine rm -rf $HOME/.wine
rm -f $HOME/.config/menus/applications-merged/wine*
rm -rf $HOME/.local/share/applications/wine
rm -f $HOME/.local/share/desktop-directories/wine*
rm -f $HOME/.local/share/icons/????_*.xpm
sudo apt-get remove –purge wine
sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
pdbedit -v username

Zobacz całość

Nagios add check_snmp command Kategoria: Linux | Tagi: nagios, snmp | Autor: Bartłomiej Gałęzia

http://www.linuxquestions.org/questions/linux-networking-3/using-nagios-check_snmp-plugin-to-get-snmp-info-from-computer-751057/

vim /etc/nagios3/commands.cfg
define command{
        command_name    check_snmp
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C public -o $ARG1$
        }
vim /etc/nagios3/objects/hostname.cfg
define service{
        use                             generic-service
        host_name                       laptop
        service_description             Admin email
        check_command                   check_snmp!.1.3.6.1.2.1.1.4.0
        }

How to check snmp available commands Kategoria: Linux | Tagi: nagios, snmp | Autor: Bartłomiej Gałęzia

Z wiersza poleceń:

snmpwalk -v1 -c public 192.168.1.1

http://cuddletech.com/articles/snmp/node13.html

Kody pocztowe Polska Kategoria: WWW | Autor: Bartłomiej Gałęzia

Baza polskich kodów pocztowych:

https://www.poczta-polska.pl/hermes/uploads/2013/11/spispna.pdf

http://kody.poczta-polska.pl/ - wyszukiwarka

https://www.bphtfi.pl/baza-kodow-pocztowych/ - lista w xls (link nieaktywny)

Lista w xls PLIK

Nagios nie chce wywoływać zdalnych poleceń przez nrpe:

define service{
          use                 generic-service
          host_name           komputer
          service_description Free Space /dev/sda1
          check_command       check_nrpe!check_sda1
          }

przez stronę pojawia się tylko komunikat

(No output returned from plugin)

Zobacz całość

http://askubuntu.com/questions/471847/brightness-fn-key-shortcut-doesnt-work-on-asus-laptop

sudo gedit /etc/default/grub

change

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="
sudo update-grub