Lazy Programmer

Your source for the latest in deep learning, big data, data science, and artificial intelligence. Sign up now

How to setup a custom domain with SSL and Medium.com with CloudFlare

October 27, 2016

This short tutorial will show you how to setup a custom domain with SSL and Medium.com with CloudFlare.

To start, you of course must own the domain, let’s call it example.com.

Suppose you want your Medium blog to have the address blog.example.com, to differentiate it between your main site.

If you have your DNS configured to point to CloudFlare (highly recommended so traffic doesn’t always hit your server directly), then it’s a little trickier than Medium.com’s default instructions, which are posted here:

https://help.medium.com/hc/en-us/articles/213474588-How-do-I-set-up-a-custom-domain-

As stated in the article, the first step is to fill out a form, and someone from the support team will get back to you with configuration details.

When you get a response, login to your CloudFlare account and click the DNS tab:

step1

There are 2 types of records you have to add, CNAME and A Records.

We will start with CNAME.

You will get a name-value pair that looks like:

<token>.blog.example.com

And

<token2>.comodoca.com

The email will tell you that you can enter the name as <token>.blog.example.com OR just <token>.blog. I have found the latter to work.

You will enter the CNAME record as follows:

step2

Finally, you will receive a list of A Records to add. These should be added under the “Value” column. The “Name” column should just be “blog”.

step3

And that’s it! Easy peasy.

Go to comments


Announcing Data Science: Supervised Machine Learning in Python (Less Math, More Action!)

September 16, 2016

supervised-ml-small

If you don’t want to read about the course and just want the 88% OFF coupon code, skip to the bottom.

In recent years, we’ve seen a resurgence in AI, or artificial intelligence, and machine learning.

Machine learning has led to some amazing results, like being able to analyze medical images and predict diseases on-par with human experts.

Google’s AlphaGo program was able to beat a world champion in the strategy game go using deep reinforcement learning.

Machine learning is even being used to program self driving cars, which is going to change the automotive industry forever. Imagine a world with drastically reduced car accidents, simply by removing the element of human error.

Google famously announced that they are now “machine learning first”, meaning that machine learning is going to get a lot more attention now, and this is what’s going to drive innovation in the coming years.

Machine learning is used in many industries, like finance, online advertising, medicine, and robotics.

It is a widely applicable tool that will benefit you no matter what industry you’re in, and it will also open up a ton of career opportunities once you get good.

Machine learning also raises some philosophical questions. Are we building a machine that can think? What does it mean to be conscious? Will computers one day take over the world?

The best part about this course is that it requires WAY less math than my usual courses; just some basic probability and geometry, no calculus!

In this course, we are first going to discuss the K-Nearest Neighbor algorithm. It’s extremely simple and intuitive, and it’s a great first classification algorithm to learn. After we discuss the concepts and implement it in code, we’ll look at some ways in which KNN can fail.

It’s important to know both the advantages and disadvantages of each algorithm we look at.

Next we’ll look at the Naive Bayes Classifier and the General Bayes Classifier. This is a very interesting algorithm to look at because it is grounded in probability.

We’ll see how we can transform the Bayes Classifier into a linear and quadratic classifier to speed up our calculations.

Next we’ll look at the famous Decision Tree algorithm. This is the most complex of the algorithms we’ll study, and most courses you’ll look at won’t implement them. We will, since I believe implementation is good practice.

The last algorithm we’ll look at is the Perceptron algorithm. Perceptrons are the ancestor of neural networks and deep learning, so they are important to study in the context of machine learning.

One we’ve studied these algorithms, we’ll move to more practical machine learning topics. Hyperparameters, cross-validation, feature extraction, feature selection, and multiclass classification.

We’ll do a comparison with deep learning so you understand the pros and cons of each approach.

We’ll discuss the Sci-Kit Learn library, because even though implementing your own algorithms is fun and educational, you should use optimized and well-tested code in your actual work.

We’ll cap things off with a very practical, real-world example by writing a web service that runs a machine learning model and makes predictions. This is something that real companies do and make money from.

All the materials for this course are FREE. You can download and install Python, Numpy, and Scipy with simple commands on Windows, Linux, or Mac.

https://www.udemy.com/data-science-supervised-machine-learning-in-python/?couponCode=EARLYBIRDSITE

UPDATE: New coupon if the above is sold out:

https://www.udemy.com/data-science-supervised-machine-learning-in-python/?couponCode=SLOWBIRD_SITE

#data science #machine learning #matplotlib #numpy #pandas #python

Go to comments


How can I determine the size of a directory or folder in Linux?

May 1, 2016

du -hs /path/to/directory

-h: human-readable
-s: summary (don’t show size of each individual file within the directory)

#command line #linux #ubuntu

Go to comments


Where to get cheap web hosting: GoDaddy vs. BlueHost vs. etc…

November 23, 2015

My brand-spanking new blog software told me that this title was too long: GoDaddy vs. BlueHost vs. DreamHost vs. Hostgator vs. Namecheap

Read all the way to the end if you want to find out who I chose, why it took me so long to choose, and for some nice discount buttons.

If you noticed, there’ve been some subtle changes on this site lately.

In actuality, the site has gone through a complete overhaul. I tried my hardest to create my own WordPress theme to be exactly like the old theme (which was hosted on Tumblr), with a few enhancements.

So as you probably already know, WordPress needs to be hosted on paid servers that have PHP installed. The typical players are GoDaddy et al. (the ones listed above, except for Namecheap). For the somewhat technical, your site needs to live on boxes like these:

I moved all of my domain names to Namecheap from GoDaddy awhile ago when I read about some of their shady business practices (they initially supported SOPA).

So I’m browsing around, basically just price-shopping. I know all these companies have bad reviews for poor customer service. I try to do my due diligence by noting the percentage of downtime and cPanel features. But really I just want a good price on hosting so I can test out new sites cheaply and efficiently.

Most of these guys have a 1-3 year discount rate, something like $6.99/month if you sign up for 3 years. Then it goes up to $11.99/month after that.

I’m not going to list the exact prices here because they are always changing, but approx. $5+ to approx. $10+ after the discount period is typical. The problem is, most of these sites don’t post their non-discount rate.

As a sidenote, I’ve noticed lately that a lot of sites, including banks, who you’d think would be more professional, have a lot of footnotes. Like this.1

And then, nothing on the page actually explains what it refers to. It’s like saying, “read the fine print if you want to understand how we’re going to fuck you”, and then just excluding that fine print, in hopes you’ll just forget about it.

Alright, lemme talk to their support guys to tally up what everyone’s non-discounted rate is. This helped me narrow down my options a little bit. HostGator’s support was very unhelpful. I partly wrote this post to tell you not to use HostGator. After some time doing this it hit me… Namecheap offers hosting.

I’ve been using Namecheap for years for my domains, and I’ve found their user interface and support to be above par. I look up their rate for shared web hosting and to my surprise, it’s $19.88 for the first year. After this discount period, it goes up to $78.88, which is $6.57 / month, which is way better than what everyone I mention above provides.

If you use the coupon code COOLDAYS you can get 20% off, which means you’ll only pay $15. This is basically just above $1 / month. I think (not 100% sure) the coupon code only lasts until the end of November, so get that shit now.

And since Namecheap sucks at advertising their hosting, which is why I almost signed up for an inferior service instead of theirs, I am going to post some buttons here in case you’re looking for a new domain, web hosting, and a free WhoIsGuard (so people can’t stalk you on the net, since by default your full name, address, and email are shown when someone looks you up).

Namecheap.com

Namecheap.com

Full disclosure, these are referral links, so buying from these links helps me too and helps keep this site up. =)

Namecheap.com

It’s entirely possible I haven’t covered a really awesome, cheap web host in this post, so if I missed something, please let me know in the comments below.

#bluehost #cheap web hosting #coupon code #dreamhost #godaddy #hostgator #namecheap #web hosting

Go to comments


Point your Namecheap domain to your Heroku app

December 3, 2014

Fiddled around with this for way too long, because with the instructions you get from Namecheap, you will end up in an infinite redirect loop using mydomain.com instead of www.mydomain.com.

First, to get to the correct page, go to My Account -> Manage Domains -> Modify Domain and choose “All Host Records”.

Then, instead of how Namecheap tells you to do it, where you have 2 entries like this:

You instead have these 3 entries:

See the image below.

#heroku #namecheap #url forwarding

Go to comments


List of high PageRank Blog Directories for SEO – I’ve prescreened these for high PR and ease of use

July 26, 2014

https://gumroad.com/l/piRR

#blogs #directories #marketing #pagerank #seo

Go to comments


List of high PageRank Web Directories for SEO – I’ve prescreened these for high PR and ease of use

July 26, 2014

https://gumroad.com/l/qIqC

#directories #pagerank #seo

Go to comments


Install all your statistics and numerical computation libraries for Python in one go on Ubuntu

July 26, 2014

sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

#numpy #python #scientific computing #scipy #statistics

Go to comments


How to password-protect a PDF file on Ubuntu

July 25, 2014

In a terminal, type:

sudo apt-get install pdftk

Then, to add a password to a PDF file, type:

pdftk <input-file> output <output-file> user_pw <password>

Example:

pdftk input.pdf output output.pdf user_pw 1234
#linux #password #pdf #ubuntu

Go to comments


Find and Replace Text from the Command Line in Linux

December 10, 2013

Use sed

sed -i 's/<original_text>/<replacement_text>/' <file.txt>

Example:

sed -i 's/Bob/Alice/' names.txt

Go to comments