Reset root password on CentOS 7
Posted by blackonsole on April 8th, 2018 02:37 PM | No Comment
Edit boot menu on-the-go
0. reboot the CentOS 7 and press ESC when GRUB menu show up on the screen and press "e"
1. find "ro" on "linux16" section and then change to "rw init=/sysroot/bin/sh"
2. press "CTRL + x" to reboot CentOS ...
Free ext4 reserved blocks with tune2fs
Posted by blackonsole on February 18th, 2017 04:35 AM | No Comment
Check disk usage
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 95G 82G 7.9G 92% /
Check size of Reserved block count
tune2fs -l /dev/vda1 | ...
Send Xymon/Hobbit Alerts to Slack Channel
Posted by blackonsole on October 8th, 2016 01:00 PM | No Comment
How to sent xymon/hobbit alerts to slack channel
0. create bash script to push xymon/hobbit alerts to slack
vim /etc/xymon/scripts/alert_to_slack.sh
#!/bin/bash
hostname=$BBHOSTNAME
level=$BBCOLORLEVEL
msg=$BBALPHAMSG
title="$BBHOSTSVC $level"
url="https://hooks.slack.com/services/XXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXX"
channel="#${RCPT}"
assigned="@channel"
if ]; then
emoji=":rage:"
color="danger"
status="Critical!"
elif ]; then
emoji=":sunny:"
color="warning"
status="Warning!"
elif ]; then
emoji=":white_check_mark:"
...
KVM/Archipel enable ttyconsole on guest vm with virsh
Posted by blackonsole on June 13th, 2016 10:51 PM | No Comment
Debian Jessie Guest VM
+ Enable and start serial console
systemctl enable [email protected]
systemctl start [email protected]
+ Check status
systemctl list-units | grep getty@
you'll see like this:
[email protected] ...
Fix courier imapd.pem error PEM routines no start line
Posted by blackonsole on April 26th, 2016 10:39 AM | No Comment
Error courier imapd.pem file
tailf /var/log/mail.log
imapd-ssl: couriertls: /etc/courier/imapd.pem: error:0906D06C:PEM routines:PEM_read_bio:no start line
How to fix
vim /etc/courier/imapd-ssl
Make sure dhparams.pem added on the file
##NAME: TLS_DHPARAMS:0
#
# TLS_DHPARAMS - DH parameter file.
#
TLS_DHPARAMS=/etc/courier/dhparams.pem
Restart courier-imap-ssl
/etc/init.d/courier-imap-ssl restart
How to push AutoMysqlBackup files to Google Drive
Posted by blackonsole on February 9th, 2016 12:23 AM | 2 Comments
What is AutoMysqlBackup
AutoMySQLBackup with a basic configuration will create Daily, Weekly and Monthly backups of one or more of your MySQL databases from one or more of your MySQL servers.
How to install AutoMySQLBackup on Ubuntu
sudo apt-get install automysqlbackup
Tool backup file ...
How to add NAT iptables rules with CSF
Posted by blackonsole on January 9th, 2016 04:33 AM | No Comment
What is CSF
Config Server Firewall (or CSF) is a free and advanced firewall for most Linux distributions.
How to add NAT iptables rules with CSF Firewall
We can add custom NAT iptables rules in /etc/csf/csfpre.sh OR/AND /etc/csf/csfpost.sh
0. Create csfpre.sh or csfpost.sh
touch ...