Showing posts with label Random. Show all posts
Showing posts with label Random. Show all posts

Thursday, October 25, 2012

ownCloud on a Raspberry Pi

This is a project that I have wanted to do for quite a while now. I finally got a free day this previous weekend, so I thought I would dedicate a little time to playing with the Raspberry Pi. The Raspberry Pi, for those not in the know, is a $35 ARM powered computer that is about the size of an Altoids Tin. I only had a day for my project and decided that setting up ownCloud would be interesting. ownCloud is an alternative to many different cloud services, such as file storage (Dropbox, Google Drive, SkyDrive, etc.), calendars (Google Calendar, etc.), music player (Google Music), personal picture viewer (Picasa, flickr,etc), and others. It has quite a few interesting features and is very actively developed.

Setting Up the Raspberry Pi

The Raspberry Pi is surprisingly easy to set up with Raspbian, and I was off and running in no time. I would go through the details, but I followed the Raspberry Pi Wiki article on SD card setup. I was able to use SSH to login after the first boot, so I did not even have to plug it into my TV. I did not do anything special with the configuration of my Pi, but I plan on activating the turbo setting in the firmware, so I can get the processor speed up to 1Ghz.

Setting Up nginx and PHP

In order to run ownCloud, you need a webserver and PHP. Apache can be a bit big for the Pi which only has 256MB of RAM (they now come with 512MB), so I chose to install nginx and PHP-FPM
aptitude install nginx php5-fpm php5-sqlite php5-gd
 Then, create a file in /etc/nginx/sites-available/. I called mine owncloud.vhost:
# redirect http to https.
#server {
#  listen 80;
#  server_name owncloud.example.org;
#  rewrite ^ https://$server_name$request_uri? permanent;  # enforce https
#}

# owncloud (ssl/tls)
server {
  #listen 443 ssl;
  listen 80;
  #ssl_certificate /etc/nginx/certs/server.crt;
  #ssl_certificate_key /etc/nginx/certs/server.key;
  #server_name localhost;
  root /usr/share/nginx/www/owncloud;
  index index.php;
  client_max_body_size 1000M; # set maximum upload size

  # deny direct access
  location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
    deny all;
  }

  # default try order
  location / {
    try_files $uri $uri/ @webdav;
  }

  # owncloud WebDAV
  location @webdav {
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param HTTPS on;
    include fastcgi_params;
  }

  # enable php
  location ~ \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param HTTPS on;
    include fastcgi_params;
  }
}
I actually got the majority of this file from ownCloud.org. Then create a soft link to /etc/nginx/sites-enabled:

ln -s /etc/nginx/sites-available/owncloud.vhost /etc/nginx/sites-enabled/

Note: I removed the default server in sites-enabled.

I then modified /etc/php5/fpm/php.ini to include the following:

extension=sqlite.so
extension=zip.so
extension=json.so
extension=xmlrpc.so
extension=curl.so
extension=gd.so

Installing ownCloud

I downloaded the gzipped tar of ownCloud 4.5 from ownCloud.org, then decompressed it and copied it to /usr/share/nginx/www/owncloud.

Then,

sudo chown -R www-data:www-data /usr/share/nginx/www/owncloud

You should now be able to start nginx and php-fpm, then using your web browser to go to the IP address of your Pi, and BOOM! ownCloud!

Thursday, October 4, 2012

Mind Mapping

Since leaving Dragon*Con, I have been doing my best to keep track of all the ideas that I want to implement in my costume. In order to do that, I have been using a technique called Mind Mapping. It is a wonderful concept generation tool. If you have never tried it, then you should take a look at the Wikipedia entry, and Dr. Dobb's takes a look at the technique from a software development point of view.

The Process

Fig. 1: My Collapsed Mind Map
To outline the basics: you start with a central topic, then expand outward getting more and more detailed. As you can see in Figure 1, my central topic for this map is my Con costume. It then radiates out into the main parts of the costume. The map gets more-and-more specific about what will go into
each section, as your radiate further away from the central topic.

The Software

Fig. 2: SimpleMind Free version of my Con Costume mind map.
When I said that I have been working on this project since leaving the Con, I truly meant it. While my wife was at the wheel, I had my phone out creating the initial map. Figure 2 is a screenshot of the current (as of posting). I used SimpleMind Free for Android. It makes some very pretty mind maps, and the paid version can sync with Dropbox and export to the Freemind file format, which is kind of a universal format for mind maps. 

Once I got the initial map settled down, I went to work transcribing it into FreePlane, which is the successor of Freemind. I feel that FreePlane does not make as pretty of a mind map, as SimpleMind does, but it is opensource as well as usable on PC, Mac, and Linux. Below, in figure 3, is an example of what the FreePlane output looks like.
Fig. 3: FreePlane version of my Con Costume mind map.
Yes, I did obfuscate the further branches on both figure 2 and 3, but only to keep those subjects for later discussion.

Conclusion

Mind maps are wonderful to help document concept generation. I find myself prototyping ideas using mind maps all the time. I tend to think about all aspects of a project at once, so mind maps help me capture all of those thoughts in a coherent manner.

Friday, May 15, 2009

Now I can highlight code snippets!

Having recently lost my thumbdrive, I've decided to store more ideas and interesting projects in a more locatable place. At least for now...

I got the syntax highlighting from this site. It details how to edit the layout template.

Here is a sample of code, just to try it out:
def parseStatsFile():
   """Parse the stats file, or create it initially"""
   try:
       statsFile = open(fileLoc + "stats.log", "r")
       for s in statsFile:
           statsTemp = s.strip("\n").split("=")


I really hope that I am able to find my thumbdrive. I only managed to back up a couple of important files, before I lost it right after that.

Thursday, August 16, 2007

Summer is gone...

The summer is over. I am days away from being back in the classroom. As with most students, I am excited and saddened about going back. I am excited, because I get to start working on the grant funded research project for my autonomous helicopter group. I am very sad that I will not be living with my fiancé during the semester. It is going to be a tough semester, but I think I will survive.

The research project is going to be amazing, we not only have our grant money, but we are also using the award money from winning the AHS 1st responder competition in Huntsville. That is an extra $5000 toward our vehicle. We are going to use our pre-existing R/C helicopter as our base platform. From that we are going to strap a couple of “gumstick” computers onto the bottom, strap on a couple sensors, then get to writing a bunch of code in order to get it to fly intelligently. In order to fulfill our grant, we are going to get it to fly, from a distance, up to the side of a building, look in the windows, and try to identify a target. I plan on journaling it every day that I do work. I am going to try to get the other guys to do the same. Maybe we could collaborate in a blog like this!

I will also be involved in the UMR Robotics Team. I will be helping in a detached way. I do not plan to devote a lot of time strictly to the team. I am taking on more of an advisory role. I will be helping in major decisions, approving designs, and helping everyone keep on track in general. If there is one thing that the team needs, it is to keep on track. We have a great opportunity this year. After visiting a couple of conferences, including the AUVSI conference in D.C., we got some great sponsors that are going to be helping us out by provided motor controllers, new motors, and more. Follow their website for more info.

I was accepted into the work study program this year. Hopefully I will be able to get an interesting job. I really wanted to work as a research assistant of some sort, but I am afraid that the jobs offered might be a little more menial than that. It will help me get some gas money, so that is good enough for now.

I have also been doing a little bit of design research, on my own. I have been looking in to building an autonomous submarine. I have been working on a way to create an airtight container to house a brushless motor and shaft. I think I have found all the parts that I need, but I just need to find the time and, mainly, the money in order to do some experiments. If I can get it to work then I will be well on my way.

I have been looking for work opportunities in the Chicago area. Victoria and I visited there last weekend, and fell in love with the city. She says that she has other seven different colleges that she can apply to for graduate school! We plan on moving up there after we get married next June. I am just hoping that I will be able to find something in the realm of robotics there. All of the companies that I spoke with at the AUVSI conference were all from the east coast. There are a couple of companies that look promising, I just need to try to get a hold of them now, so I can start talking with someone about getting hired next summer.