18 July 2017

My Linux Filesystem / Home Folder Suddenly Becomes Read Only? Don't Panic !



Recently, I've found an odd error in my Linux machine : My home folder and my entire Linux system suddenly becomes read only! I tried to reboot my machine, and the system failed to boot. I was panic and ridiculously thought, that my Linux machine was being hacked.

I reinstalled my machine and the error gone, but later, the error showed up again. After googling around, I've finally known that I had some bad sectors in my harddisk. What I did to solve was just using this fsck command :
sudo fsck -a /dev/sda

Wait until the process done, and your Linux machine will be back to normal.

12 July 2017

Unsuspend Not Working in WHM Based Web Hosting [Solved]


I am currently a web admin with WHM and cPanel based web server. Recently I faced an odd error : the unsuspend function not working in WHM. I have tried to suspend and unsuspend again the account, but the result is zero.

Apparently, there is an unknown error in WHM scripts or something about it. What I have finally done to solve the problem is by executing these commands through SSH :

1. Check the suspend status :

/scripts/suspendacct username -cek-

You will get an output that the account is apparently still suspended.

2. Unsuspend the account :
/scripts/unsuspendacct username

18 May 2017

How To Check Your Server From DDoS, and How To Solve.

If you are a Linux server administrator, you might need to know how to check your server from DDoS attack. There is no clear explanation why some people do a DDoS attack. Maybe they just want to test your server. Whatever they are, you have to be technically prepared for this issue.

1. Check who are accessing your server right now
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

You will get output like this :






























2. The IP that is accessing your server most is the suspected one. Next, you should block the IP by executing this command :
route add suspected_ipaddress reject

12 May 2017

Linux Command dig Nor Working, How To Solve


Yesterday, I experienced a very odd error in my new installed Rosa Linux R9 : the dig command not working! Every time I tried to dig or dig ns a domain, there is no result.  I reconnected the internet connection, I rebooted the OS, but the result was still same.

I didn't know whether it is the distro issue or not, but I've finally found the solution. Here are the steps :

  1. Edit /etc/resolv.conf
    sudo vi /etc/resolv.conf
  2. Replace the default record with these records :
    nameserver 8.8.8.8
    nameserver 8.8.4.4
  3. Make the resolv.conf immune so the network-manager can't automatically replace it
    sudo chattr +i /etc/resolv.conf
  4. Done

06 May 2017

How To Solve Hipchat4 on Linux : "Make sure you have an internet connection and try again.."

I need to work with Hipchat and didn't have any problem running hipchat client on my Linux machines, since I move to Hipchat4 and installed it on my Debian 9 Stretch with Kernel 4.9. The Hipchat4 Linux Client is unable to connect to the internet and an error message appears "Make sure you have an internet connection and try again..". The internet is ok and everything is ok, so this is without doubt a bug in the Hipchat4 Linux client with newer Linux system. I didn't find this problem with my older Linux machine like Debian 8, Ubuntu 14.04 and older releases.

After wandering around the internet, I've finally found a solution and quite simple. Here are the steps :

1. Create a symbolic link to a library to the Hipchat4 library.
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 /opt/HipChat4/lib/libcrypto.so.1.0.2
sudo ln -s /opt/HipChat4/lib/libcrypto.so.1.0.2 /opt/HipChat4/lib/libcrypto.so

2. Relaunch the Hipchat4 Linux Client.

System I'm Using :

  • Hipchat4 Linux Client 4.0.1517
  • Debian 9 Strecth 
  • Kernel 4.9.0-2-amd64