Sweet Arduino + MaxMSP project!

fjossinet:

Pendulum Music. I like such geekeries ;)

(via fjossinet-deactivated20120307)

Prototype of my current Arduino project, with a single thermocouple sensor amplifier attached. Going to upgrade to the Mega2560 in order to allow for an array of sensors since the Ethernet shield steals three of my Digital I/O pins on the UNO.

Now to code the server…

Prototype of my current Arduino project, with a single thermocouple sensor amplifier attached. Going to upgrade to the Mega2560 in order to allow for an array of sensors since the Ethernet shield steals three of my Digital I/O pins on the UNO.

Now to code the server…

SSL proxy for Chef

I was setting up Opscode Chef as an experiment in server configuration a few weeks ago. The first thing I noticed was that there was a lack of support for WebUI/API calls via SSL. I found this really puzzling, since the last thing I’d want is for someone to be able to eavesdrop on calls I’m making to my configuration servers.

I came up with a simple nginx-based reverse-proxy configuration for tunneling this traffic over SSL. Note that you’ll need SSL certs generated and signed for your server in order for this to work. I just created my own CA and generated self-signed certs, since this won’t be a server accessed by the general public. Hopefully someone else might find this configuration useful.

#local chef server
upstream chef_api_local {
  server localhost:4000;
}

#local chef webui
upstream chef_webui_local {
  server localhost:4040;
}

server {
  listen 443;
  server_name your.server.com;
  ssl on;
  ssl_certificate /etc/certs/your.server.com.crt;
  ssl_certificate_key /etc/private/your.server.com.key;

  ssl_session_timeout 5m;

  ssl_protocols SSLv2 SSLv3 TLSv1;
  ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  ssl_prefer_server_ciphers on;

  root /var/www/html;

  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto https;

  location / {
    #API request incoming
    if ( $http_x_ops_timestamp != "" ) {
      proxy_pass http://chef_api_local;
      break;
    }

  #webui request incoming
    proxy_pass http://chef_webui_local;
  }

}

Installing the AVR toolchain on OSX Lion

I’m working on an Arduino-based project and want a more powerful IDE to code in, since the Arduino IDE is somewhat restrictive.

In order to run under Eclipse, the AVR toolchain needs to be installed (avr-gcc,  avr-binutils, avr-libc, avr-gdb, avrdude). I didn’t want to install a binary package for these tools; instead, I wanted a natively-compiled version of the tools, preferably using brew, since this is my package manager of choice these days.

I finally found a homebrew formula that was written specifically for the install. Here’s how to do it, assuming you cloned the homebrew repo to /usr/local/Library

cd /usr/local
git clone https://github.com/larsimmisch/homebrew-alt.git LibraryAlt
brew install LibraryAlt/avr/avr-libc.rb
brew install avrdude dfu-programmer

Many thanks goes to Lars Immisch for maintaining his homebrew-alt repo at https://github.com/larsimmisch/homebrew-alt

iOS Scrolling Trick

Just discovered a great UI trick on my iPad: Need to scroll a Safari browser window that doesn’t have a scroll bar? Use two fingers!

This should work across all iOS devices. Very handy… can’t believe I didn’t realize this sooner. This solves one of my biggest complaints with web browsing in iOS!

A night of camping and warmth by the river. Ahhh….!

A night of camping and warmth by the river. Ahhh….!

MySQLi + PHP + localhost?

I just spent way too long debugging a MySQL 5 + PHP mysqli connection issue, and I want to make sure I never make this mistake again. Regardless of your MySQL privilege settings, PHP mysqli considers localhost != 127.0.0.1…  strange but true.

Basic rule of thumb to remember:

localhost = connect via socket

127.0.0.1 = connect via TCP port

Did I miss this in the manual, somehow?

Hope this helps someone out there…

Tags: mysql php code

tumblr 2 wordpress

So, recently I started a tumblr log, in the hopes that I could use it to keep up with the personal and tech-oriented blogging I’d like to do. I started a self-hosted WordPress blog long ago, but didn’t keep up with it since moving to San Francisco… I found WordPress to be a spam-magnet, difficult to maintain with all of the security updates, and lacking in support for blogging via an iPhone app. I know that a lot of that has changed since a year or two ago…  but I wanted to give tumblr a shot before I move forward with full updates to the WordPress installs.

One of my concerns is that if I don’t like tumblr, I want to be able to export what I’ve done back into WordPress until I find a better solution. Hence this link I found… it allows you to export your entire tumblr log into an XML file that WordPress can import. Pretty nifty. I thought someone else might also find this useful…  so here it is. Enjoy.

tumblr 2 wordpress 0.3

In the meatime, I am really liking tumblr so far—so I hope I don’t have to use this!

Creamsicle fudge was just delivered. If i don’t respond to your email, it’s because I’ve just slipped sweetly away into a sugar coma.

Creamsicle fudge was just delivered. If i don’t respond to your email, it’s because I’ve just slipped sweetly away into a sugar coma.

It wasn’t the lightbulb, after all.

It wasn’t the lightbulb, after all.