Sunday, August 31, 2014

Linux: Clear all Logs

Found this answer to clear all logs in my /var/log/*
Really save my day, thank you

Wednesday, August 13, 2014

PHPExcel Max Rows 65356 Problem

PHPExcel to generate *.xls file with list of data around 140K rows but limited to only
showing 65356 (~65K) rows per worksheet/sheet. Are you having the same problem like me?
If you are, then simply split the data to multiple sheets. Lets say i have 140K of data
then split the datas to 3 worksheets.

Done? Not quite. I had tried to implements the workaround to split the datas but
the loading process of the data, it pop-up a dialog with error message in microsoft-office
while other office application don't, then blank multiple sheets. If you set the name for
each sheet then you will see that the sheets are succesful renamed or set to desired name.

How come? well i do not have the exact answer but after some trials and errors,
i come up with 39999 (~39K) rows max for each sheet. And everything works as expected.
After i set the data to 300K and split the datas to multiple sheets with ~39K rows
per sheet, all the data generated and shown as expected.

So the real max rows for a workbook with multiple sheets is ~39K rows while
~65K rows for a workbook with a single worksheet. Hope this article would help.

Happy coding

Monday, August 4, 2014

Linux Remote Desktop Without Login

Remote Desktop options already set allow to connect and password is set.
But whenever you reboot and try to connect, you only see black screen.
Well you need to install tigervnc-server. I am using Fedora then

$ sudo yum install tigervnc-server

Edit /etc/sysconfig/vncservers to your desire, but keep in mind that:

1. Make sure the setting of  `1` then [1]  should match.
2. Check using ps -ef | grep vnc, and find rfbport 590X.
    where X shud match your configuration
3. If you set to config 1:yourusername then the rfbport will be
    5900 + 1 => rfbport 5901, where 5900 is the standard port of vnc
4. Similar to #3 if you set config 2:othername then the rfbport will be
    5900 + 2 => rfbport 5902
5. When you try to connect do not forget to specify to which port you
    are trying to connect. IP:PortNumber,
    If no port specified then default port to be connected is 5900
6. Check your firewall, make sure it allows connection to tcp with
    destination port 5900:5910 (port 5900 to port 5910)
7. auto start vncserver during startup, in my fedora simply
    $ sudo chkconfig vncserver on

Hopefully you will have successful connection to your target remote desktop
without any login at the target remote desktop.