Posts

Amazon AWS basics in Rails

Listing Amazon EC2 instances # Class for VM's class Vm include ActiveModel::Validations validates_presence_of :name, :status attr_accessor :id, :name, :dns, :status @@ec2 = AWS::EC2.new() def self.all return @@ec2.instances.inject([]) { |m, i| tags = i.tags.to_h name = tags['Name'] m.push Vm.new( i.id, name, i.dns_name, i.status ) } end def initialize( id, name, dns, status ) @id = id @name = name @dns = dns @status = status end end Listing Amazon S3 buckets # Class for S3 Storage class Storage include ActiveModel::Validations validates_presence_of :name attr_accessor :name @@ec2 = AWS::S3.new() def self.all return @@ec2.buckets.inject([]) { |m, i| m.push Storage.new( i.name ) } end def initialize( name ) @name = name end end https://gist.github.com/CustardCat/7175295 AWS Config config/initializers/aws-sdk.rb AWS.config({  :secret_ac...

Handling and Tyre wear patterns

Image
Racing last night at Bashley the car was still quite unstable. For the last few races I have been changing one setting at a time to pin down which are making improvements. So far I've stiffened the front springs, moved the shock positions on the rear and toed out the steering a little. The car was better but still quite hard to tame the back end.. If you look closely at the tyres you can just about make out that the insides of the tyres are a little duller meaning that the majority of the cars weight has been on the insides even during dynamic handling. This is a big clue to start looking at the camber adjustments. Camber is the angle of the wheel relative to the track looking from the front of the car. 0 degrees means the wheel is dead vertical. -5 degrees means the top of the wheel is angled toward the centreline of the car. A little negative camber can be useful, but evidently I had too much. I rather unscientifically reduced the amount and in the next heat the car was ...

NADARS Newbury Radio Rally

Image
Each year on Fathers day the Newbury and District Amateur Radio Society organise their rally which has been at the Newbury Showground for the last few years. For anyone not familiar, radio rallies or hamfests as they are sometimes known are a show organised by an amateur radio society. They usually take the form of a field with trade stands, a club stand and a car boot section. There is often a very varied mix of things on sale from old wartime radios, military surplus, old broadcast equipment, telecom equipment, components to computers and all manner of bits and pieces.   This has always been one of the nicest rallies and one which has been on my list of favourites since about 1993, so I thought I'd share a few photos of the day. We got there a little late, but it was still a good day. I picked up a few bits for the DATV station I'm planning on building, an NDS CSR820 MPEG2 IRD and some L-Band filters and splitters. I also met an old friend which was nice. It wa...

Maker Faire Newcastle 2011

Image
  Maker Faire Newcastle, UK 2011 Last week Makers and Hackers from all over the world converged on the Centre for Life in Newcastle-Upon-Tyne for the UK's third Maker Faire.  Maker Faire is an event organised by O'Reilly's Make magazine to bring together art, crafts, technology, engineering and science projects and to celebrate and encourage the Do it Yourself mindset. The BBC's Research and Development and Television Platforms groups were there meeting the public and making friends with other Makers. We had several exhibits ranging from the fun Blink-o-tron with its trapped Weeping Angel, Conduct your own orchestra to the more serious Universal Control which allows subtitles to be sent to mobile devices.  The Maestro demonstrates in an entertaining way our ability to interface to the Microsoft Kinect and to use thedata provided to control video playback. Basically you use the baton and move your hands in the manner of an orchestral conductor and you ca...

Wayback Machine visits Maker Faire

Image
Getting the Wayback Machine ready for Maker Faire. Since the last update the radio has gone through some drastic hardware changes.  There is still an Arduino driving the LCD and user interface but the backend has been replaced by a Beagleboard running Angstrom Linux.  This has enabled the radio to stream and play MP3 files and also allows the use of Wifi or 3G data dongle. BBC R&D North visited Maker Faire in Newcastle on the 12th and 13th of March 2011. http://www.bbc.co.uk/blogs/researchanddevelopment/2011/03/bbc-rd-at-the-big-bang-science.shtml http://makerfaireuk.com/

Git crib sheet

Been using Git lately.  Much goodness to be had, but some commands are a little unfamiliar if coming from Subversion. So, here's my crib sheet of handy Git recipes I think will be useful. Configure your Git bash-3.2$ git config --global  user.name  "CustardCat" bash-3.2$ git config --global user.email " custard@cpan.org " bash-3.2$ git config --global -l user.name =CustardCat user.email= custard@cpan.org Create a new project and commit your code... # Create a project and cd into it.. cd my_project # Make the project a git project git init # Add all the files in the project to git git add . # Commit your local files git commit Get status, logs & diffs # Status of changes git status # Diffs git diffs # Add more files git add file1 file2 etc.. # See what's been happening git log git log --stat --summary git log --pretty=oneline # See diffs between versions. nb. only need first few chars of version git diff 16f8..8bd2 g...

Xilinx Coolrunner II & Xubuntu

Image
After a few days wait the Xilinx Coolrunner II kit arrived in the post. The Coolrunner is a CPLD which contains Macrocells, which are a step up from the basic gate array of a PLD and the XC2C256 on this board has 256 macrocells configured via an interconnect matrix. Xilinx provide a programming suite, ISE, which is available for Windows and Linux. However they don't directly support Ubuntu.  Here is a brief howto to get the ISE running on  Xubuntu. The main hurdle with the ISE is that it requires a USB driver,  windrvr6, in order to use the Platform cable (DLC9G). However it is possible to configure Xubuntu to use libusb and to get the programming tool, iMPACT, to use this instead. 1.Install prerequisites.. apt-get fxload apt-get libusb 2. Configure the udev rules These load the correct hex file when the device is attached. jamesb@Jalapeno:~$ cat /etc/udev/rules.d/xusbdfwu.rules # version 0003 SYSFS{idVendor}=="03fd", SYSFS{idProduct}=="00...

Audio board for the Camera A2D project

Image
Started working on the audio board prototype for the Camera A2D project.  It's based around a pair of NE5532 op amps. The input stage converts the balanced line input from the microphone, and the second stage acts as a preamp with level control to supply the correct levels to the nNovia. Should be on to some audio tests shortly so time to dig the signal generator and scope out.

Discrete Fourier Transform in Ruby

...Just for a laugh... I'm reading this amazing book at the moment,  http://www.dspguide.com/ and thought it would be fun to code some stuff in Ruby. The code... #!/usr/bin/ruby require 'complex' class DFT         def initialize( size )                 @freq = Array.new( size, Complex(0,0) )         end         # set data         def data( data )                 @data = data         end         # get frequency table         def freq                 @freq         end         # reset the frequency table         def reset                 @freq.map! do |...

Unit testing in TCL

The unit... #!/opt/local/bin/tclsh proc fib {n} {         if {$n==1}  {return $n}         if {$n==2}  {return [expr {$n-1}]}         if {$n==3}  {return [expr {$n-1}]}         return [expr { [fib [expr {$n - 1}]] + [fib [expr {$n - 2}]] } ] } The test... #!/opt/local/bin/tclsh package require tcltest 2.0 namespace import ::tcltest::* source ../src/fib.tcl # 1 1 2 3 5 8 13 21 34 test fib-1 { Test first is 1 } {         fib 1 } 1 test fib-2 { Test second is 1 } {         fib 2 } 1 test fib-3 { Test third is 2 } {         fib 3 } 2 test fib-4 { Test fourth is 3 } {         fib 4 } 3 test fib-5 { Test fifth is 5 } {         fib 5 } 5 test fib-6 { Test ninth is 34 } {         fib 9 } 34 test fib-7 { Test f...

The Six Characteristics of Shorinji Kempo

Image
Todays T-Shirt choice reminded me of the Six Characteristics of Shorinji Kempo. Ken Zen Ichinyo – Body and the mind are one. Riki Ai Funi – Strength and power should never be separated from compassion. Shushu Koju – Defence comes before attack.  Fusastu Katsujin – Defend and protect without killing.  Goju Ittai – Use hard and soft techniques together, in balance. Kumite Shutai – Pair work is fundamental.   And Live Half for yourself, Half for Others. http://bit.ly/mo_custardcat That is all.

Homebrew tapeless camera

Image
This is an ongoing project I'm working on which started as a circuit that I decided was necessary to be able to neatly interface the nNovia QC120 A 2D2  recorder to a Sony DXC-325P camera with CA-325P studio back. This interface deals with translating VTR start/stop signals from the camera into GPI signals to pause and resume the recorder when it is in record mode. In addition to the device control, there will also be XLR Balanced line input to be converted to unbalanced line level. There is also the possibility of getting it to communicate with the nNovia RS-422 port and using this protocol to control the device. I'm still working on the final design. I have built the PIC 16f872 based circuit that controlls the nNovia via the GPI control lines and this seems to work very well. The next step with the PIC interface is to try controlling the RS232 port on the nNovia to start and stop the deck and get its status. I will be prototyping the Preamp shortly. I have a plan to use the...