Wednesday, 9 November 2016

Ruby Gems installation - Certificate Verify Failed (WINDOWS)

If you get an error about the certificate when you try to install ruby gems on Windows, like this one:

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed

And nothing has worked, try the following:

  1. Download the latest ruby gems .ZIP file from here
  2. Unzip into a directory and cd there.
  3. Install with: ruby setup.rb (you may need admin/root privileges)

After that try to install your gems again.

Thursday, 13 October 2016

Promise is not defined Ubuntu

If you get the "promise is not defined" error when you try to build a js promise on Ubuntu, then check the following:

Check your node version
-> nodejs -v

If it's less than version 6.xx then upgrade it
First remove the old version
-> sudo apt-get remove nodejs

Then install the newer version with the following two commands as seen here
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

Tuesday, 8 March 2016

Useful Heroku commands

Here is a list of my most commonly used Heroku commands for managing a rails application.

LOGIN

heroku login

DATABASES

To create a hobby dev free postgres db
heroku addons:create heroku-postgresql:hobby-dev

To drop the database, if you are using SHARED_DATABASE_URL:
heroku pg:reset DATABASE

To recreate the database with nothing in it
heroku run rake db:migrate

To populate the database with your seed data:
heroku run rake db:seed

You can combine the last two into one action by executing this
heroku run rake db:setup

DEBUGGING

heroku logs

Real time tail
heroku logs --tail


ENV VARIABLES

To set an ENV variable
heroku config:set GITHUB_USERNAME=joesmith

To view all the ENV vars 
heroku config

To view a specifig ENV var
heroku config:get GITHUB_USERNAME 

To unset an  ENV var
heroku config:unset GITHUB_USERNAME 
 





Tuesday, 16 February 2016

Bypassing Costa Wifi Time limit

UPDATE: This method has been patched, but at the bottom of this post, there is a much simpler solution that works and hasn't been patched yet, you will need to read the whole thing in order to understand the process.

Costa coffee shops, provide free wifi for their customers for about 2 hours, and then your time limit expires, asking you to register their costa club card(free as well) in order to have unlimited access.
Well you could do that, but if you are lazy like me, going through the process of acquiring a card and then registering it, you could just try this instead.

When your time limit has been reached, a Costa web page appears when you try to browse:



Behind the scenes there is a mechanism(probably their wifi controller) that has identified your computer and redirects to that page when you reach your time limit. To see proof of that, we just need to press back once.


The page above is the actual rediretion that happened too fast to see before. And in the address bar we can see the whole query that was sent. What we can identify from that request is that our computer is tracked by its mac address. If we delete from that query the mac address bits as per the image below:


And press enter to resend the request, we can then successfuly bypass this security mechanism. The same thing could probably be achieved by changing your computer's mac address, but that's too much hustle... Obviously this whole post serves no purpose as you could just register their card... But it might help another lazy or curious soul.

*Update

Instead of deleting the all the personal info from the url bar, just change some digits from your mac address and hit enter!