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 | Comments Off on Introduction to Logging and Tracing in PHP

Robocopy – Automate Your Windows Copy

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

Posted in DOS, Operating System | Comments Off on Robocopy – Automate Your Windows Copy

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 | Comments Off on Displaying Linux Distro Version and Showing 32Bit or 64Bit OS

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 | Comments Off on Find and Replace File Content using Linux Command Line

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 | Comments Off on How To List All Users or Groups in Linux

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 | Comments Off on How Big is The Big Apple?

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 | Comments Off on Internet Explorer (IE) friendly table DOM manipulation

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 | Comments Off on Preventing Another Instance of A Program Running in Linux

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 | Comments Off on Extjs – Ext.apply

MySQL Backup and Restore – Using Command Line

Here’s how you back up a database from the command line. The first line is the backup, the second is the restore. These commands work on both Windows and Linux. On Windows you might want to add the MySQL bin … Continue reading

Posted in Database, Linux, MySQL | Comments Off on MySQL Backup and Restore – Using Command Line