LinkShare_468x60v1

Wednesday, December 13, 2017

How to Switch Back to the Old Bookmarks Manager

You can do the following switch back to the Old Bookmarks Manager

1. 在Visit chrome://flags/#enhanced-bookmarks-experiment in the URL address box

2. Search for "Enable Material Design bookmarks"

3. Switch "Default" to "Disabled"

Relaunch the browser and the old bookmark interface will return.

Monday, January 4, 2016

How to enable addon without signing in the Firefox


Firefox start to disable all unsigned add-ons at 2016.

We can enable them by modify the value of 'xpinstall.signatures.required".

Find it and by set it to false typing about:config into the URL bar.


Tuesday, December 29, 2015

How to rewrite outgoing email address in sendmail


We can edit the file below to rewrite outgoing email address.

/etc/mail/genericstable


Add the line below

youraccount [email protected]


regenerate the hash file

makemap -r hash genericstable.db < genericstable



You can also edit /etc/mail/aliases for local accout


Alias to your alias account

youraccount   youaliasaccount


Or alias to your device

youraccount   /dev/yourdevice


Remeber use newaliases to update the hash file

How to disable IPv6 in Postfix

If you send mail to gmail server without correct PTR records, you'll get the reject message below.

"message does not meet IPv6 sending guidelines regarding PTR records 550-5.7.1"

You may update PTR record, or disable IPv6 if you don't need it.


Edit main.cf

Update the value with ipv4 in this line "inet_protocols = all"

inet_protocols = ipv4



You might get another message  "config variable inet_interfaces: host not found: [::1]"

Update the value with 127.0.0.1 in this line "inet_interfaces = 127.0.0.1, [::1]" will solve the problem.

How to rewrite outgoing email address

When we call mail function by php on Linux , we can use postfix.

However, the sender will be always apache or www-data, since the system use default web user name as the sender name.

We can rewrite email of the sender by steps below.

Step 1

Check configuration in php.ini

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
;sendmail_from = ***@yourdomain.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =\r



Step 2

Edit main.cf for postfix

vi /etc/postfix/main.cf



Step 3

Specify the generic map file in main.cf

smtp_generic_maps = hash:/etc/postfix/generic



Step 4

Edit generic file

vi /etc/postfix/generic


Step 5

Specify the mapping address

[email protected]   [email protected]


Step 6

Create postfix db hash file

postmap /etc/postfix/generic


Step 7

Restart postfix

/etc/init.d/postfix restart



You will need use sender_canonical_maps = hash:/etc/postfix/canonical instead if your postfix is earlier version.






Wednesday, September 9, 2015

How to check array in jQuery


var dataarray = ["1", "2", "3"];

if ( $.inArray('1', dataarray) > -1 ) {

alert("checked");

}

How to clone a git branch


Create a new local branch develop and clone from remote branch origin/develop


git checkout -b develop origin/develop


How to list branches

list local branch

git branch

List remote branch

git branch -r

List all branch

git branch -a


How to switch between branch master and develop

git checkout master

git checkout develop


How to copy files/dictionaries from branch develop

git checkout develop  files/*

Monday, August 24, 2015

How to remove function from a jQuery object


The function can be removed from a previously-attached event handler.

eg. Remove submit function from a form element.

$('form[name="formname"]').unbind('submit');

Tuesday, July 28, 2015

Thursday, July 23, 2015

How to Stop Your Mac Book Pro From Freezing with Keyboard & Trackpad Unresponsive


If you can still toggle caps lock and it dones't freeze in safe mode, you can backup and remove the directory below.

/System/Library/Extenstions/AppleIntelHD5000Graphics.kext


Tuesday, March 24, 2015

How to use Replace & ReplaceAll in Java

Replace character

String newstring = str1.replace("-",",");


Replace string

String newstring = str1.replaceAll("[a-z]","0");


Replace string only for first match

String newstring = str1.replaceFirst("[a-z]","0");

Tuesday, May 13, 2014

Validate Email Addresses With PHP preg_match



$email = "[email protected]"

preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", $email)

or

filter_var($email, FILTER_VALIDATE_EMAIL)

[Blog] Php is everything


Category
Information

URL
http://baiyuxiong.iteye.com/

Description
Php is everything...

[Blog] Shane Rutter's Blog



Category
Information

URL
http://shanerutter.co.uk/

Description
PHP PROGRAMMER AND WEBSITE DEVELOPER

[EMZ File Extension] How to open .emz files

File Extension
.emz

Description
A compressed graphics file used by the Microsoft Office Suite and Visio


How to open .emz files

Drag .emz file into word document and drop it.


[Software] FreeFileSync

Category
File Backup

Download
http://sourceforge.net/projects/freefilesync/

Review
You can Backup / Sync files, create a batch file for Windows Task Scheduler.

Wednesday, July 10, 2013

[WebSite Review] HTML5 Responsive Templates

http://html5up.net/

Great site. You can make Responsive pages with their html5 templates.