Linux

Linux is a family of open-source Unix-like operating systems based on the Linux kernel. Some of the most popular Linux distributions include Debian, Fedora, and Ubuntu.

www.linux.org

Exim log files and exigrep

/var/log/exim_mainlog – logs every email that is processed by Exim/var/log/exim_rejectlog information about all rejected emails/var/log/exim_paniclog error related to Exim itself Exim has it’s own version of grep: exigrep...

Top 10 du commands in Linux

Here are my top 10 du commands with examples: Disk usage for all files in dir This is the most basic usage of the du command: du /path/to/folder Human Readable format By default du command prints size in Disk Blocks, to use human-readable format...

Different Ways to Check MySQL version in cPanel or Linux

By far MySQL is the most popular Relational database management system and knowing which MySQL version you are running can be important in some situations. Here are different ways to check the version of the MySQL server installed on your WHM/...

PHP handlers Compared

In plain English: PHP handlers are Apache modules that interpret and run PHP code. Using right PHP handler on your website can have a huge impact on the overall performance. In cPanel you can have different PHP versions with different handlers for...

Copyright David Farrell 2014

wget not working on Linux 😲

wget not working? Add user/agent, for example: Mozilla/5.0 wget -U Mozilla/5.0 or wget -U mozilla By default wget uses an uncommon user-agent Wget/VERSION, which due to various security policies some servers are blocking. To solve this, specify the...

How to rename an existing screen session in Linux?

To create a named session use: screen -S testsession to list all session: # screen -ls There is a screen on: 19415.something (Detached) 1 Socket in /var/run/screen/S-root. to rename an active session use -X sessionname screen -S 19415.something -X...

du and df show different sizes

ncdu / du and df show different sizes: du is reading information from the directory tree, it is more accurate than df but slower.df reads meta data of the file system therefore it is faster, but not that accurate because it works with blocks...

Display the last modified file in directory in cPanel ☑️

From the terminal (SSH): grep -Ril "find /home/username/public_html/ -type f -mtime -2" From a .php file: <?php $last=shell_exec('grep -Ril "find /home/username/public_html/ -type f -mtime -2"'); echo "<pre>$last</pre>"; ?> The output will...

Set default Timezone via htaccess in cPanel

Here in how to change the default Time Zone permanently in cPanel using the .htaccess file Step 1. First, check you current time yone settings using a simple .php script like this: <?php echo "Today is " . date("Y/m/d") . "<br>"; echo "The...