Sunday, August 20, 2017

Routing and Remote Access Service won't start on Windows 10


Routing and Remote Access Service won't start on Windows 10
Environment: MS Windows 10



It kept prompting up error when starting the Service, so that unable to setup incoming connection (VPN)


Fixed it by editing the registry:


  1. Search for “regedit” using Cortana, then run the regedit command in search results to launch Registry Editor.
  2. Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan
    1. Create a new DWORD (Edit > New > DWORD)
    2. Name the new DWORD SvcHostSplitDisable
    3. Open the new DWORD, set the value to 1, then click OK
  3. Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteAccess
    1. Create a new DWORD (Edit > New > DWORD)
    2. Name the new DWORD SvcHostSplitDisable
    3. Open the new DWORD, set the value to 1, then click OK
  4. Restart your PC (Start > Power > Restart)

Thanks for watching 

Source: https://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_web/rras-unable-to-start-service-windows-10/90bd99b9-02d7-434a-9aab-38d59dfa809e?auth=1

Thursday, April 16, 2015

Error Encoding with Python 3 on Windows Command Prompt


Error Encoding with Python 3 on Windows Command Prompt
Environment: MS Windows 7 / Python 3.4



I have do some script with Python 3, but the output is always contains some weird character, looks like error encoding, Python 3 is using unicode by default, Finally, I found that the problem is come from the Command Prompt, you must configure the code page of command prompt to ensure which is running with unicode.


Method to change the code page:
<command prompt>
#chcp 65001
then right click, <command prompt> , <properties> , change the font to something other than Raster
it will turn command prompt to using unicode UTF-8, the setting will be save once your run the command.

Thanks for watching

Wednesday, March 18, 2015

Clear Map Drive User Login Cache


Clear Map Drive User Login Cache
Environment: Windows 7


You may experienced that you tried to mapping network drive resource with different credentials, but, the connection has not been closed properly, then, you try to clear the drive mapping by Command Prompt like
#net use <Something> /delete


But no luck. Actually, Windows may memorized the credential and cannot clear by restart or re-login.
You need to clear it by yourself as shown below

Control Panel





On the left hand side
 


then, You will see a list of Windows Credentials, just delete at your will.


Friday, December 26, 2014

Update HOST file in Mac OS X

Update HOST file in Mac OS X
Environment: Mac OS X


Host File Path: /private/etc/hosts

#sudo nano /private/etc/hosts

Saturday, May 17, 2014

Shopping Cart with phpmailer - Unable to connect to server / Could not instantiate mail function in PHPMailer

Shopping Cart with phpmailer - Could not connect to server /  Could not instantiate mail function in PHPMailer
Environment: Centos 6.4 / 


I spent a long time on this fucking damn problem, so I hope it can give you some clues on your situation.

Symptoms:
I configured the smtp servver with port number, but it keep pop me a message saying could not connect,
I able to telnet the SMTP server on the machine, and send mail in command mode, iptables allows those traffic,
but, phpmailer keep fail me no matter the mode I configure [SMTP / mail / sendmail]

I don't waste your time to read my investigation, let's see the solution

Solution:
It caused by the module SELinux is enabled in Linux, which blocked all the mail sent through httpd

you can checked the status of your system by the following command


plus, you should check the parameter httpd_can_sendmail is off or not.


if SELINUX is enforcing & httpd_can_sendmail is off, that's the reason the connection was failed.
input the command below to turn is on




In my case, the email feature resumed normal, hope it can help you

延伸閱讀 Extended Reading
What is SELinux?
will be answer on my next post.

Sunday, February 02, 2014

PDF is Corrupted in WP Download Manager

PDF is Corrupted in WP Download Manager
Environment:Wordpress 3 with plugin Ngg Gallery & WP Download Manager

I've encounter a problem with wp download manager.
I setup a download page with the plugin, to letting people download PDF from the website

The page looks good, and the files are able to download, but, the PDF is corrupted after uploaded.
The PDF was no problem before upload to the site, after searching around, I got the answer from WP forum.

The cause is WP Download Manager cannot live with another plugin "NGG Gallery"

Thanks god,  there is a workaround from the expert:
Place the function to
/plugins/download-manager/download-manager.php




function wpdm_skip_ngg_resource_manager($r){
    return false;
}
add_filter('run_ngg_resource_manager', 'wpdm_skip_ngg_resource_manager');

So, they don't need to separate with each other forever and ever.


延伸閱讀 Extended Reading
Any Side effects?
At the moment, No.

What's  run_ngg_resource_manager?
It is a new function which introduced in version 2.0.11 NGG Gallery.

The Change Log & Description as below:
NEW: Added “run_ngg_resource_manager” hook to by-pass our resource manager




Tuesday, October 22, 2013

Install Python 3 on CentOS 6.4 minimal


Install Python 3 on CentOS 6.4 minimal
Environment: CentOS6.4 minimal


Require Package (C Complier)
#yum groupinstall "Development Tools"

Go to desired path for store the downloaded file. e.g.
#cd /tmp

Download Python 3.3.1
#wget http://python.org/ftp/python/3.3.1/Python-3.3.1.tar.bz2
Latest Version: https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz

unzip into current directory
#tar xf Python-3.3.1.tar.bz2

Configure Script
#cd Python-3.3.1
#./configure --prefix=/usr/local


Install
#make 
or
#make altinstall

PS: 
For the version 3.4, pip is included in Python package. 
You may get the following error, which means you have not install "Development Tools" well
Ignoring ensurepip failure: pip 6.0.8 requires SSL/TLS


Check if installed
#python3.3 --version


Optional:
There are python2.6 & 3.3.1 in my CentOS concurrently.
When I call "python", the version is 2.6.
I would like change it instead of typing in "python3.3" every time, so just link it up as below
PS: The path may be different.
#ln -sf /usr/local/bin/python3.3 /usr/bin/python

Don't do the strike through procedure above, it will make "yum install" crash.


延伸閱讀 Extended Reading
Why need to install C Compiler?
"Configure" Script checks the dependencies. C compiler is required in the installation procedure.

What the difference between "make install" & "make altinstall"?
"make altinstall" avoids the conflict with the current and existing package in OS

What is the parameter "xf xvf" of TAR?
x means "Extract"
v means "be verbose" (list files being processed)
f means "to file"

here is some basic options...

       Operations:
       [-]c --create
       [-]d --diff --compare
       [-]r --append
       [-]t --list
       [-]u --update
       [-]x --extract --get       

       Common Options:
       -C, --directory DIR
       -f, --file F
       -v, --verbose
       -z, --gzip


The details of the parameter & common option, please refer to the damn boring GNU manual below
http://www.gnu.org/software/tar/manual/html_chapter/Tutorial.html#SEC10