Tag: How-To

How to move MySQL datadir to another drive

Is your MySQL database consuming a significant amount of space, and your current drive is running out of storage? Moving your MySQL database to another drive can be a viable solution, minimizing downtime while potentially boosting MySQL performance, particularly on high-speed drives like Raptor or SCSI. In this guide, we’ll walk you through the process. I’m assuming: – the second…

Read More »

How to disable Drupal comment block timestamp?

Drupal is a free software package that allows an individual or a community of users to easily publish, manage and organize a wide variety of content on a website. Official website: http://drupal.org We will disable the comment block timestamp, something like this: # Lorem ipsum… 1 weeks 1 day ago # Lorem ipsum… 1 day ago After hack: # Lorem…

Read More »

How to block blank referrer in PHProxy?

PHProxy is a webproxy written in PHP to bypass firewalls and other proxy restrictions through a web interface very similar to the popular CGIProxy. The server that this script runs on simply acts as a medium that retrives resources for you. The only IP address shown will be the server’s IP address so basically it is indirect browsing. The only…

Read More »

How to automate FTP-ing file to another FTP account?

We will be using shell script to automate the transfer between two FTP accounts. You’ll need shell access to the source FTP account. #!/bin/bash directory=”/home/raisya/public_html” filename=”test.txt” hostname=”ftp.destination.com” username=”dest” password=”qwerty” logfile=”ftpf.log” ftp -uni $hostname <>$logfile quote USER $username quote PASS $password lcd $directory put $filename quit EOF Explanation: directory=”/home/raisya/public_html” Assigning “/home/raisya/public_html” to directory. filename=”test.txt” Assigning “test.txt” to filename. hostname=”ftp.destination.com” Assigning “ftp.destination.com”…

Read More »

How to grab BCA USD buy/sell rate with cURL?

This will grab current rate of USD rate from BCA using cURL. function delAttr($tagSource) { $stripAttrib = “‘ (style|class)=\”(.*?)\”‘i”; $tagSource = stripslashes($tagSource); $tagSource = preg_replace($stripAttrib, ”, $tagSource); return $tagSource; } function delTags($source) { $allowedTags=”; $source = strip_tags($source, $allowedTags); return preg_replace(‘/<(.*?)>/ie’, “‘<‘.delAttr(‘\\1′).’>'”, $source); } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, “http://www.klikbca.com/individual/silver/ind/rates.html”); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,…

Read More »

How to create a jump to link

Jump link is used for jumping between part of a page. Wonder how to create a jump link? Ie: jump from the top of the page to the bottom? This will comes handy if you have a very long page. Or jump to top from the bottom of a page? Jump link consist two “HTML a” tags, the link &…

Read More »