How To Run a Previously Entered Command in Linux

Let’s say you’ve issued a long command and don’t want to type it again. I think you know that all linux commands entered could be shown by issuing history command. History outputs an ordered list of commands that were executed before by current user. In order to find the command you want, you should enter the following: history… Read More »

How To Deny Directory Listing Using .htaccess

Often when you’re using shared hosting, there are some problems with directory listing. Server administrators should avoid this as this represents a security hole. But what to do if you don’t have access to httpd conf and need to prevent directory listing? What to do if you have something like this: A simple string in .htaccess file will… Read More »

How To Install Zend Optimizer on Any Linux Server

Recently I’ve seen many solutions on how to install Zend Optimizer using custom build script in Directadmin. I’d like to show you how to install it on almost any linux server using usual linux commands. First of all, let’s download it from Zend server (they require to register in order to obtain this link. wget http://downloads.zend.com/optimizer/3.2.8/ZendOptimizer-3.2.8-linux-glibc21-i386.tar.gz Then we’ll… Read More »

Easiest Way To Sort Strings From a File By Alphabet with PHP

Today I won’t write many letters, I’ll show a simple code that allows to sort file contents by alphabet. <? // Getting file into array $stroki=file(“unsorted.txt”); //Sorting it without keys – we don’t need them sort($stroki); // Writing sorted strings to a new file $fs=fopen(“./sorted.txt”, “a”); foreach ($stroki as $string) { fwrite($fs, trim($string).”rn”); } fclose ($fs); echo “Completed”;… Read More »