Author Archives: ronaldpringadi

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’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 | Leave a comment

Browsing without ads on mobile browsers

This post used to recommend a now-defunct Android app called “Ad Block” that turned your phone into its own proxy server. The app is gone, the Play Store link is dead, and the proxy-based approach has been superseded several times … Continue reading

Posted in Android | Leave a comment

Benchmark How Long a Program Runs In Linux Using Bash

The following bash code might come in handy if you want to benchmark how long a program runs. The example assumes you want to pass two parameters along to the program. A timestamp is captured at the start and end … Continue reading

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