miloot.com blog

site news and other musings.

How to Change MAC Address on Android Device

| Comments

As a quick continuation to my previous post I also wanted to find out if it was possible to change my MAC address on an Android device.

Lo and behold there is an app for that: Wireless Mac Address Changer for Android

Quick setup
1. Install
2. Allow super user access to application
3. Click “Generate Random Mac”
4. Click “Hard Change My Mac”
5. Disconnect Wifi
6. Turn Wifi On

That’s it, your Android device should now be able to access whatever limited internet provider you like to use.

Enjoy !

How to Change MAC Address on OSX 10.9+

| Comments

Haven’t updated this blog in a while, which is a bit unfortunate, but hopefully this will be start of many new posts.

I am currently on vacation and finding internet access can be a bit tricky.

Fortunately I found that XFINITY WiFi offers free hourly internet. Unfortunately this only allows one hour every 24 hours up to two times.

Obviously this is not enough so I decided to poke around and see if I could sniff out how this was working.

By examining some of their post requests I found that they are simply limiting access by tying their network to your MAC address.

Easy !

I wrote a little script that will change my Macbooks MAC address ( until a full restart occurs ) and get around this pesky limitation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

# Change your network inteface ID here network interface here
INTERFACE=en0

ORIGINAL_MAC=`ifconfig $INTERFACE | grep ether | cut -d' ' -f2`

MAC=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`

echo "Intial status:"
sudo ifconfig $INTERFACE

DISCONNECT_NETWORK="sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z"

echo "Disconnect from current network"
eval $DISCONNECT_NETWORK
sleep 2

echo "Changing interface mac"
sudo ifconfig $INTERFACE lladdr $MAC
sleep 2

echo "Shutting down interface: $INTERFACE"
sudo ifconfig $INTERFACE down
sleep 2

echo "Starting up interface: $INTERFACE"
sudo ifconfig $INTERFACE up
sleep 2

echo "MAC changed from: $ORIGINAL_MAC to: $MAC"
echo "Retrieving new network status:"
sleep 10
ifconfig $INTERFACE

In addition I added the following just to make things a bit easier.

1
2
3
4
echo "Launching xfinity login page"
URL="https://wifilogin.comcast.net/wifi/start.php?cm=$MAC&tm=xfw01&bn=st02"
sleep 5
open -a "Firefox" $URL

I was going to script the whole network execution using cURL but haven’t had the time yet … maybe next time.

And as always please use at own risk, I provide no guarantees :)

Install PG Gem With Postgres.app on Mac OSX

| Comments

Recently when updating a Gemfile I came across the following error:

1
Can't find the 'libpq-fe.h header

It appears that since I am using Postgres.app instead of a more direct installation ( ala brew install pg ) some of the headers are undefined and not accessible by the gem install command.

To get around this problem I came across the following post from Programming Tidbits

Unfortunately did this not work for me as it appears that with the updated version of Postgres.app the folder structure is a bit off.

I had to modify the commands to the following

1
2
3
export CONFIGURE_ARGS="with-pg-include=/Applications/Postgres.app/Contents/Versions/9.3/include/"

gem install pg

After this everything installed correctly and I was able to resume my work.

Hopefully this helps someone out.

How to Setup Apache With Passanger + HTTPS and Rails

| Comments

It’s always interesting to see how one can replicate the functionality of a known development environment ( the world of Java Web Apps in my case ) inside of a new environment, Rails. One of the exercises I was trying to mimic in Rails was having some traffic go over HTTP and some go over HTTPS.

There is a strong movement to have all traffic go over HTTPS but since it is a bit more costly ( ex: having SSL certs for a CDN so your images don’t pitch “unsecure” errors ) it is still nice to segregate the secure from the non secure parts of your application.

Below is a step-by-step guide to getting this configuration up and running. Pardon some of the brevity but some basic amount of Rails, Passenger and Apache knowledge is required.

How to Delete All Lines in a File Using Vi or Vim

| Comments

Working with Octopress I tend to do a lot of editing in an offline text editor ( Sublime ) and then copy / pasta the content in my “_post/*.markdown” files.

For a while I ended up deleting the file and recreating it using “cat” but this was a bit cumbersome.

Decided to open up the old Google and dig up how you can do this quicker.

Solution #1
1. Type gg to go back to the start of the file
2. Type dG to delete all lines

Solution #2 ( bit more elegant )
1. Type %d to delete all the things

Hope this helps someone out.

iWork for Free in OS X Mavericks

| Comments

OS X Mavericks allows you to go from a trial version of iWork 6 to a brand spanking new version with a few simple steps.

Not sure if this is intentional but so far I haven’t heard of any issues with this approach.

Here is how you do it:

  1. Quit the App Store app
  2. Visit http://mac.softpedia.com/get/Business/Apple-iWork-06.shtml
  3. Click Download
  4. Click External Mirror 1
  5. Download and Install the DMG file
  6. Open up at least one of the applications and select 30 day trial
  7. Wait a few minutes ( 1-2 min )
  8. Open up the App Store app
  9. Check the Updates tab and you should see an update for iWork
  10. Install updates
  11. You will now have two copies of each application ( Pages, Keynote, Numbers ). Erase the old ones from the iWork folder.

That’s about it. Feel free to launch one of the apps and validate that they work but you should now have fully licensed copies of all the apps.

Enjoy !

Source: http://reddit.com/r/apple

OS X Mavericks + Echange + Mail.app

| Comments

I recently upgraded to the new version of OS X Mavericks and have been enjoying all the various new features ( power saving is pretty great ! ). But I found that my Mail.app was behaving strangely while connected to Exchange 2010. Specifically it was not retrieving new email messages. I had to shut down the app and restart it to get a flutter of emails coming in. This obviously was not very convenient.

Doing a bit of experimenting I found that the problem lies somewhere in the “retrieve emails automatically” setting. Not sure why ( console appears to have no good errors ) but it is the culprit.

So if you are experiencing the same problem do the following

  1. Open Mail.app
  2. Go to “Preferences”
  3. Set the “Check for new messages” to “Every minute”
  4. Watch email stream in

Here is a quick shot of the setting I was talking about

images