Thoughts & Experiments.

by Shahzeb K

Read this first

Redis won’t talk to Web Server.

redis-aws-love.png

 The Problem:

Thinking you’ve correctly configured everything in your shiny new cloud architecture, and having a key piece not work properly can be extremely frustrating.

For me, it was trying to get a web server (on EC2) to talk to a Redis cluster (on ElasticCache).

Trying to use redis-cli on my local machine kept getting me to this point:

Could not connect to Redis at xxx.usw2.cache.amazonaws.com:6379: Operation timed out

This is when I found out that Redis by default isn’t meant to be accessed from outside the sphere of AWS. Since I was running redis-cli from my laptop, this wasn’t going to work.

The next logical step was to SSH into my EC2 machine, and then run the redis-cli command to try and PING the Redis host. But this method also ran into the timed out error.

Since the machine on AWS couldn’t even produce a handshake with the Redis host, this is when I knew that there

Continue reading →


A look at DynamoDB Key’s.

dynamodb-aws-keys.png

Today, coming primarily from a MySQL background, I realized that choosing the right DynamoDB data structure requires some thinking. Here are some things I wish had been clearer before I started:

The situation:

  • In an Express.js Application, I am trying to access all the records from DynamoDB table.
  • I am following the Node.js documentation for Query’s.
  • Keep coming across a database error about keys. Unable to access any data.

For the sake of this situation, let us imagine that we are creating a table in our DynamoDB database which will hold Tweets from different users.
We should be able to:

  1. Loop through the Tweets of a specific user in chronological order.
  2. Get a specific Tweet from a user.

PartitionKey
Image from the AWS blog.

 What is the Primary Key?

A unique identifier which identifies a single record in the database. This Primary Key is the combination of the Partition Key and Sort

Continue reading →


Launch a website for free.

website.jpg

Being able to launch a website for free* is really easy these days.

I prefer writing vanilla HTML / JS / CSS. But to make my life a bit easier, I think I’ll be switching over to using Cactus.

 Developing your site

  • Write HTML / JS / CSS in some folder called website
  • cd into that website folder and run the following command in terminal: python -m SimpleHTTPServer 8000. This will actually serve the website on http://localhost:8000. As a bonus tip, you should edit your ~/.bash_profile file and set alias pythonserver='python -m SimpleHTTPServer 8000'. This will allow you to run the pythonserver command instead of having to memorize all that python gibberish.

 Launching your website

When it comes to deploying your website for the world to enjoy, you have a couple of options.

Options #1: Use github pages. This is a great option for people who are comfortable using git. Basically

Continue reading →


3 apps that every college student should use

These apps will super-charge your life. They’ll make you more productive than you’ve ever been. They’ll pretty much write that 900 word essay you’ve been procrastinating on.

Here’s a list of 3 incredibly sexy apps that are available on all platforms (Mac / iPhone / Android / PC). There are a lot of great apps out there that can achieve the same thing, but these apps will work no matter what device you’re on.

 Sunrise

 The calendar app you’re not too sure how you lived without.

sunrise.png

This app can connect to just about any type of calendar service. I have it connected to my Google and Facebook accounts. It makes staying up-to-date dead simple. For instance, I have a “classes” tag where I add all my class discussions / lectures from SmartSite and set the events on repeat. And thanks to it being connected to Facebook, any event I click “Going” on will also appear in this calendar. It also

Continue reading →


“Work like hell”

 If other people are putting in 40-hour workweeks, and you’re putting in 100-hour workweeks, then, even if you’re doing the same thing, you will achieve in four months what it takes them a year to achieve.

– ELON MUSK

Continue reading →