Thunderbird Contact or Address Book Synchronization

program: Mozilla Thunderbird
add-on: gContactSync
address book: Google/Gmail

About Mozilla Thunderbird

Mozilla Thunderbird is software that acts similar to Microsoft Outlook whereas it allows you to send and receive emails from the desktop of your computer.

As an additional bonus, it also allows you to synchronize various other features of your email address providers (like Gmail or Zoho Mail) like a calendar, or an address book.

gContactSync Add-on for Mozilla Thunderbird

Mozilla Thunderbird has an addon called gContactSync. gContactSync is an add-on that synchronizes contacts between Google (Gmail) and an Address Book in Thunderbird. You can synchronize multiple accounts with multiple address books, and it fully supports regular and hosted Google Accounts.

To install, select Tools -> Add-ons

Search for gContactSync and click install.

Once installed, you will be prompted to restart Thunderbird.

Adding Accounts to gContactSync

In the top menu bar in Thunderbird, you will see a new item called gContactSync. This is what you’ve just installed! To add a new email address contact list, simply click the menu item: gContactSync -> Add Account. Follow the on screen prompts to connect your Google account.

This will likely be your one central address book that you synchronize all your other local (in Thunderbird) addresses to.

Edit Account Synchronization Settings in gContactSync

gContactSync Edit Account Settings

Once you’ve added the accounts you wish to have synchronized, you’ll be able to choose how you want the synchronization to happen.

What I like to do is have a central account that all others synchronize to. All in one spot that that on my phone I can just have the one address book synchronized. This is accomplished in the ‘Pick the direction for the synchronization‘ option, where one selects ‘Write only‘ (image above shows ‘Complete‘) if you wish to send the contacts to your Google Address Book, and not read all the addresses from the Google Address Book and put them into that local address book – doing this would create a copy on the Google Address Book and the local address book associated with the account selected for editing.

One can also disable synchronization of the address book, or re-enable the address book synchronization if there has been an error that has disabled it.

Hope this helps!




HTTPS : Your Connection To This Site is Not Fully Secure

software: WordPress
plugin: Really Simple SSL

The Problem: Browser Error | Your connection to this site is not fully secure

So, you’ve gone through all the troubles to setup an SSL certificate for your website and then you browse to the front end with Google Chrome (the one strong arming this SSL certificate issue) and you get an error:

Your connection to this site is not fully secure. Attackers may be able to see the images you’re looking at and trick you by modifying them.

HTTPS Not Fully Secure warning on Google Chrome

The Solution: Make Your Site True HTTPS Redirect

One would have thought that simply activating the SSL certificate in the server side of things would have done everything necessary for SSL.

However, SSL needs to be enforced on the website as well for nearly all links (which includes images). This means everything gets forced to be served over HTTPS instead of HTTP and/or is served from secure third party suppliers. Fortunate for us savvy WordPress’ers, there’s a plugin that forces this, aptly named: Really Simple SSL.

Really Simple SSL for WordPress

Click Install Now -> Activate -> Go ahead, activate SSL!

Once you activate Really Simple SSL in the WordPress Plugin install dashboard, you’ll get a finally step to activate the plugin by finalizing the migration my manually doing some back end things:

If you’re a risk taker, you can just click: Go ahead, activate SSL and see what happens.

If you’re a stickler, you can scan every single file on your website to follow the advice about changing any reference to HTTPS instead of HTTP, and making sure scripts are all from a domain with an SSL certificate.

At first glance, I had a few dozen .css and .js file for just one site that had houndreds of lines of code to scan, so I took the risk and it all worked out OK.

Hope this helps!




How To Manage Stock of a Variable Product in WordPress’ WooCommerce e-Commerce Plugin

software: WordPress
plugin: WooCommerce

Holy that title was a handful to write, but I think it says exactly what we’re going to do here today. This article will make the assumption that you have WordPress installed as well as the plugin WooCommerce.

Add New Product | WooCommerce

To start, you must create a new product. On your Dashboard, left hand menu -> Products -> Add New Product

Woocommerce - add new product
Woocommerce – add new product

I will also now assume you know how to edit the Product Description for this product. However, we’re going to now browse to the Product Data, and let WooCommerce know this is a Variable Product, which means that when users are checking out the product, they have a few options to select between.

Woocommerce - Variable product
Woocommerce – Variable product

Defining Product Attributes | WooCommerce

Once you describe this product as a Variable Product, we now need to let WooCommerce know what the variations are! These are known as Product Attributes

WooCommerce - Global Attributes
WooCommerce – Global Attributes

I will show you how to do in product definitions of the Attributes, but there is also a broader global attribute definition that is very handy when you have multiple products that will have the same variables (think t-shirt sizes S-M-L-XL for example).

When you click on Add New Custom Product Attribute, it will first ask you for a name, and then ask you to define the attributes. This is fairly straight forward, done much like you would add tags to a Post.

WooCommerce - Attributes
WooCommerce – Attributes

Please note that selected on this page is “Used for variations” and not selected “Visible on the product page”. I know, it’s hard not to want to have that second one selected.

Define the Product Variations | WooCommerce

Once you have saved attributes, now select Variations from the left menu and select Add Variation. This will pop up a new variation that will have a drop down list of the values you defined in the Attributes section.

WooCommerce - Add variation
WooCommerce – Add variation

Managing Stock of a Custom Attribute Variation | WooCommerce

As you can see in the image above, I’ve created the variation of Medium and Large. There are two ways to manage stock of items, one is on the product level and the other is on the variation level. If you expand the variation you’re looking to manage stock on (I’ll do Large for this example) you will see an option to select Manage Stock, and then a value bar open up where you can say how many you have in stock.

WooCommerce - Manage Stock on Custom Variation Attribute
WooCommerce – Manage Stock on Custom Variation Attribut

Manage Simple Product Stock in WooCommerce

To manage stock of a product that’s not variable, it’s done on the product inventory tab.

WooCommerce - Enable stock management at product level
WooCommerce – Enable stock management at product level

Hope this helps!





Installing PhantomJS on Amazon Linux / Fedora / RedHat / CentOS over SSH

OS: Amazon Linux / Fedora / Redhad / CentOS
method: SSH
program: PhantomJS
dependency: Python

What is PhantomJS

PhantomJS is what is known as a headless web browser. This means it’s a web browser like Firefox or Google Chrome, without the bulky window that you’ve become very familiar with. This is great for program testing and website testing using scripts. It greatly reduces load time and thus makes testing a breeze.

Recent news shows that Google has decided to release their own headless version of Chrome for their extensive testing they do, and Firefox has been on that bandwagon for a long time now too. Which version you pick I will not discuss here, but this tutorial is for PhantomJS on a Linux computer over SSH.

Installing PhantomJS on Linux Computer over SSH

It was incredibly frustrating for me to find how to install PhantomJS onto my computer since it’s a Linux Amazon distro, which is a stripped down version of Linux meant for running on Amazon’s EC2 cloud computing servers.

However, it uses yum so that gives us a hint that much of the tutorials for CentOS or RedHat will work with this.

 

Build PhantomJS

note: there was a suggestion on PhantomJS webpage that one should just download the package and install it simply, with some dependencies, however, I wasn’t able to get this working so I defaulted to Build.

I am assuming you have Python installed. You’ll need it. (to install it, type: sudo yum install python3.4)

Make sure that git is intalled:

sudo yum install git

Directly from the Build PhantomJS page, we’ll first install the dependencies:

sudo yum -y install gcc gcc-c++ make flex bison gperf ruby \
openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel \
libpng-devel libjpeg-devel

Next, we’re going to add the git and download the source to begin the build, which you type into your SSH window one line at a time, pressing enter at the end of each line:

git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 2.1.1
git submodule init
git submodule update

python build.py

This last command (build.py) will prompt you with an alert that it will take some time, of which you type Y for yes, continue.

Once it is completed, the executable will be available under the bin subdirectory.

Linking the executable in the Bin SubDirectory

Once this is complete, you’ll still not be able to run PhantomJS unless you ensure that the location of the PhantomJS file is included in the system $PATH. This is the way for the system to know what you mean when you type into the command window: phantomjs.

The bin subdirectory is most likely going to be located in the folder where PhantomJS was installed to, which if you weren’t running sudo for the above, is going to be: /home/user/phantomjs/bin/

To view the directories that are included in your system path, type:

echo $PATH

This will give you a list of locations that are included in the PATH, seperated by a semi-colon ;. There is most likely the dir: /home/user/bin included in this path, so instead of adding a new symbolic link (ln) or adding a new dir to the path, I just copied the phantomjs executable into this bin folder.

note: keep in mind, ‘user’ here is your Linux user, so it may be another name.

If you run the command:

sudo ls -ln /home/user/

and don’t see a /bin folder in there, you’ll have to first create one:

sudo mkdir /home/user/bin/

then you can copy the phantomjs executable to the /bin/ folder:

sudo cp -Rp /home/user/phantomjs/bin/phantomjs /home/user/bin/

make sure it’s been copied over successfully:

sudo ls -la /home/user/bin

which will hopefully show you your phantomjs file!

Test PhantomJS

No point dusting your hands off yet, who knows if it’s really worked?! Time to test.

I’ve taken this code from the PhantomJS Quick Start page, that will check how quickly you can view a page using the PhantomJS headless magic:

var page = require(‘webpage’).create(),
system = require(‘system’),
t, address;

if (system.args.length === 1) {
console.log(‘Usage: loadspeed.js <some URL>’);
phantom.exit();
}

t = Date.now();
address = system.args[1];
page.open(address, function(status) {
if (status !== ‘success’) {
console.log(‘FAIL to load the address’);
} else {
t = Date.now() – t;
console.log(‘Loading ‘ + system.args[1]);
console.log(‘Loading time ‘ + t + ‘ msec’);
}
phantom.exit();
});

To run this, create a new file called loadspeed.js, which we’ll do without sudo permissions:

vi loadspeed.js

Then copy the code above, and right click in the SSH terminal to paste it all in. Then type: ‘:wq’ to save the file and exit.

Now we run this little codelet to see how fast it will load google.com with:

phantomjs loadspeed.js http://www.google.com

So, how quickly did yours load? Mine:

load time for google

Hope this works!

 

Resources:




Creating Multiple Instances of Tor, Giving Multiple IP Addresses

OS: Amazon Linux / Linux / CentOS / RedHat
Package: Tor (the Onion Router)

Tor is a anonymizing tool used around the world in various security scenarios. Even just for the regular Joe wanting to keep their browsing relatively anon, it’s a great tool. If the world was made up of everybody making it hard for people to spy on us, there would be a lot less spys, so the theory goes.

Depending on what you’re doing, you might want to tell Tor to launch a few different instances. This will provide you with a few different routes or onions (if I may) to even moreso anonymize your internet browsing.

This tutorial will be about doing this through command line (SSH).

First, we must make sure that Tor is installed. For installation instructions of Tor, please refer to this blog.

To check whether Tor is installed:

sudo /etc/init.d/tor status

Which should show you something like:

tor is running (pid: 2944)

Now stop Tor so that we can edit the config file:

sudo /etc/init.d/tor stop

which should show you:

Stopping tor: [ OK ]

Creating Multiple Tor Instances

To make Tor work, you first send your local requests to your localhost (almost always 127.0.0.1), which then re-routes the request through the defined SOCKSport (you’ll learn that in a second), which then goes through the Onion (jumps from IP to IP to anonymize your traffic) and then finally reaches your destination.

There have been some instructions out there to make multiple Tor configuration files that would then get started each themselves, but I haven’t been able to find any benefit to doing it this way, and every instruction I’ve come across severely lacks any extensive configuration details which worries me about security that should be involved in the configuration itself, not to mention the pain of having to start four – or as many as you make – unique instances in the first place. So..

First, we will edit the Tor configuration file, torrc:

sudo vi /etc/tor/torrc

In this file, look for:

SocksPort 9050

and add just below this, so it looks like:

SocksPort 9050
SocksPort 9060
SocksPort 9070
SocksPort 9080

note: you can choose whatever port you wish here except for the very next port. So, port 9051 don’t pick, but you can pick 9052, but then you couldn’t pick 9053 for the next because the very next port is required for the next part.

Then keep looking for:

ControlPort 9051

and add just below it, so it looks like:

ControlPort 9051
ControlPort 9061
ControlPort 9071
ControlPort 9081

Type :wq to exit vi. Then start Tor again:

sudo /etc/init.d/tor start

which should give you something that looks similar to this:

Start Tor Confirmation

From this, we can see that we have four Socks and four Control ports opened up for Tor.

Now, to test.

curl –proxy socks5h://localhost:9050 http://ipinfo.io/ip

This will return an IP. Now do this for all four of the different ports opened (9050, 9060, 9070, 9080) and you should see that each time that you do this, it returns a different IP address. Then do the first one again, and likely it will be the same as it was the first time.

Go ahead, play with this!

 

Additional Resources: