<commit_before>### Switch gears

I put the circuit board mini-project on hold for the time being, since I'm under a deadline, and put the components back on a breadboard hooked up to the Create. After verifying that that worked as it did before, I booted the Pi back up and continued troubleshooting on the PHP to Python issue.

Following this [tutorial](http://raspberrywebserver.com/cgiscripting/setting-up-nginx-and-uwsgi-for-cgi-scripting.html), it looks like I need uWSGI to run Python from Nginx. But I get an error, saying the URL is empty, when I actually try to download the plugin:

```
$ curl http://uwsgi.it/install | bash -s cgi /home/pi/uwsgi
```
After looking at another [forum post](http://www.raspberrypi.org/forums/viewtopic.php?f=32&t=15370) I try to install via PIP:

```
$ sudo apt-get install pip
$ sudo pip install uwsgi
```
But unfortunately, even PIP won't install. I found another [handy blog post](http://jeffskinnerbox.wordpress.com/linux-python-packages-for-my-raspberry-pi/) full of useful RPi commands, including an alternative PIP install command. But before I do that, I decide to run some updates:

```
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo easy_install -U distribute
```
I then run the PIP install:

```
$ sudo apt-get install pyton-pip
```
This get stuck at: 
```
 Running setup.py install for uwsgi
```

### Starting over...yet again

I decide to start from a clean slate, again following this [forum post](http://www.raspberrypi.org/forums/viewtopic.php?f=32&t=15370). ~~I first run the following, removing all Python packages:~~
```
$ sudo apt-get remove .*python.*
```
~~Then I reinstall Python from the source with custom libraries:~~
```
$ sudo -s
$ apt-get install build-essential libssl-dev libbz2-dev
$ wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
$ tar xjf Python-2.7.5.tar.bz2
$ cd Python-2.7.5
$ ./configure --enable-shared; make; make install;
$ ldconfig
```
This royally f*@#%d up my RPi!

### Abort!

After finding that I cannot reinstall/uninstall/force install Python, which I absolutely need, I am left with only on choice: wipe and reinstall [Raspbian](http://www.raspberrypi.org/help/noobs-setup/).

While installing, updating, and configuring, I decided to have my Create run around on the new "advanced" battery to see how long it would go on a full charge. The answer is 20. *TWENTY MINUTES?!?!* I just ordered another, supposedly longer, battery from a thrid party, should be here by the end of the week.

### Drivers & installs

Well apparently a lot has changed in the 10 months since I last installed Raspbian, to where my wifi adapter was no longer supported. Had to dig around for a while to find the [driver and install instructions](http://tech.enekochan.com/2013/05/29/tp-link-tl-wn725n-version-2-in-raspberry-pi/) for my 3.10.25+ version. I love wasting time ;____;

Back to where I was 12 hours ago, my current setup is:

 - Raspbian 3.10.25+
 - Python 2.7
  - PySerial
  - Python-dev
  - Python-setuptools
  - Python-pip
 - Git
 - Apache2
 - PHP5

Note to self, don't forget about permissions:
```
chown -R www-data.www-data /home/pi/design_by_roomba
chmod -x /home/pi/design_by_roomba/test2.py
```
Also, the Apache error log is: /var/log/apache2/error.log

And permissions on the serial port itself appartently:
```
sudo adduser www-data dialout
sudo chmod a+rw /dev/ttyUSB0
```

[Back](25.md)
<commit_msg>Update 26.md<commit_after>### Switch gears

I put the circuit board mini-project on hold for the time being, since I'm under a deadline, and put the components back on a breadboard hooked up to the Create. After verifying that that worked as it did before, I booted the Pi back up and continued troubleshooting on the PHP to Python issue.

Following this [tutorial](http://raspberrywebserver.com/cgiscripting/setting-up-nginx-and-uwsgi-for-cgi-scripting.html), it looks like I need uWSGI to run Python from Nginx. But I get an error, saying the URL is empty, when I actually try to download the plugin:

```
$ curl http://uwsgi.it/install | bash -s cgi /home/pi/uwsgi
```
After looking at another [forum post](http://www.raspberrypi.org/forums/viewtopic.php?f=32&t=15370) I try to install via PIP:

```
$ sudo apt-get install pip
$ sudo pip install uwsgi
```
But unfortunately, even PIP won't install. I found another [handy blog post](http://jeffskinnerbox.wordpress.com/linux-python-packages-for-my-raspberry-pi/) full of useful RPi commands, including an alternative PIP install command. But before I do that, I decide to run some updates:

```
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo easy_install -U distribute
```
I then run the PIP install:

```
$ sudo apt-get install pyton-pip
```
This get stuck at: 
```
 Running setup.py install for uwsgi
```

### Starting over...yet again

I decide to start from a clean slate, again following this [forum post](http://www.raspberrypi.org/forums/viewtopic.php?f=32&t=15370). ~~I first run the following, removing all Python packages:~~
```
$ sudo apt-get remove .*python.*
```
~~Then I reinstall Python from the source with custom libraries:~~
```
$ sudo -s
$ apt-get install build-essential libssl-dev libbz2-dev
$ wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
$ tar xjf Python-2.7.5.tar.bz2
$ cd Python-2.7.5
$ ./configure --enable-shared; make; make install;
$ ldconfig
```
This royally f*@#%d up my RPi!

### Abort!

After finding that I cannot reinstall/uninstall/force install Python, which I absolutely need, I am left with only on choice: wipe and reinstall [Raspbian](http://www.raspberrypi.org/help/noobs-setup/).

While installing, updating, and configuring, I decided to have my Create run around on the new "advanced" battery to see how long it would go on a full charge. The answer is 20. *TWENTY MINUTES?!?!* I just ordered another, supposedly longer, battery from a thrid party, should be here by the end of the week.

### Drivers & installs

Well apparently a lot has changed in the 10 months since I last installed Raspbian, to where my wifi adapter was no longer supported. Had to dig around for a while to find the [driver and install instructions](http://tech.enekochan.com/2013/05/29/tp-link-tl-wn725n-version-2-in-raspberry-pi/) for my 3.10.25+ version. I love wasting time ;____;

Back to where I was 12 hours ago, my current setup is:

 - Raspbian 3.10.25+
 - Python 2.7
  - PySerial
  - Python-dev
  - Python-setuptools
  - Python-pip
 - Git
 - Apache2
 - PHP5

Note to self, don't forget about permissions:
```
chown -R www-data.www-data /home/pi/design_by_roomba
chmod -x /home/pi/design_by_roomba/test2.py
```
<small>The Apache error log is: /var/log/apache2/error.log</small>

And permissions on the serial port itself appartently:
```
sudo adduser www-data dialout
sudo chmod a+rw /dev/ttyUSB0
```

[Back](25.md)

{'fraction_non_alphanumeric': 0.1096311475409836, 'fraction_numerical': 0.019613583138173303, 'mean_word_length': 3.9839533187454412, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 14, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1831952', 'n_tokens_mistral': 2349, 'n_tokens_neox': 2141, 'n_words': 864}