Facebook Messenger Desktop
Posted: 13 Jan 2016, 2:36am - Wednesday
1452673926_Facebook_Messenger
Just for fun I made a Facebook Messenger Desktop version. This can be used if you don't want to use the browser and would be ideal when you're at work. :) The application can minimize at the taskbar notification area which will be hidden away from your other opened applications. Disclaimer: This is not the official facebook messanger desktop version but this is just framing facebook web-based messenger. Download:
QVNZ Viewer (ASC file viewer)
Posted: 3 Aug 2015, 23:57pm - Monday
For everyone looking for ASC file viewer or QVNZ .asc file, if you are wondering what application can view the file, you can download and use the application I have created. This will view the contents of ASC file for QVNZ.

qvnz_ss

Update 4 August 2015: I improved the viewer, its QVNZ Editor now. So you can edit the Cell then Save or Save As.   QVNZ-Viewer.zip   |   QVNZ-Editor.zip or Download at: https://www.abcs.co.nz/download/qvnz/
My Server's 100 days
Posted: 16 Mar 2015, 7:45am - Monday
[root@server ~]# uptime
 20:43:38 up 100 days, 19:11,  2 users,  load average: 0.00, 0.01, 0.05
CentOS 7: Enable Apache UserDIR
Posted: 10 Dec 2014, 20:16pm - Wednesday
I was used the old ways for enabling Apache UserDir but this time in CentOS 7, its different. So I'm kinda outdated. Even on restarting services are different. So here it is... :) First enable usedir.conf of apache.
nano /etc/httpd/conf.d/userdir.conf
Change from:
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disabled
 
    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    UserDir public_html
 
</IfModule>
 
<Directory /home/*/public_html>
        Options Indexes Includes FollowSymLinks
         Require all granted
</Directory>
To:
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    #UserDir disabled
 
    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    UserDir public_html
 
</IfModule>
 
<Directory /home/*/public_html>
        Options Indexes Includes FollowSymLinks
         Require all granted
</Directory>
Then restart apache...
systemctl restart httpd.service
Then create user's public_html and its permissions (in my case, my user is prendstah):
mkdir /home/prendstah/public_html
chmod 711 /home/prendstah
chown prendstah:prendstah /home/prendstah/public_html
chmod 755 /home/prendstah/public_html
Then here's the other new things, especially you are using SELinux
setsebool -P httpd_enable_homedirs true
chcon -R -t httpd_sys_content_t /home/prendstah/public_html
That's it.. That should give you a user directory a public access.
HyperTerminal
Posted: 11 Nov 2014, 5:47am - Tuesday
I believed a lot of you out there is looking for HyperTerminal on Windows 7, 8 and other latest Windows version. My usage for this HyperTerminal software is configuring Cisco Network equipments. Feel free to download this HyperTerminal from Windows XP. ^_^

hypertrm2

Make sure you configure the application's compatibility first...

hypertrm1

Download HyperTerminal.zip

PHP Deployment Tool: Mage
Posted: 18 Aug 2014, 23:56pm - Monday
I've been using this php deployment tool called magallanes or mage php. It is pretty cool. For more details of this tool, visit http://magephp.com I did a fork because its not working well on windows. My Fork: https://github.com/camilord/Magallanes My fixes are issues on tarballing the the project and the rsync to the server. mage
HowTo: Fortune & Cowsay
Posted: 2 Apr 2014, 20:59pm - Wednesday

fortune_cowsay

While working, I envy the terminal of my workmate, Roland Heymanns, showing a cow with quotes. So I install my own too. OS: Kali Linux (Debian) How to install:
root@mojo:~# apt-get install -y fortune cowsay
Then add the commands to your PATH
root@mojo:~# cd ~
root@mojo:~# nano .profile
or
root@mojo:~# cd ~
root@mojo:~# nano .bash_profile
Add the following to the end of the file (be sure its the right path for fortune and cowsay):
PATH=$PATH:/usr/games
export PATH
Save and exit. Next edit your .bashrc
root@mojo:~# cd ~
root@mojo:~# nano .bashrc
Add the the following lines to the end of the file...
fortune | cowsay -d
or if you don't want to set the PATH, simply edit your .bashrc and at the end of the file, add this line:
/usr/games/fortune | /usr/games/cowsay -d
That's it... log off and log in again. Open your terminal, you'll have your cow greetings. In case you get an error like you cant locate fortune or fortune-mod or cowsay (most likely you will encounter this if you install your OS offline), update your source.list.
root@mojo: ~# nano /etc/apt/source.list
then replace the source with the following:
## Regular repositories
deb http://http.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
## Source repositories
deb-src http://http.kali.org/kali kali main non-free contrib
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
then do the update and upgrade...
apt-get clean
apt-get update
apt-get upgrade
I think that would solve the problem...
HowTo: iRedMail 0.8.6
Posted: 24 Feb 2014, 4:14am - Monday
This guide will cover the following:
  • Install iRedMail
  • Disable Greylisting
  • Enable Catch-All
  • Email Forwarder
Reference: HowToForge: iRedMail: Build A Full-Featured Mail Server On CentOS 6 With Postfix, Dovecot, PostgreSQL First of all, its better your server is a clean install. Download iRedmail at http://www.iredmail.org/download.html
tar -xvjf iRedMail-0.8.6.tar.bz2

cd iRedMail-0.8.6

bash iRedMail.sh
Just follow the wizard installation and after installation, do the following commands: (just some few fixes)
ln -s /etc/amavisd/amavisd.conf /etc/amavisd.conf

amavisd showkeys
Add the DKIM keys to your DNS and configure SPF too then you may test by casting the commands below; Refer to:
  1. http://code.google.com/p/iredmail/wiki/DNS_SPF
  2. http://code.google.com/p/iredmail/wiki/DNS_DKIM
amavisd testkeys
After reboot, we will now disable greylisting.
nano /etc/policyd/cluebringer.conf
Change from:
# Access Control module
[AccessControl]
enable=1

# Greylisting module
[Greylisting]
enable=1

# CheckHelo module
[CheckHelo]
enable=1

# CheckSPF module
[CheckSPF]
enable=1

# Quotas module
[Quotas]
enable=1
to:
# Access Control module
[AccessControl]
enable=1

# Greylisting module
[Greylisting]
enable=0

# CheckHelo module
[CheckHelo]
enable=1

# CheckSPF module
[CheckSPF]
enable=1

# Quotas module
[Quotas]
enable=1
Then reboot your server. (Don't know how to restart the policyd) hehehe.. Next is enable the Catch-All;
nano /etc/postfix/mysql/domain_alias_catchall_maps.cf
Change from:
query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND alias.address=CONCAT('%u', '@', alias_domain.target_domain) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0
to:
query       = SELECT alias.goto FROM alias,alias_domain,domain WHERE alias_domain.alias_domain='%d' AND (alias.address=CONCAT('%u', '@', alias_domain.target_domain) OR alias.address=CONCAT('@', alias_domain.target_domain)) AND alias_domain.target_domain=domain.domain AND alias.active=1 AND alias_domain.active=1 AND domain.backupmx=0
Save then restart postfix;
postfix stop

postfix start
Now catch-all is now enable in postfix. Next thing is add which domain to catch-all and where to go. Login to MySQL as root, use vmail database and add to the following rows to alias table.
INSERT INTO alias (address, goto, domain) VALUES ('@sample.co.nz', 'user@sample.co.nz', 'sample.co.nz');

INSERT INTO alias (address, goto, domain) VALUES ('@test.sample.co.nz', 'user@sample.co.nz', 'test.sample.co.nz');
Aside from catch all, you can setup the email forwarder too;
INSERT INTO alias (address, goto, domain) VALUES ('info@sample.co.nz', 'user@sample.co.nz', 'sample.co.nz');
All done.. its self explanatory... Hehehe... Hope this helps.   Some Reference:
Top PHP Frameworks
Posted: 9 Dec 2013, 20:23pm - Monday
iPhone Process List
Posted: 26 Nov 2013, 22:00pm - Tuesday
I had this problem with my iPhone that drains my battery so fast. A 100% down to 10% in 2 hrs. I don't blame my hardware because I believe its not causing the issue. Its something on the running applications because when I touch my iPhone, its warm like there's something processing inside. One of the draining battery applications is the Yahoo! Messenger. But in my case, I don't have Y! Msgr. Since my iPhone was jailbroken, I installed "top" command and enter to iPhone terminal using PUTTY and kill all the apps which are not on the default iPhone services.
The list below are iPhone process list, you can check them one by one for disable or enable these iPhone Service or not. Launchd: takes over many tasks from cron, xinetd, mach_init, and init, which are UNIX programs that traditionally have handled system initialization, called systems scripts, run startup items, and generally prepared the system for the user. (do not close) TQServer: Net Long Company PC Suit daemon (recommend not to close it) BTServer: Bluetooth Service (BlueTooth) (in my environment with the dock, turn it off iphone not responding) CommCenter: Communications Center (phone system) (do not close) configd: to automatically configure and maintain the network (do not close) cron: regularly scheduled command or script execution (alarm clock might use it, recommend not to close it) mDNSResponder: Multicast-DNS Responder daemon. (Do not turn off) lockdownd: so that iPhone can use other SIM card (do not close) ptpd: the process of connecting itunes (do not close) fitx: WeFIT Input Method (not recommended to be closed) mediaserverd: (system sounds) (do not close) notifyd: inter-process communication (do not close) SpringBoard: Springboard is no better explanation in English, if you used the installer or ibrickr install a third-party software, you will find the middle of the screen there is a circular symbol loader, and then immediately return to the standby screen iPhone , then this is a Springboard restart the process (do not close) MobilePhone: I need not explain this right (do not close) sshd: ssh daemon (you can close it) crashreporterd: test application crashes the daemon. (Recommend to close) dock: dock the software process (you decide to use or not) iapd: ipod is the iphone and other Apple products using a communication protocol, the purpose is to allow other third-party devices such as communication equipment and iphone. (Recommended closure) syslogd: recording system error logs and status messages (recommend to close) update: time to refresh the file system cache to prevent data loss caused by system crash (recommend to close). If you want to manually sync the file system cache, in text mode (ssh to connect to the iphone), implementation of the sync command. crashreporterd, iapd, syslogd, update service can be safely shut down and will not impact on the system. fitx memory for not a lot of information needs to hand in the hair starts, so I do not recommend turning off.
Processes:  38 total, 1 running, 1 stuck, 36 sleeping... 201 threads                                                                                                                                                                 13:55:28
Load Avg:  1.83,  1.18,  0.99    CPU usage:  4.63% user,  0.00% sys, 95.37% idle
SharedLibs: num =    0, resident =     0 code,     0 data,     0 linkedit.
MemRegions: num =     0, resident =     0 +     0 private,     0 shared.
PhysMem:   57M wired,   96M active,   50M inactive,  291M used,  214M free.
VM: 11G + 0   27721(0) pageins, 0(0) pageouts

  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS  RPRVT  RSHRD  RSIZE  VSIZE
  750 top          2.8%  0:00.09   1    21      0      0      0  1184K+  267M
  746 bash         0.0%  0:00.04   1    16      0      0      0  1060K   268M
  745 sshd         0.1%  0:01.04   1    18      0      0      0  1428K   268M
  691 bash         0.0%  0:00.10   1    16      0      0      0  1088K   268M
  690 sshd         0.0%  0:01.16   1    18      0      0      0  1420K   268M
  395 Bump         0.0%  0:01.21  11    66      0      0      0  9604K   340M
  374 MobileMail   0.0%  0:02.55  10   128      0      0      0  8836K   343M
  309 LINE         0.0%  0:23.51  11   192      0      0      0    42M   413M
  271 MobilePhon   0.0%  0:01.98   5    82      0      0      0  6512K   339M
  210 networkd     0.0%  0:00.52   3    50      0      0      0  1068K   269M
  139 myTunes      0.0%  0:01.18   1    10      0      0      0   372K   277M
  127 notifyd      0.0%  0:03.19   4   115      0      0      0  1028K   270M
   73 aosnotifyd   0.0%  0:00.79   4    70      0      0      0  3504K   297M
   72 BTServer     0.0%  0:00.82   3    62      0      0      0  1992K   271M
   71 CommCenter   0.0%  0:12.08  11   214      0      0      0  3420K   284M
   66 SpringBoar   0.2%  1:43.16  20   555      0      0      0    41M   436M
   65 aggregated   0.0%  0:05.62   4    44      0      0      0  1984K   298M
   64 apsd         0.0%  0:01.62   3    86      0      0      0  1780K   287M
   63 assistivet   0.0%  0:01.30   6    68      0      0      0  6240K   333M
   58 configd      0.0%  0:09.70   9   220      0      0      0  2540K   272M
   55 dataaccess   0.0%  0:21.93  11   127      0      0      0  8092K   304M
   54 fairplayd.   0.0%  0:01.84   2    62      0      0      0  3568K   277M
   53 fseventsd    0.0%  0:02.03   4    25      0      0      0   988K   268M
   51 iapd         0.0%  0:01.73   4    94      0      0      0  3348K   289M
   50 imagent      0.0%  0:02.17   4    89      0      0      0  2392K   298M
   48 locationd    0.1%  1:18.24  13   182      0      0      0  7644K   307M
   47 mDNSRespon   0.0%  0:01.51   3    46      0      0      0  1488K   269M
   46 mediaremot   0.0%  0:00.30   3    48      0      0      0  1576K   269M
   45 mediaserve   0.0%  0:04.15  17   265      0      0      0  7160K   304M
   39 lockdownd    0.0%  0:08.90   2    63      0      0      0  2268K   288M
   32 powerd       0.0%  0:08.65   3    62+     0      0      0  1052K+  287M+
   30 syslogd      0.0%  0:01.36   4    58      0      0      0   628K   268M
   26 wifid        0.0%  0:08.63   4   106      0      0      0  2064K   288M
   25 sbsettings   0.0%  0:00.20   2    28      0      0      0  2308K   287M
   24 callblocke   0.0%  0:00.59   2    33      0      0      0  2860K   296M
   22 myTunes      0.0%  0:00.01   1    16      0      0      0   332K   258M
   21 UserEventA   0.0%  0:19.29   9   147      0      0      0  2756K   291M
    1 launchd      0.0%  0:04.99   3   292      0      0      0  1016K   268M
--- Reference: http://blog.iobit.com/iphone-process-list_4008.html
Visual C# .Net and rsync
Posted: 28 Oct 2015, 1:40am - Wednesday
Today, I was wondering if possible to use rsync in Visual C# .Net. After couple of searches, I finally got my answer and working sample project. cSharp_gdrive I would like to share my Visual C# .Net source code project since I found many developers were looking for a working sample. I am planning to create a class wrapper too and deposit it on GitHub soon. My GitHub: https://github.com/camilord Download: AlphaOneDrive.zip
Computer Online Shop in New Zealand
Posted: 9 Apr 2015, 4:26am - Thursday
I just found the reliable and best way to shop online with computer parts, accessories etc. Just browse at www.crongroup.co.nz and you'll get the best deal. :) crongroup
MySQL Constraints: Import
Posted: 10 Mar 2015, 2:09am - Tuesday
I stumbled down again of database constraints when importing SQL dump file.
ERROR 1217 (23000) at line 128: Cannot delete or update a parent row: a foreign key constraint fails
The solution is add the following line in the beginning of the SQL dump file:
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0
That should work.
Cisco 1841 configuration for Vodafone NZ UFB
Posted: 8 Dec 2014, 3:13am - Monday
I believed I am not the only one needs this information. It took me ages to crack this configuration. I've been calling Vodafone technical support and all I can get is "I will forward you to blah blah blah..." and then no one will answer. I waited for nothing. I also sent an email to Vodafone and replied after 2 weeks which I already resolved the issue. I joined the Vodafone community and still not that helpful but I got a clue from Dylan (thanks mate!). So below is my working Cisco 1841 configuration for VodafoneNZ UFB (UltraFast Broadband or Fibre Connection with a speed of 100mbps download and 50mbps upload.)
Building configuration...

Current configuration : 1742 bytes
!
version 12.x
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname camilord.net
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$xxxxxxxxxxxxxxxxxxxxx0
!
no aaa new-model
!
resource policy
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip cef
!
!
no ip dhcp use vrf connected
ip dhcp excluded-address 192.168.0.1 192.168.0.49
ip dhcp excluded-address 192.168.0.200 192.168.0.254
!
ip dhcp pool INTERNAL
   import all
   network 192.168.0.0 255.255.255.0
   default-router 192.168.0.1
!
!
no vlan accounting
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.10
 encapsulation dot1Q 10
 ip address dhcp
 ip nat outside
 no snmp trap link-status
!
interface FastEthernet0/1
 ip address 192.168.0.1 255.255.255.0
 ip nat inside
 duplex auto
 speed auto
!
interface ATM0/0/0
 no ip address
 shutdown
 no atm ilmi-keepalive
 dsl operating-mode auto
!
interface Serial0/1/0
 no ip address
 shutdown
 no fair-queue
 clock rate 2000000
!
interface Serial0/1/1
 no ip address
 shutdown
 clock rate 2000000
!
ip default-gateway [YOUR_ISP_GATEWAY]
ip route 0.0.0.0 0.0.0.0 [YOUR_ISP_GATEWAY]
!
!
ip http server
no ip http secure-server
ip nat inside source list 100 interface FastEthernet0/0.10 overload
ip nat inside source static [HOME_SERVER_IP] interface FastEthernet0/0.10
!
access-list 100 remark Traffic allowed to NAT
access-list 100 permit ip 192.168.0.0 0.0.0.255 any
access-list 100 deny   ip any any
!
!
!
control-plane
!
!
banner motd ^CCAMILO3RD NETWORK: Restricted Area! Authorised Access only!^C
!
line con 0
 password xxxxxxxxxx
 login
line aux 0
line vty 0 4
 password xxxxxxxxxx
 login
!
end


Note: [YOUR_ISP_GATEWAY] is an IP address, this value should be replaced, please refer to your current modem configuration. [HOME_SERVER_IP] is my home server, forwarding all incoming request traffic to my home server. In my case, I got public/static IP address to forward all the traffic. If you need access to your Vodafone default modem-router (in my case its HG659), use:
Username: Admin
Password: VF-NZhg659
or visit http://www.neatstuff.co.nz/HG659.html Hope this will help you. If you find this article helpful and have extra penny, click the donate button below:
Selwyn District Council Consents
Posted: 18 Sep 2014, 1:24am - Thursday
Wohooo... It is really good hearing this news. TRIAD { sid, michael, camilo3rd } is behind this online tool. Online Building Consent System is powered by: Alpha 77 Limited (www.abcs.co.nz) Legacy of Adam Jones of QCIT Ltd (www.qcit.co.nz)
Yey! Fibre100 Internet Connection installed
Posted: 5 Aug 2014, 21:20pm - Tuesday
my-inet-connection

Finally, my Fibre100 internet connection has been installed.Thanks Vodafone. Though I have a long wait for 3 weeks before it get installed, but I think its worthy. :) Hopefully I will be given a static IP address.

After enuiry, Vodafone replied my Static IP address will be activated within 24-48 hours. Weeehh!

3668651465
3671391738
3671402748
3671405602
3671407802
Code Igniter: Cannot get POST values
Posted: 27 Mar 2014, 22:01pm - Thursday
I encountered this issue in Code Igniter that I cannot get the POST values. Some says its the .htaccess issue. I used same .htaccess with all my application and works fine. I was working on my new environment, Kali Linux, and realised that its the mod_rewrite module wasn't loaded and partly affects the .htaccess.
# cd /etc/apache2/mods-enabled/
# locate mod_rewrite
/usr/lib/apache2/modules/mod_rewrite.so
# touch rewrite.load
# nano rewrite.load
At the file:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
Save the changes and restart apache. Hope this will help you... Pee coding!
Git: Can't push problem
Posted: 11 Feb 2014, 8:12am - Tuesday
My workmate, Sid Bachtiar, was working on our git repo server and we're having issue on pushing the files. It keep us telling nothing to push. Solution:
[root@git helpdesk]# find /home/git/repotest.git -type d -exec chmod 775 {} +
or if still doesnt work...
[root@git helpdesk]# chmod 775 -R /home/git/repotest.git
  So that git can write files... Done!
JPGRAPH I always stumble down with this error for couple of projects now.
JpGraph Error: 25128 The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.
Two solutions as I know:
  1. install the required library
  2. or simply comment certain line
  For solution #1, simply cast yum install php-gd. For solution #2, as of version 3.5.0b1 -- comment line 110 (function SetAntiAliasing) at file gd_image.inc.php and that's it... problem solved. Another issue will be fonts:
JpGraph Error: 25049 Font file "/usr/share/fonts/truetype/arialbd.ttf" is not readable or does not exist.
Look for jpg-config.inc.php and add these lines:
define('CACHE_DIR','cache/');
define('TTF_DIR','includes/jpgraph/fonts/');
Note: Just place the right path where you setup your jpgraph folder Download required JpGraph Fonts: jpgraph_fonts.zip And that should solve the problems... :) Samples:

progression_graph_1386128392 progression_graph_1386188039

PHP and MySQL TimeZone Synchronization
Posted: 5 Nov 2013, 3:00am - Tuesday
We all know the PHP and MySQL holds different timezone... what if we want both PHP and MySQL sync together by adjusting your PHP code only... Here's the solution:
<?php

define('TIMEZONE', 'Australia/Brisbane');

@date_default_timezone_set(TIMEZONE);

$dt = new DateTime();

// get time offset
$offset = $dt->format("P"); 

// update mysql timezone
mysql_query("SET time_zone='$offset';");

?>
  Thanks to Craig Buckler... Reference: http://www.sitepoint.com/synchronize-php-mysql-timezone-configuration/
My First Android App
Posted: 15 Aug 2015, 11:31am - Saturday
This is my first android app, you can use it if you want. Its just a simple WebView though. The backend is using Silex PHP Framework and MySQL as the DB. 11863214_1493965787563088_6063613049736519454_n notes_locker.apk Download Notes Locker
MySQL + Percona XtraDB Cluster 5.6
Posted: 21 Mar 2015, 21:02pm - Saturday
I have been experimenting on MySQL + Percona XtraDB Cluster (version 5.6). In my case, I used VMWare/VirtualBox. I created two images and label as DB1 and DB2 using Ubuntu 14.04.2 32bit (Trusty Tahr). My goal is to replicate the database from DB1 to DB2. If DB1 will be down, then DB2 will take over DB1. While fixing DB1, DB2 will serve then if DB1 is back online, DB1 will be the "Joiner" to the "Donor" (DB2). ...and vice versa. Installation First thing you need is to prepare the installation of Percona XtraDB Cluster. (must be root or right high privileges on performing this installation)
root@db1:~# apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
One thing you need to ensure is you have all Ubuntu official repositories plus Percona APT repository. So what I did is replace /etc/apt/source.list with:
# deb cdrom:[Ubuntu-Server 14.04.2 LTS _Trusty Tahr_ - Release i386 (20150218.1)]/ trusty main restricted

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse

## Ubuntu Security Updates
deb http://security.ubuntu.com/ubuntu trusty-security main
deb-src http://security.ubuntu.com/ubuntu trusty-security main
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu trusty partner
deb-src http://archive.canonical.com/ubuntu trusty partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

# Percona XtraDB Cluster
deb http://repo.percona.com/apt trusty main
deb-src http://repo.percona.com/apt trusty main
After updating the APT source list, execute:
root@db1:~# apt-get update
After that, you can install Percona XtraDB Cluster server and client packages:
root@db1:~# apt-get install percona-server-server-5.6 percona-server-client-5.6
This is where I got stuck when trying to connect the nodes. Remove apparmor!!! You can check first if apparmor is running:
root@db1:~# apparmor_status
If its running, remove it before causing problems to Percona.
root@db1:~# apt-get remove apparmor
Important Notes: Do the same installation in the 2nd node or DB2. Then to run the primary node (donor), DB1 in our case:
root@db1:~# service mysql bootstrap-pxc
 * Bootstrapping Percona XtraDB Cluster database server mysqld                       [ OK ]
root@db1:~#
Then run the 2nd node or joiner (DB2):
root@db2:~# service mysql start
mysql start/running, process 1550
root@db2:~#
~ or ~
root@db2:~# service mysql restart
mysql stop/waiting
mysql start/running, process 1550
root@db2:~#
Note: Always start first the primary node (DB1) then the next node (DB2) Testing Check if primary node (DB1) is working...
root@db1:~# mysql -u root -p -e "show status where Variable_name like '%wsrep_cluster%' OR Variable_name like '%wsrep_ready%';"
Enter password:
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_conf_id    | 5                                    |
| wsrep_cluster_size       | 1                                    |
| wsrep_cluster_state_uuid | 1fa1e1fc-cf8e-11e4-9664-3ea415c4a429 |
| wsrep_cluster_status     | Primary                              |
| wsrep_ready              | ON                                   |
+--------------------------+--------------------------------------+

root@db1:~# mysql -u root -p -e "show binary logs;"
Enter password:
+------------------+-----------+
| Log_name         | File_size |
+------------------+-----------+
| mysql-bin.000001 |       120 |
+------------------+-----------+
Next, check the 2nd node (DB2)...
root@db2:/etc/mysql# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.6.22-72.0-56-log Percona XtraDB Cluster (GPL), Release rel72.0, Revision 978, WSREP version 25.8, wsrep_25.8.r4150

Copyright (coffee) 2009-2014 Percona LLC and/or its affiliates
Copyright (coffee) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
More TEST: I created a PHP script for DB1 and DB2 to test the replication. DB1 PHP Script (test_percona.php):
<?php

$connect = mysql_connect('localhost','root','secret');

mysql_select_db('test', $connect);

// insert if table not exists...
@mysql_query("create table if not exists data_test(
 id bigint(20) unsigned not null auto_increment primary key,
 data varchar(128),
 created datetime
);");

// inject data infinitely
while (true) {
        $data = sha1(time().rand(100,99999));
        echo $data." -> ".date("j M Y g:i.s a - l\n");
        @mysql_query("INSERT INTO data_test (data,created) VALUES ('".$data."', NOW())");
}

?>
DB2 PHP Script (monitor_percona.php):
<?php

$connect = mysql_connect('localhost','root','secret');

mysql_select_db('test', $connect);

$last_id = 0;

while (true) {
        $result = mysql_query("SELECT * FROM data_test WHERE id > ".$last_id." ORDER BY id ASC");
        $max = mysql_num_rows($result);
        if ($max > 0) {
                for ($i = 0; $i < $max; $i++) {
                        echo mysql_result($result,$i,"data")." -> ".date("j M Y g:i.s a - l", strtotime(mysql_result($result,$i,"created")))."\n";
                        $last_id = mysql_result($result,$i,"id");
                }
        }
}

?>
Then you can run the script on both nodes. To run in DB1 node, do:
root@db1:~# php test_percona.php
Then for the 2nd node:
root@db2:~# php monitor_percona.php
After that, you must see same output both nodes. percona_xc_test_result2 percona_xc_test_result  Encountered Issues (tail -f /var/log/mysql/error.log):
2015-03-21 20:19:11 6613 [Warning] WSREP: Gap in state sequence. Need state transfer.
2015-03-21 20:19:11 6613 [Note] WSREP: Running: 'wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.9.103' --auth 'sstuser:secret' --datadir '/var/lib/mysql/' --defaults-file '/etc/mysql/my.cnf' --parent '6613'  '' '
2015-03-21 20:19:11 6613 [ERROR] execlp() failed: Permission denied
2015-03-21 20:19:11 6613 [ERROR] WSREP: Failed to read 'ready <addr>' from: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.9.103' --auth 'sstuser:secret' --datadir '/var/lib/mysql/' --defaults-file '/etc/mysql/my.cnf' --parent '6613'  '' Read: '(null)'
2015-03-21 20:19:11 6613 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.9.103' --auth 'sstuser:secret' --datadir '/var/lib/mysql/' --defaults-file '/etc/mysql/my.cnf' --parent '6613'  '' : 1 (Operation not permitted)
2015-03-21 20:19:11 6613 [ERROR] WSREP: Failed to prepare for 'xtrabackup-v2' SST. Unrecoverable.
2015-03-21 20:19:11 6613 [ERROR] Aborting
To solve the issue is to remove the apparmor --- Reference: 
  • http://www.percona.com/doc/percona-server/5.6/installation/apt_repo.html
  • http://www.percona.com/doc/percona-xtradb-cluster/5.5/howtos/ubuntu_howto.html
  • http://www.percona.com/doc/percona-xtrabackup/2.1/innobackupex/pit_recovery_ibk.html
Prendstah.com got A+ grade from ssllabs.com
Posted: 15 Dec 2014, 11:09am - Monday
I was curious how Sid Bachtiar got the high grade of his SSL Report. It challenge me and give me interest how to do it. So I did. Oh Yeah! Got the A+ SSL Report grade. prendstah_Aplus_on_ssllabs

SSL Test: https://www.ssllabs.com/ssltest/analyze.html?d=prendstah.com

 

skype_a-ssl

Linux: Serial Port Communication
Posted: 25 Nov 2014, 6:18am - Tuesday
Since HyperTerminal was removed in Windows 7, I decided to look up on Linux tools for serial port communication and found minicom command. Here's how to install & use it (in my case I used Linux Mint):
# apt-get install minicom
Then after installation, cast a command:
# minicom -s

            +-----[configuration]------+
            | Filenames and paths      |
            | File transfer protocols  |
            | Serial port setup        |
            | Modem and dialing        |
            | Screen and keyboard      |
            | Save setup as dfl        |
            | Save setup as..          |
            | Exit                     |
            | Exit from Minicom        |
            +--------------------------+
Then you have to setup the serial port,
    +-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyUSB0                              |
    | B - Lockfile Location     : /var/lock                                 |
    | C -   Callin Program      :                                           |
    | D -  Callout Program      :                                           |
    | E -    Bps/Par/Bits       : 9600 8N1                                  |
    | F - Hardware Flow Control : Yes                                       |
    | G - Software Flow Control : No                                        |
    |                                                                       |
    |    Change which setting?                                              |
    +-----------------------------------------------------------------------+
So in my case, I used USB to Serial connector, so I set Serial Device to ttyUSB0 After that, go to Exit and you'll be connected to the device you want to connect like Cisco routers/switch.
Maximum files for each Folder
Posted: 5 Sep 2014, 1:33am - Friday
FAT32:
  • Maximum number of files: 268,173,300
  • Maximum number of files per directory: 216 - 1 (65,535)
  • Maximum file size: 2 GiB - 1 without LFS, 4 GiB - 1 with
NTFS:
  • Maximum number of files: 232 - 1 (4,294,967,295)
  • Maximum file size
    • Implementation: 244 - 26 bytes (16 TiB - 64 KiB)
    • Theoretical: 264 - 26 bytes (16 EiB - 64 KiB)
  • Maximum volume size
    • Implementation: 232 - 1 clusters (256 TiB - 64 KiB)
    • Theoretical: 264 - 1 clusters
ext2:
  • Maximum number of files: 1018
  • Maximum number of files per directory: ~1.3 × 1020 (performance issues past 10,000)
  • Maximum file size
    • 16 GiB (block size of 1 KiB)
    • 256 GiB (block size of 2 KiB)
    • 2 TiB (block size of 4 KiB)
    • 2 TiB (block size of 8 KiB)
  • Maximum volume size
    • 4 TiB (block size of 1 KiB)
    • 8 TiB (block size of 2 KiB)
    • 16 TiB (block size of 4 KiB)
    • 32 TiB (block size of 8 KiB)
ext3:
  • Maximum number of files: min(volumeSize / 213, numberOfBlocks)
  • Maximum file size: same as ext2
  • Maximum volume size: same as ext2
ext4:
  • Maximum number of files: 232 - 1 (4,294,967,295)
  • Maximum number of files per directory: unlimited
  • Maximum file size: 244 - 1 bytes (16 TiB - 1)
  • Maximum volume size: 248 - 1 bytes (256 TiB - 1)
  Reference: http://stackoverflow.com/questions/466521/how-many-files-can-i-put-in-a-directory
ASP Immigration Services Ltd - www.aspisnz.com
Posted: 21 Jun 2014, 22:23pm - Saturday
As my secondary Immigration Adviser, ASP Immigration Services Ltd, a filipino immigration adviser, help my immigration concerns in New Zealand. I created the website of the company. I used Silex PHP framework with twig templating. (and this is SEO!)

aspisnz

Allow postfix  to send email with different sender from SMTP account... Error:
postfix/smtpd[27402]: NOQUEUE: reject: RCPT from unknown[125.123.123.100]: 553 5.7.1 <user@xxx.co.nz>: Sender address rejected: not owned by user user@xxx.co.nz; from=<xxx@xxx.co.nz> to=<xxx@gmail.com> proto=ESMTP helo=<localhost>
Edit postfix configuration:
[root@mail ~]# nano /etc/postfix/main.cf
Change from:
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
To:
smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated
Then restart postfix...
[root@mail ~]# postfix stop
postfix/postfix-script: stopping the Postfix mail system
postfix/postfix-script: waiting for the Postfix mail system to terminate
[root@mail ~]# postfix start
postfix/postfix-script: starting the Postfix mail system
[root@mail ~]#
That's it.. You can now change your from or reply-to in your PHPMailer. :) Hope this helps...
Symfony2: Install/Create Project
Posted: 30 Jan 2014, 4:10am - Thursday
C:\php>php composer.phar install
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "composer.phar self-update" to get the latest version.
Composer could not find a composer.json file in C:\php
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section

C:\php>php composer.phar self-update
Updating to version 0238aaf5ac565a5b896caa79e9ca7e71d2312343.
    Downloading: 100%

C:\php>php composer.phar install
Composer could not find a composer.json file in C:\php
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section

C:\php>composer install
'composer' is not recognized as an internal or external command,
operable program or batch file.

C:\php>php composer install
Could not open input file: composer

C:\php>php composer.phar
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 0238aaf5ac565a5b896caa79e9ca7e71d2312343 2014-01-29 09:12:19

Usage:
  [options] command [arguments]

Options:
  --help           -h Display this help message.
  --quiet          -q Do not output any message.
  --verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
  --version        -V Display this application version.
  --ansi              Force ANSI output.
  --no-ansi           Disable ANSI output.
  --no-interaction -n Do not ask any interactive question.
  --profile           Display timing and memory usage information
  --working-dir    -d If specified, use the given directory as working directory.

Available commands:
  about            Short information about Composer
  archive          Create an archive of this composer package
  config           Set config options
  create-project   Create new project from a package into given directory.
  depends          Shows which packages depend on the given package
  diagnose         Diagnoses the system to identify common errors.
  dump-autoload    Dumps the autoloader
  dumpautoload     Dumps the autoloader
  global           Allows running commands in the global composer dir ($COMPOSER_HOME).
  help             Displays help for a command
  init             Creates a basic composer.json file in current directory.
  install          Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
  licenses         Show information about licenses of dependencies
  list             Lists commands
  require          Adds required packages to your composer.json and installs them
  run-script       Run the scripts defined in composer.json.
  search           Search for packages
  self-update      Updates composer.phar to the latest version.
  selfupdate       Updates composer.phar to the latest version.
  show             Show information about packages
  status           Show a list of locally modified packages
  update           Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.
  validate         Validates a composer.json

C:\php>php composer.phar install
Composer could not find a composer.json file in C:\php
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section

C:\php>php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing monolog/monolog (1.2.1)
    Downloading: 100%

monolog/monolog suggests installing mlehner/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
Writing lock file
Generating autoload files

C:\Workspace\localhost\symfony>php.exe c:\php\composer.phar create-project symfony/framework-standard-edition c:\workspace\localhost\symfony\Symfony 2.4.1
Installing symfony/framework-standard-edition (v2.4.1)
  - Installing symfony/framework-standard-edition (v2.4.1)
    Downloading: 100%

Created project in c:\workspace\localhost\symfony\Symfony
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing jdorn/sql-formatter (v1.2.17)
    Downloading: 100%

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing twig/twig (v1.15.0)
    Downloading: 100%

  - Installing doctrine/lexer (v1.0)
    Downloading: 100%

  - Installing doctrine/annotations (v1.1.2)
    Downloading: 100%

  - Installing doctrine/collections (v1.1)
    Downloading: 100%

  - Installing doctrine/cache (v1.3.0)
    Downloading: 100%

  - Installing doctrine/inflector (v1.0)
    Downloading: 100%

  - Installing doctrine/common (v2.4.1)
    Downloading: 100%

  - Installing symfony/symfony (v2.4.1)
    Downloading: 100%

  - Installing symfony/icu (v1.0.0)
    Downloading: 100%

  - Installing doctrine/dbal (v2.4.2)
    Downloading: 100%

  - Installing doctrine/doctrine-bundle (v1.2.0)
    Downloading: 100%

  - Installing kriswallsmith/assetic (v1.1.2)
    Downloading: 100%

  - Installing symfony/assetic-bundle (v2.3.0)
    Downloading: 100%

  - Installing sensio/framework-extra-bundle (v3.0.0)
    Downloading: 100%

  - Installing doctrine/orm (v2.4.1)
    Downloading: 100%

  - Installing twig/extensions (v1.0.1)
    Downloading: 100%

  - Installing swiftmailer/swiftmailer (v5.0.3)
    Loading from cache

  - Installing symfony/swiftmailer-bundle (v2.3.5)
    Downloading: 100%

  - Installing monolog/monolog (1.7.0)
    Loading from cache

  - Installing symfony/monolog-bundle (v2.5.0)
    Downloading: 100%

  - Installing sensio/distribution-bundle (v2.3.4)
    Downloading: 100%

  - Installing sensio/generator-bundle (v2.3.4)
    Downloading: 100%

  - Installing incenteev/composer-parameter-handler (v2.1.0)
    Downloading: 100%

kriswallsmith/assetic suggests installing leafo/lessphp (Assetic provides the integration with the lessphp LESS compiler)
kriswallsmith/assetic suggests installing leafo/scssphp (Assetic provides the integration with the scssphp SCSS compiler)
kriswallsmith/assetic suggests installing ptachoire/cssembed (Assetic provides the integration with phpcssembed to embed data uris)
kriswallsmith/assetic suggests installing leafo/scssphp-compass (Assetic provides the integration with the SCSS compass plugin)
monolog/monolog suggests installing mlehner/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
Writing lock file
Generating autoload files
Creating the "app/config/parameters.yml" file
Some parameters are missing. Please provide them.
database_driver (pdo_mysql):
database_host (127.0.0.1):
database_port (null): 3306
database_name (symfony):
database_user (root):
database_password (null): secretkanding
mailer_transport (smtp):
mailer_host (127.0.0.1):
mailer_user (null):
mailer_password (null):
locale (en):
secret (ThisTokenIsNotSoSecretChangeIt): 123456987456321
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for Acme\DemoBundle into web/bundles/acmedemo
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution

C:\Workspace\localhost\symfony>
IDE: NetBeans vs phpStorm
Posted: 27 Nov 2013, 20:23pm - Wednesday
Before back in college, I used UltraEdit, then Notepad++ as my HTML JS, CSS and PHP editor. I even tried Dreamweaver and it sucks for me. I also tried Ecplise and its way heavy application, too slow to load. I've been using NetBeans IDE for a while now. I met a PHP programmer and mention about phpStorm and got curious. So I downloaded phpStorm 7.0 and tested it out myself. I still find NetBeans as the Best IDE. Though I like the UI of phpStorm, I find it so COOL (see screenshot below) but (geeezz!) its too pricy will cost you $99 for personal license. Loading performance, I still voted for NetBeans. Features like FTP, SSH, Git, SVN etc -- most likely they have both NetBeans and phpStorm.

netbeans_vs_phpstorm

 I guess, I felt the same with other PHP developers about NetBeans, phpStorm, Eclipse and other IDEs. See: http://www.warriorforum.com/programming-talk/637270-eclipse-vs-netbeans-vs-phpstorm.html
Being Human (TV Series)
Posted: 21 Sep 2013, 5:19am - Saturday
Being-Human-001I love TV series and movies and this will be my first time to comment negatively. So, I've been watching this TV series, BEING HUMAN. Sad to say, its the most stupid plot. The characters' behavior are inconsistent. I really regret buying the Blue-Ray - The Complete Series (Series 1 to 4)  of Being Human. The story sucks. George scream or shouts like a gay. I guess the creator and writer Toby Whithouse really have unstable plots of his story. Totally, I don't recommend this TV series. I find this TV series sucks. Verdict: -Z (Awful)