CentOS 7 Firewall Sheet

The best thing about CentOS 7 is, it has a super easy firewall built-in. I recommend you not to disable the firewall. To check the active zones: [root@rh7 ~]# firewall-cmd –get-active-zones public interfaces: enp1s0f0 To get available service names: [root@rh7 ~]# firewall-cmd –get-services RH-Satellite-6 amanda-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns ftp high-availability http https imaps […]

Read More

Converting your server from virtual to physical server

Are you looking something like converting your server from virtual server to physical server? This is a complete guide to achieve this. First, we should find the storage on our hypervisor to create an actual clone of our drive and switch the power state off. In my case, i need to find the disk id […]

Read More

Download Plugged.in LAMP installer for CentOS 6.x

Version Info: V0.2 21/06/2012 DO you ever wanted to set-up a testing server with – Apache virtual config, logs, paths setted, – MySQL server with password set, – FTP Server (Vsftpd), – PHP and PhpMyAdmin installed & configured on your server or VPS in seconds? If you answer “yes” to the question, you are in […]

Read More

PHP : Convert/Replace Short Open Tags

Using short open tags, such as <? on your PHP code is not so clever. Other than the debate going on whether short open tags won’t be available on PHP6 or not, it is possible that your shared hosting has disabled it for some reason, or you might have to migrate your code sometime somewhere […]

Read More

File Transfer From Windows to Linux via rdesktop

rdesktop is the essential tool for Remote Desktop Management of Windows boxes using Linux as your local machine. It is sometimes crucial to be able to transfer files using rdesktop, especially when there isn’t any FTP service (or equivalent). Luckily rdesktop supports file transfer modes. Before connecting you the Windows box, let’s make a directory […]

Read More

Password Generation in UNIX

Below I’ll describe a couple of nice methods to generate passwords using Python and Bash. Actually there are a lot of ways you can accomplish this especially with bash, but using the /dev/urandom file seems to be the most clever one. The /dev/urandom device doesn’t only generate read-friendly characters, so it’s best to filter out […]

Read More

How to Export the Private Key From a .PFX With OpenSSL

If you have a .pfx file and you need it’s private.key, then you can use OpenSSL for extracting .pem from .pfx ( the openssl software is available at openssl.org ) To export the private key ( .pem ) from the PFX file and save it to a PEM file : $openssl pkcs12 -in /path/to/file_name.pfx -nocerts […]

Read More

(Zimbra Mail Server) Unable to determine enabled services from LDAP

[zimbra@ck]$ zmcontrol start Host mail.plugged.in Starting ldap…Done. Unable to determine enabled services from ldap. Enabled services read from cache. Service list may be inaccurate. Starting logger…Failed. Starting logswatch…ERROR: service.FAILURE (system failure: ZimbraLdapContext) (cause: javax.net.ssl.SSLHandshakeException sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) zimbra logger service is not enabled! […]

Read More

How to grep Compressed Files?

Sometimes you need to search the contents of .gz files in your system. Unfortunately, grep doesn’t work on compressed files. To overcome this, people usually advise to first  uncompress the file(s), and then grep your text, after that finally re-compress your file(s)… You don’t need to uncompress them in the first place. You can use […]

Read More

How to clear contents of a file ?

If you want to clear contents of a file in unix, you could just delete the file and recreate it. But there are much more simple alternatives. You can use echo method. To empty a file just enter the command below. I use my php_error.log file for example. echo -n > /home/base/logs/php_error.log That’s it. Your […]

Read More

Find the Largest Files

The other day I was working on a server and needed the LARGEST files on some directory – including its subdirectories. As it turns out, it’s a very simple task limiting the file size you want with the output of the find tool. The -size argument will define the borders of your output. Let’s say […]

Read More

Adding Job to Crontab Using BASH

Adding a task into crontab is relatively easy. You just enter the crontab with “$ crontab -e” and add the necessary job, save and exit. But adding a job in your bash script is not that simple, because what you have to do is, to get the entire list of the jobs, append your new […]

Read More

Setting up roundcube to webmail.domain.com as default for domains in DirectAdmin

You need to setup the virtualhost for apache2. [root@ck]# cd /usr/local/directadmin/data/templates [root@ck]# cp virtual_host2.conf custom [root@ck]# cd custom   Now you can edit the new virtual_host2.conf (apache 2) file in custom folder and just add the codes to the end. Related Posts Directadmin : Problem Receiving Emails – The “Unknown User” Issue Web Hosting Security […]

Read More

Rescuing system with Linux Rescue

You are reading this article, most probably you faced trouble booting your Linux. Follow the steps below to fully chroot into your system as you booted regularly. Please note that we offer you to take a disk clone before doing anything in your boot configuration. To do so, you can use dd or dd_rescue to […]

Read More

Serial Console Redirection in pfsense

If you want to show console output from a Serial device such as RS-232 interface, you need to make minor modifications in pfsense 2.0 distro. Switch to shell by pressing 8 from the pfsense console menu and edit the file /boot/loader.conf by typing: vi /boot/loader.conf Add the below lines to the file after pressin “i” […]

Read More

Using vi Editor

Vi is the one of the mostly used editor in Linux via terminal. In most cases where Linux is used as a server operating system, admins use the terminal, where GUI uses more system resources & network bandwidth. Since Vi is used from the terminal, the lack of GUI force the user to learn function […]

Read More

How to update Linux with Yum

Updating RedHat & CentOS with Yum If you are using RedHat & its clones like CentOS or CloudLinux etc. you can use Yum or up2date to upgrade your current system. Please note that is you have a RedHat Enterprise Linux Subscription we offer you to use the command up2date, to upgrade your server with yum […]

Read More

Determine folder size with “du” including sub folders

You can use du command to see the folder size in LINUX including subfolders.: With du du -h # including subfolders (-h means human readable format in MB, GB or TB) If you want to exclude subfolders, type: du -h –max-depth=1   If you want to know a specific folders size (easy to remember) type: […]

Read More

Disabling IPv6 in Linux

In default LINUX installation IPv6 is enabled. IPv6 might use system resources or for what ever reason you have Run this command as root: echo “alias net-pf-10 off” >> /etc/modprobe.conf echo “alias ipv6 off” >> /etc/modprobe.conf You need to restart your server after this command. Related Posts Cisco Router IPv6 Configuration

Read More

Linux version & Operating System info

LINUX Version Info To learn the architecture and kernel version info use the shell command below: less /etc/redhat-release The output will be like CentOS release 5.6 (Final) To learn the architecture & kernel version: uname -a you can use the command above, the last numbers marked as red below is your architecture: Linux xxx.veriportal.com 2.6.18-164.9.1.el5 […]

Read More