Author Archives: ronaldpringadi

Introduction to Logging and Tracing in PHP

If you still tracing variable in php using print_r() or var_dump() then you’ll see them directly in the screen or the web page that you’re working on. This is easy to see, but also prone to problems: What if visitors … Continue reading

Posted in php, Web Development | Leave a comment

Robocopy – Automate Your Windows Copy

I backup my files regularly using the windows scheduler. For example several folders from my windows preferences folder in drive C (C:\Users\dellxps\AppData\Roaming) to another drive, to D:\Users\Ronald\AppData\Roaming. There is a built in smart copier in windows that is not known … Continue reading

Posted in DOS, Operating System | Leave a comment

Displaying Linux Distro Version and Showing 32Bit or 64Bit OS

Checking whether you have 32bit linux or 64bit linux. From the code below we can see that it is a 64 bit linux. 12[user1@ubuntu 17:14:37 ~/dev]$ uname -mrs Linux 3.2.0-30-generic x86_64 Checking which distro you’re using: 123456[user1@ubuntu 17:14:48 ~/dev]$ lsb_release … Continue reading

Posted in Linux, Operating System | Leave a comment

Find and Replace File Content using Linux Command Line

1find . -name "*.pgsql" -print | xargs sed -i ‘s/STRINGTOREPLACE/REPLACERSTRING/g’

Posted in Linux, Operating System | Leave a comment

How To List All Users or Groups in Linux

To list all users in Linux: 1cat /etc/passwd See only the first word before double colon (:) for exampple, user “root” will look like: root:x:0:0:root:/root:/bin/bash And to list all groups do the following 1cat /etc/group

Posted in Linux, Operating System | Leave a comment

How Big is The Big Apple?

Do you know how much bigger is Apple compared to the other big companies in the US? http://www.greenandredmarket.com/menu/biggestcompanies.htm And scroll to the lower part of the page. I’m not an apple fan boy but I can see that our society … Continue reading

Posted in Investment, Stock Market | Leave a comment

Internet Explorer (IE) friendly table DOM manipulation

Occasionaly we can manipulate HTML DOM easily by accessing the innerHTML of an element. In IE however, the following elements’ innerHTML are read only: COL, COLGROUP, FRAMESET, HEAD, HTML, STYLE, TABLE, TBODY, TFOOT, THEAD, TITLE, TR. This code will fail … Continue reading

Posted in javascript, Web Development | Leave a comment

Preventing Another Instance of A Program Running in Linux

The code below is my solution for preventing a program from running more than once at the same time in Linux. The scenario: Consider if you have a cron job (jobA.sh) set to run at 6PM, 7PM, and 8PM. While … Continue reading

Posted in Linux, Operating System | Leave a comment

Extjs – Ext.apply

1234567891011121314151617181920console.clear(); var a = {     abc : 1,     def : 2 }; var b = {     abc : 1.1,     def : 2.2 }; var c = Ext.apply( a , b ); //Ext.apply … Continue reading

Posted in Ext Js, javascript, Web Development | Leave a comment

MySQL Backup and Restore – Using Command Line

Here is how you backup database using command line. The first line is to backup and the second line is to restore. These commands work on both Windows and Linux. In Windows you might want to setup mysql bin directory … Continue reading

Posted in Database, Linux, MySQL | Leave a comment