17
September

Tor Botnet – expect spectacular things !!

As they said in a blog post, Starting at the end of August, they started to see a sudden spike in the number of Tor clients:millions of new Tor clients and the numbers continue to rise. The right question / answer “Where do these new users come from? My current best answer is a botnet.” […]

16
September

Save Rosia Montana

I know this blog not covers that area but i want to protest as well  for clean waters, strong mountains, life and freedom. We cannot be here for long without nature’s support. The Romanian government has approved the century’s most controversial mining project – cyanide gold digging in Romania’s beautiful mountains that can consequently affect the […]

16
September

Kratos Anti Spam – Captcha alternative

Kratos Anti Spam is a Joomla plugin, built to stop bots from sending spam through all website forms (i.e.: contact forms, VirtueMart ask a question, comments, etc.) Kratos Anti Spam Features: STOP SPAM STOP HACKING Don’t require users to input captcha codes, or to answer questions Invisible to the user Block post resending/duplication One click […]

16
September

python practice

# Define a procedure, abba, that takes  two strings as its inputs, and returns a string that is the first input,  followed by two repetitions of the second input, followed by the first input. #Example #print abba(‘a’,’b’) #>>> ‘abba’ #print abba(‘soft’,’pill’) #>>> ‘softpillpillsoft’

23
July

PHP best practice

Low carb PHP: No spaghetti PHPDoc: comments are your friends Game on: Throwing, catching and handling errors Users are stupid: Parsing input and escaping output Start on the right track and clean up your own mess: Initialising and destroying variables correctly Guess the magic number: Using constants Programmers are stupid: Version control can save your life Code reuse? No thanks, I have plenty […]

23
July

How Good PHP code should be..

Structured -separate each Web page that conforms your application in the famous 3 layers of the Web: HTML, CSS and JavaScript, for content, presentation and behavior respectively. I have a short example of how do I manage that in my PHP application. index.php PHP Code: <?php include ‘lib/something_fns.php’; include ‘inc/some_file.inc’; // put in the array the css files that you want to use $css_files = array(‘reset-fonts-grids’, ‘default’); do_html_header(‘Title of your Web Page’, $css_files); do_page_header(); do_page_content(‘open’); display_some_content(); do_page_content(‘close’); […]

23
July

Create your own Custom Exceptions

Here’s a nice tip about creating your own custom Exceptions very easily by extending the standard Exception class: PHP Code: <?php class fileException extends Exception {} This is very handy when you want to do a bunch of stuff in one go and handle the exceptions centrally but not in exactly the same way. Suppose that you want to […]

23
July

Grab IP Address With a small php script

Introduction In this tutorial, I’ll be showing you how to grab someone’s IP address using PHP. Unlike most tutorials, I’ll be showing you what each part of the code means! The Simple Way This PHP code will simply print the visitor’s IP address onto the page. PHP Code: <?php print ($_SERVER[‘REMOTE_ADDR’]; //prints the IP on the page (Obviously) ?> Printing The Visitor’s IP […]

23
July

PHP HTML DOM Parser

The HTML DOM defines a standard way for accessing and manipulating HTML documents. What we are going to do is to read a document using PHP Simple HTML DOM Parser and then manipulate it according to our needs DOWNLOAD Download The script form here and extract it Now we need to create a PHP file to start using the […]

23
July

Most Frequently Used UNIX / Linux Commands (With Examples)

1. tar command examples Create a new tar archive. $ tar cvf archive_name.tar dirname/ Extract from an existing tar archive. $ tar xvf archive_name.tar View an existing tar archive. $ tar tvf archive_name.tar More tar examples: The Ultimate Tar Command Tutorial with 10 Practical Examples 2. grep command examples Search for a given string in a file (case in-sensitive search). […]