<commit_before>relaymyhome
===========
OSX Bash Script for automating the process of getting Nintendo 3DS StreetPass hits via Internet Connection Sharing. Gathers the maximum of ten (10) StreetPass hits within a few minutes. Can be re-run many times per day if using "full" mode.

What It Does
============
By setting up your Mac computer to act like a StreetPass Relay, you can get StreetPass tags from all over the world. This script cycles through over 20 of the most popular streams in order to fill up your StreetPass queue in 20-30 minutes. Just set your 3DS down, configure your computer, and run the script.

What You'll Need
================
* A Nintendo 3DS that has **updated firmware (as of August 2013)** with WiFi turned on, all apps/games closed, and in sleep mode (lid closed).
* An Apple computer running OS X (only tested on 10.8 and up, although earlier versions may work as well) with both wired and wireless network interfaces (MacBook Airs will need a USB or Thunderbolt to Ethernet adapter for the wired connection). Your wired connection must be connected to a wired network and able to access the Internet over that connection.
* An account with administrator rights on the computer.

Installation (Mac OS X 10.8)
====================================
1. Download the script file from this page. The easy way is to download the ZIP file using the "Download ZIP" button on the bottom right of this page. Double click the downloaded file to unzip it.
2. Move the **relaymyhome** file to somewhere you can access (if you're completely unfamiliar with using the OSX Terminal, stick it in **Documents**).
3. Using the WiFi icon in your menu bar at the top of the screen, select "Create Network..." and create a network named **NZ@McD1** (previously attwifi, which should also still work) and make sure to set *Security* to **None** (you can ignore the Channel option).
4. Open **System Preferences**, then select **Sharing**. Select **Internet Sharing**, then set "Share your connection from:" to **Ethernet**, and check **WiFi** in the "To computers using" box. Finally, check **Internet Sharing** and click **Start** at the prompt.
5. Open **Terminal** (in your Applications folder under *Utilities*), and navigate to the location you placed **relaymyhome** -- if you put it in **Documents**, then in *Terminal* type: **cd ~/Documents**
7. If this is the first time you are running the script, in Terminal enter the command: **chmod +x relaymyhome**
8. Now type **./relaymyhome full** and you should see the script do its thing. If you get an error that stops the script, something went wrong. The script takes about 8 minutes to run, after which you should have a list full of StreetPass hits on your 3DS.
9. Once you have greeted your new visitors in the StreetPass Plaza, you can run the script again to get another batch of StreetPasses. You should be able to run the script many times before you will need to wait for the eight hour cooldown on hitting the same relay twice.

Installation (Mac OS X 10.9 & 10.10)
====================================
1. Download the script file from this page. The easy way is to download the ZIP file using the "Download ZIP" button on the bottom right of this page. Double click the downloaded file to unzip it.
2. Move the **relaymyhome** file to somewhere you can access (if you're completely unfamiliar with using the OSX Terminal, stick it in **Documents**).
3. Open **System Preferences**, then select **Sharing**. Select **Internet Sharing**, then set "Share your connection from:" to **Ethernet**, and check **WiFi** in the "To computers using" box. Click the **Wi-Fi Options** button, enter **NZ@McD1** as the Network Name, leave Channel default and ensure Security is set to **None**. Finally, check **Internet Sharing** and click **Start** at the prompt.
4. Open **Terminal** (in your Applications folder under *Utilities*), and navigate to the location you placed **relaymyhome** -- if you put it in **Documents**, then in *Terminal* type: **cd ~/Documents**
5. If this is the first time you are running the script, in Terminal enter the command: **chmod +x relaymyhome**

Basic Usage
===========
1. Type one of the following:
  * `./relaymyhome`: Connects to the [Nintendo World](https://docs.google.com/spreadsheet/lv?key=0AvvH5W4E2lIwdEFCUkxrM085ZGp0UkZlenp6SkJablE&f=true&noheader=true&gid=3) and [HomePass addresses](https://docs.google.com/spreadsheet/lv?key=0AvvH5W4E2lIwdEFCUkxrM085ZGp0UkZlenp6SkJablE&f=true&noheader=true&gid=0). There are 21 of them, and you can get special Miis available only via Nintendo World addresses if you set your SSID appropriately.
  * `./relaymyhome full`: Connects to a subset of the addresses starting with 4E [listed here](https://docs.google.com/spreadsheet/lv?key=0AvvH5W4E2lIwdEFCUkxrM085ZGp0UkZlenp6SkJablE&f=true&noheader=true&gid=5). By default, connects to 5 addresses, which will take about 7-9 minutes.
2. Press Enter to execute the command and you should see the script do its thing. If you get an error that stops the script, something went wrong. With 5 addresses, the script takes about 8 minutes to run, after which you should have a list full of StreetPass hits on your 3DS.
3. Once you have greeted your new visitors in the StreetPass Plaza, you can run the script again to get another batch of StreetPasses. You should be able to run the script many times before you will need to wait for the eight hour cooldown on hitting the same relay twice.

Advanced Usage
==============

For those of you more comfortable on the command line, running `./relaymyhome -h` will display some usage help. You can specify the number of addresses to use in "full" mode, or specify a single MAC address to spoof.

What's New
==========
**2.1.0**

* Semantic versioning from now on.
* Check for sudo, since changing wifi settings requires it, and terminate appropriately

**2.0**

* I (Alvin) forked the original code, because it was unreliable on my Early 2009 Mac Mini running 10.9 (Mavericks)
* Big refactor, everything's a function
* Wait a lot less time, except for when the MAC address changes.
* Poll amd wait for MAC address to actually change, not just 10 seconds or whatever. This was the main cause of me never getting any StreetPasses; my hardware would receive the command to change MAC address, but it would take more than 10 seconds for the MAC address change to take effect.
* Call the InternetSharing binary directly after unloading Internet Sharing plist, which seems to be more robust. (You still need to start Internet Sharing before running the script, though.)
* Remove quick mode, in favor of...
* Implementing the -c parameter to specify number of addresses. The option was parsed before in taintedzodiac's script, just not used
* More logging that's easier to read (I should really implement verbosity, though)

**1.1**

* OSX Yosemite support<commit_msg>better sudo instructions<commit_after>relaymyhome
===========
OSX Bash Script for automating the process of getting Nintendo 3DS StreetPass hits via Internet Connection Sharing. Gathers the maximum of ten (10) StreetPass hits within a few minutes. Can be re-run many times per day if using "full" mode.

What It Does
============
By setting up your Mac computer to act like a StreetPass Relay, you can get StreetPass tags from all over the world. This script cycles through over 20 of the most popular streams in order to fill up your StreetPass queue in 20-30 minutes. Just set your 3DS down, configure your computer, and run the script.

What You'll Need
================
* A Nintendo 3DS that has **updated firmware (as of August 2013)** with WiFi turned on, all apps/games closed, and in sleep mode (lid closed).
* An Apple computer running OS X (only tested on 10.8 and up, although earlier versions may work as well) with both wired and wireless network interfaces (MacBook Airs will need a USB or Thunderbolt to Ethernet adapter for the wired connection). Your wired connection must be connected to a wired network and able to access the Internet over that connection.
* An account with administrator rights on the computer, because this script requires root access to your computer to change wifi settings.

Installation (Mac OS X 10.8)
====================================
1. Download the script file from this page. The easy way is to download the ZIP file using the "Download ZIP" button on the bottom right of this page. Double click the downloaded file to unzip it.
2. Move the **relaymyhome** file to somewhere you can access (if you're completely unfamiliar with using the OSX Terminal, stick it in **Documents**).
3. Using the WiFi icon in your menu bar at the top of the screen, select "Create Network..." and create a network named **NZ@McD1** (previously attwifi, which should also still work) and make sure to set *Security* to **None** (you can ignore the Channel option).
4. Open **System Preferences**, then select **Sharing**. Select **Internet Sharing**, then set "Share your connection from:" to **Ethernet**, and check **WiFi** in the "To computers using" box. Finally, check **Internet Sharing** and click **Start** at the prompt.
5. Open **Terminal** (in your Applications folder under *Utilities*), and navigate to the location you placed **relaymyhome** -- if you put it in **Documents**, then in *Terminal* type: **cd ~/Documents**
7. If this is the first time you are running the script, in Terminal enter the command: **chmod +x relaymyhome**
8. Now type **./relaymyhome full** and you should see the script do its thing. If you get an error that stops the script, something went wrong. The script takes about 8 minutes to run, after which you should have a list full of StreetPass hits on your 3DS.
9. Once you have greeted your new visitors in the StreetPass Plaza, you can run the script again to get another batch of StreetPasses. You should be able to run the script many times before you will need to wait for the eight hour cooldown on hitting the same relay twice.

Installation (Mac OS X 10.9 & 10.10)
====================================
1. Download the script file from this page. The easy way is to download the ZIP file using the "Download ZIP" button on the bottom right of this page. Double click the downloaded file to unzip it.
2. Move the **relaymyhome** file to somewhere you can access (if you're completely unfamiliar with using the OSX Terminal, stick it in **Documents**).
3. Open **System Preferences**, then select **Sharing**. Select **Internet Sharing**, then set "Share your connection from:" to **Ethernet**, and check **WiFi** in the "To computers using" box. Click the **Wi-Fi Options** button, enter **NZ@McD1** as the Network Name, leave Channel default and ensure Security is set to **None**. Finally, check **Internet Sharing** and click **Start** at the prompt.
4. Open **Terminal** (in your Applications folder under *Utilities*), and navigate to the location you placed **relaymyhome** -- if you put it in **Documents**, then in *Terminal* type: **cd ~/Documents**
5. If this is the first time you are running the script, in Terminal enter the command: **chmod +x relaymyhome**

Basic Usage
===========
1. Type one of the following:
  * `sudo ./relaymyhome`: Connects to the [Nintendo World](https://docs.google.com/spreadsheet/lv?key=0AvvH5W4E2lIwdEFCUkxrM085ZGp0UkZlenp6SkJablE&f=true&noheader=true&gid=3) and [HomePass addresses](https://docs.google.com/spreadsheet/lv?key=0AvvH5W4E2lIwdEFCUkxrM085ZGp0UkZlenp6SkJablE&f=true&noheader=true&gid=0). There are 21 of them, and you can get special Miis available only via Nintendo World addresses if you set your SSID appropriately.
  * `sudo ./relaymyhome full`: Connects to a subset of the addresses starting with 4E [listed here](https://docs.google.com/spreadsheet/lv?key=0AvvH5W4E2lIwdEFCUkxrM085ZGp0UkZlenp6SkJablE&f=true&noheader=true&gid=5). By default, connects to 5 addresses, which will take about 7-9 minutes.
2. Press Enter to execute the command and you should see the script do its thing. If you get an error that stops the script, something went wrong. With 5 addresses, the script takes about 8 minutes to run, after which you should have a list full of StreetPass hits on your 3DS.
3. Once you have greeted your new visitors in the StreetPass Plaza, you can run the script again to get another batch of StreetPasses. You should be able to run the script many times before you will need to wait for the eight hour cooldown on hitting the same relay twice.

Advanced Usage
==============

For those of you more comfortable on the command line, running `./relaymyhome -h` will display some usage help. You can specify the number of addresses to use in "full" mode, or specify a single MAC address to spoof.

What's New
==========
**2.1.0**

* Semantic versioning from now on.
* Check for sudo, since changing wifi settings requires it, and terminate appropriately

**2.0**

* I (Alvin) forked the original code, because it was unreliable on my Early 2009 Mac Mini running 10.9 (Mavericks)
* Big refactor, everything's a function
* Wait a lot less time, except for when the MAC address changes.
* Poll amd wait for MAC address to actually change, not just 10 seconds or whatever. This was the main cause of me never getting any StreetPasses; my hardware would receive the command to change MAC address, but it would take more than 10 seconds for the MAC address change to take effect.
* Call the InternetSharing binary directly after unloading Internet Sharing plist, which seems to be more robust. (You still need to start Internet Sharing before running the script, though.)
* Remove quick mode, in favor of...
* Implementing the -c parameter to specify number of addresses. The option was parsed before in taintedzodiac's script, just not used
* More logging that's easier to read (I should really implement verbosity, though)

**1.1**

* OSX Yosemite support
{'fraction_non_alphanumeric': 0.08892569124423963, 'fraction_numerical': 0.015120967741935484, 'mean_word_length': 4.678250204415372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2576537', 'n_tokens_mistral': 3824, 'n_tokens_neox': 3576, 'n_words': 2120}