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
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.
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
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.
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.
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.
Manage Simple Product Stock in WooCommerce
To manage stock of a product that’s not variable, it’s done on the product inventory tab.
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.
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)
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:
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:
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).
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:
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.
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.
I had a heck of a time trying to figure out how to install Tor onto my Linux box, and finally did figure it out, so I thought I’d give a little tutorial on it.
Basically, the issue I was having was that:
sudo yum install tor
was returning the error that no package named tor existed.
Sure, you might be able to build the source files, but in my experience that wasn’t installed, and trying to install it came up with more dependencies that could not be installed or found. This is the sound of spinning tires.
The first three items on the Expert Guide at Tor provide details on how to install Tor. They might change, and in the best interest of security, I’m going to say go there to find out where to get the install files.
If you’re using Fedora or CentOS, see this guide on Finding a List of Your Repos on your Operating System (OS), which will most likely be some sort of UNIX Linux distro since Windows machines don’t have repos!
The short solution is:
yum repolist all
– shows you a list of all repos available on your computer
sudo vi /etc/yum.repos.d/epel.repo
– opens the EPEL repo for editing, as it’s likely you have something in here that’s not enabled yet that will work
On Linux, there are very handy tools to install packages for the user. Mainly, there are:
(note: I’m going to go through this guide assuming you’re using yum on an Fedora/CentOS/Linux Operating System, but similar solutions exist for each.)
These will automatically search repos – which are repositories of packages, or programs, that the user may want to use – download, and then install the packages for the user. This means that instead of downloading the install package, locating it, double clicking on it (Windows Operating System (OS)), and then following the install instructions, you simply run a command such as: apt-get install python <- and it will download and install python for the user.
However, some distrobutions of Linux don’t come with the most extensive repos enabled. My recent trouble was with Amazon Linux, but I’m sure you’ll have your own distro.
An indication that you need to add more repos to your OS would be when you go to install a package, following along the instructions from the package website, and you get an error saying no package exists.
BUT THE WEBSITE SAYS IT’S THIS EASY. I know. It’s frustrating.
However, the solution is fairly straight forwards. You can probably search around for all sorts of crazy repos out there, which could also be a security hazard because you might get into downloading pretty sketchy versions of software from the outdated repo… but I suggest add the big Extra Packages for Enterprise Linux (EPEL) repository. Sounds scary, and it should be. There’s a lot of packages on there.
It is advised to take a look at your current repo list using:
yum repolist all
For me, this list was very short (I had two Amazon repos listed).
You can then add repos a few ways. But first, it might be smart to have a look and see if there are already repos that exist, and they are just disabled, using the command:
sudo vi /etc/yum.repos.d/epel.repo
tip: to see a list of repos available to Yum, just search the dir: sudo ls -la /etc/yum.repos.d/
If this file exists, you’ll see a few additional repos that you never knew you had! Look for a line that says enabled=0, and switch this to enabled=1. I would suggest picking the one that doesn’t have debug or source in it’s name, as those might have packages that are in beta modes (I don’t know really what the difference is, I’d love if somebody shared what the difference is in comments below).
Then if you try and install your package again and it still can’t find it to install, you might want to manually add the repo to your repo list using: