Showing posts with label How To. Show all posts
Showing posts with label How To. Show all posts

Tuesday, March 8, 2016

scExcelExport Component for Delphi 10 Seattle

As of this time of writings, scExcelExport component still not support Delphi 10 Seattle. Only Delphi XE8 will be able to compile the component without issue.

If you highly depend to this component, i will show you how to compile it in Delphi 10 Seattle (until the official release come out).
1. Open scExcelExportConfig.inc using text editor.
2. Add the code i have marked below inside scExcelExportConfig.inc:
{--------------------------------------------------------------------------------
* Description : scExcelExportConfig.inc - compiler directives
--------------------------------------------------------------------------------}
//******************* begin custom line ********************************
{$IFDEF VER300} // Delphi 10 : Default Excel2010, ExcelXP can also be used
  {$DEFINE EXCEL2010}
  {$DEFINE DELPHIXE8}
  {$DEFINE DELPHIXEORNEWER}
  {$DEFINE DELPHI2010ORNEWER}
  {$DEFINE DELPHI2006ORNEWER}
{$ENDIF}
//******************* end custom line ********************************
{$IFDEF VER290} // Delphi XE8 : Default Excel2010, ExcelXP can also be used {$DEFINE EXCEL2010} {$DEFINE DELPHIXE8} {$DEFINE DELPHIXEORNEWER} {$DEFINE DELPHI2010ORNEWER} {$DEFINE DELPHI2006ORNEWER} {$ENDIF}
Then you can compile the component as show in its documentation successfully.

Please drop your comment if you have issue.

Tuesday, January 20, 2015

Reset Files and Folders Permission on Windows

I often used windows permission to limit other user on the same PC to access application/Folder/File. But after the real owner of the file is resign, i had to change those files/folders permission to original or directly change to current user.

So if you need to reset file/folder permission setting to default, you can use command below:
ICACLS (Folder or File name) /T /Q /C /RESET
example:
D:\OILDATA>ICACLS IVAN /T /Q /C /RESET

Above command will help you to accomplish your need.

Monday, December 29, 2014

List of VirtualMin error when configuring and the its solutions

I'am as a web developer, often use Virtualmin as Control Panel, but sometimes when configuring i got stuck with the following error. After some research i got the solution to fix the error. I wrote here as reminder for future and also for you if stuck with the same error.

"Your Postfix configuration is missing the system's mail hostname UNKNOWN from the mydestination line, which will cause mail to bounce."
Solution:
Put "UNKNOWN" string inside "/etc/postfix/main.cf" file and in line  "mydestination ="




Hope this writing can help you out there.

Tuesday, June 10, 2014

Install PHP-FPM 5.4 in Ubuntu 12.04.4 + Nginx

For the startup i'm following https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04 tutorial to installing LEMP (Linux, nginx, MySQL, PHP) in my VPS. The server Run perfectly. But then for my project i used Laravel 4.2 which required PHP 5.4 for minimal requirement. So then i upgrade the PHP by following http://www.dev-metal.com/how-to-install-latest-php-5-4-x-on-ubuntu-12-04-lts-precise-pangolin/:
sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update
sudo apt-get install php5-fpm
After that when i try to view page that contain php code, the server going error.
I view Nginx error from "/var/log/nginx/error.log"
2014/06/10 06:37:18 [crit] 481#0: *1 connect() to unix:/var/run/php5-fpm.sock:", host: "yourdomain.com"

Then found some solution from http://www.queryadmin.com/921/connect-unix-var-run-php5-fpm-sock-failed/:
Edit the pool file "/etc/php5/fpm/pool.d/www.conf" and change:
listen = /var/run/php5-fpm.sock
to this:
listen = 127.0.0.1:9000
Edit the Nginx vHost file "/etc/nginx/sites-available/default" and change:
location ~ \.php$
{
    ...
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    ...
}
to this:
location ~ \.php$
{
    ...
    fastcgi_pass 127.0.0.1:9000;
    ...
}
** If you wrote the fastcgi_pass on /etc/nginx/fastcgi_params file, edit it too.

Restart PHP5-FPM service:
/etc/init.d/php5-fpm restart
Restart Nginx service:
/etc/init.d/nginx restart

That's it, you may solved the issue now. Have Fun.

Friday, June 6, 2014

Redirect Loop when PhpMyAdmin as SubFolder in Laravel Public Directory

If you use laravel in a hosting then you add PhpMyAdmin as subfolder in Laravel Public Directory, you may get error message as seen in image below:


For the solution, you can do one of the following guide:
1. Visit PhpMyAdmin with:
 http://yourdomain.com/phpmyadmin/index.php 
or
2. Open .htaccess file in laravel public folder, then comment out/remove line below:
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301] <-- Comment Out or Remove this line

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
That's it, you can access PhpMyAdmin normally.

Wednesday, April 2, 2014

Moving Outlook 2013 IMAP Data Folder to Other Place

If you want to move your Outlook 2013 IMAP Data Folder to Other Places instead of
C:\Users\username\AppData\Local\Microsoft\Outlook
then you can follow trick below:

1. Rename
C:\Users\username\AppData\Local\Microsoft\Outlook
to
C:\Users\username\AppData\Local\Microsoft\Outlook-old
2. Create New Folder where you want the IMAP Data Folder to be stored, Ex:
D:\Email
3. Open command prompt as Administrator and then type syntax below:
C:\WINDOWS\system32>mklink /D "C:\Users\username\AppData\Local\Microsoft\Outlook" "D:\Email"
symbolic link created for C:\Users\username\AppData\Local\Microsoft\Outlook <<===>> D:\Email

4. You can move all of IMAP Data Folder that in
C:\Users\username\AppData\Local\Microsoft\Outlook-old
to your new place (D:\Email) or you can retry to add your IMAP Account Again in Outlook.

Outlook is fooled into still thinking they’re in the old location. But the important part is the new OST’s will be in the desired location.

Source from Here.

Thursday, March 27, 2014

Claim VirtualBox HD Empty Space File Size

If You often Use VirtualBox to do your work, after sometime you will see the Disk (VDI) File Size increasing so Big. Even after you Delete many Files inside Guest OS, it still keep the size larger.

You can do following steps to Reduce it:
1. Run Defrag in the Guest (Windows)
2. Nullify free space:
With Linux guest run this:
sudo dd if=/dev/zero of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
With Windows guest, download SysinternalsSuite then run this:
sdelete –z
3. After that Shutdown the guest VM
4. Run VBoxManage's compact command
VBoxManage.exe modifyhd thedisk.vdi --compact

All these Step will Reduce your VirtualBox HD. Compare It. :D

Thursday, February 20, 2014

Setup Default website for IP address Visitor in Virtualmin

If you are using Virtualmin as Control Panel for Web Hosting, you may have visitor accessing your IP instead of your Domain. For default, Virtualmin will select first domain which sort alphabetically. But, to make it fix, you can follow step below:
1. Select your prefered domain.
2. Go to Server Configuration > Website Options > Default website for IP address? [Choose Yes]
3. Click Save to Save the configuration.

Setup Default Page For Virtualmin New Website

Virtualmin is one of Free Control Panel for Linux, it can host lot of website in one server. So if you create new website, that root webpage will be show empty.
To put Default Page or Landing Page for every new website created, you can put whatever you'd like into the skel directory. Usually the location is /etc/skel. So, you'd create:

/etc/skel/public_html
And drop an index.html into it with whatever default page you like... be sure to include any images or other bits. You can also, optionally, have variable substitution done within the files--so you could have the page display the domain name or description field in the temporary site.

Visual Studio 2013 – The system cannot find the file specified. (Exception from HRESULT: 0×80070002)

If you have such error after install Visual Studio 2013 then create ASP.NET MVC Project,
The system cannot find the file specified. (Exception from HRESULT: 0×80070002)
The Solution is Reinstall Nuget from here http://docs.nuget.org/docs/start-here/installing-nuget, it’s work for Me.. Cheers.