Author Archives: ronaldpringadi

Remote copy using scp

Do you ever need to copy one file from one server to another? If you have ssh access to the remote server then you can do an scp command like so: 1$ scp remoteUsername@remoteServername:remoteFile localFile

Posted in Linux, Operating System | Tagged | Leave a comment

Delete files older than X number of days in Linux

Say you backup your database daily and you need to delete the old backup files. You can issue the command bellow which will erase any files within the specified directory that are older than 7 days. 1$ find /your/target/directory* -mtime … Continue reading

Posted in Bash, Linux, Operating System | Leave a comment

DSQUERY

dsquery * “CN=Users,DC=myadserver,DC=com” -scope onelevel -attr objectguid proxyaddresses -limit 2000 >C:\myadserver.user.list.txt

Posted in LDAP and Active Directory | Leave a comment

Calling a mysql query from linux or dos command line

There are times when you want to call a mysql command from the bash or dos script then call this script in a scheduler (cron job). The example below will show you how to do so. 1mysql -uYOURUSERNAME -pYOURPASSWORD -DYOURDATABASE … Continue reading

Posted in Database, Linux, MySQL | Leave a comment

Remove all svn directory

Subversion (SVN) sometimes clutter our source directory by creating .svn folder in each folder or sub folder that we version control. The easiest way to erase them is by using a bash command: 1find . -name ".svn" -type d -exec … Continue reading

Posted in Linux, Version Control | Leave a comment

Adding New VirtualHost in Apache2

On linux Ubuntu 1. If your apache has /etc/apache2/sites-available directory then just create a new file “dev.newwebsite.com.conf” with the following content: 12345678910111213<VirtualHost *:80>     ServerName dev.newwebsite.com     DocumentRoot "/var/www/www.newwebsite.com"     # Error handlers     ErrorDocument 500 … Continue reading

Posted in Operating System, php, Ubuntu | Leave a comment

Memcache test connection script

12345678910111213<?php error_reporting(E_ALL); $memcache = new Memcache; // Connect to memcached server $memcache->connect(’127.0.0.1′, 11211) or die ("Could not connect"); // Add it to memcached server // The parameters are: KEY, VALUE, USE COMPRESSION, EXPIRY IN SECONDS $memcache->set(’MyKey1′, ‘The value of My … Continue reading

Posted in php, Web Development | Leave a comment

Redis connection test script

1234567891011121314151617181920212223242526<?php require "../predis/autoload.php";  // Update with your location to predis Predis\Autoloader::register(); try {     $redis = new Predis\Client();     // Uncomment the following lines and adjust them accordingly if you have a non-default redis configuration /*     … Continue reading

Posted in php, Web Development | Leave a comment

Learning Ontario G1 Test through IOS App

Several colleagues of mine produced an app for iPhones and iPad to help people study Ontario G1 driver license test. This app can potentially boost your study in a very cost effective way at $1.99. Take a peak of the … Continue reading

Posted in Uncategorized | Leave a comment

SVN Tricks in Linux

To show colorized svn diff 1sudo aptitude install colordiff Then on your home directory there is a hidden file called .bashrc. Edit it. 1vim ~/.bashrc Append the following code at the end of the file 1234svndiff() {   svn diff … Continue reading

Posted in Linux, Operating System, Version Control | Leave a comment