Richard Castera - Explorations in Software Development
Richard Castera - Explorations in Software Development
Browsing Category
Scripts
Home Automation Scripts Web Server

Setting up a headless Raspberry Pi Zero (W) with Camera

March 23, 2017 3 Comments

I received my Raspberry Pi Zero W a couple of weeks ago and finally had the chance to set it up. My goal is to to setup some cameras in my basement and garage.

Continue reading
Reading time: 3 min
Share:
Written by: rcastera
Home Automation Scripts

Setting up Raspberry Pi 3 with the 7″ Touchscreen Display

December 13, 2016 2 Comments

Today I received all the parts I need to begin setting up my own personal home dashboard. When I first began my career in programming, Home Automation was always something I’ve been very intrigued with; only it was very expensive and there weren’t many products out there to support it. Now, with the recent boom in IOT devices and products, its easier and far more cost effective to do this on your own.

Continue reading
Reading time: 5 min
Share:
Written by: rcastera
Scripts

Create custom named events in Backbone.js

February 23, 2012 No Comments

In Backbone, Events is a module that can be mixed in to any object, giving the object the ability to bind and trigger custom named events. Events do not have to be declared before they are bound, and may take passed arguments. For example:

JavaScript
1
2
3
4
5
6
7
8
9
10
11
<script>
var person = {};
_.extend(person, Backbone.Events);
person.on("scream", function(msg) {
  alert("I am " + msg);
});
person.trigger("scream", "screaming");
</script>
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Resources Scripts

Show hidden files on Lion

January 7, 2012 No Comments

To enable hidden files/folders in finder windows:

  1. Open Finder
  2. Open the Utilities folder
  3. Open a terminal window
  4. Copy and paste the following line in
    1
    defaults write com.apple.Finder AppleShowAllFiles YES
  5. Press return
  6. Now hold ‘alt’ on the keyboard and right click on the Finder icon
  7. Click on Relaunch

You should find you will now be able to see any hidden files or folders. To revert:

1
defaults write com.apple.Finder AppleShowAllFiles NO
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts Web Server

Clear the terminal’s command history

October 26, 2011 No Comments

Sometimes you just need to clear your history in Terminal. It’s actually pretty easy to do.

1
history -c

If you’d rather not have your history saved to a file at all, add the following line to your ~/.bash_profile:

1
unset HISTFILE

This way, your command history is limited to only those commands you used during the current session. More information and options can be found on the bash man page

1
man bash
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts Web Server

How to Clear DNS Cache in Mac OSX Leopard

October 15, 2011 No Comments

To clear DNS cache in Leopard, use the following command:

1
dscacheutil -flushcache
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts Web Server

Ubuntu Package Management

October 14, 2011 No Comments

Chances are good that you’re already familiar with apt-get, a command which uses the “advanced package tool” to interact with the operating system’s underlying package system. The most relevant and useful commands are, (to be run as root):

1
apt-get install [package-name]

This command installs the package(s) specified, along with any dependencies.

1
apt-get remove [package-name]

This command removes the package(s) specified, but does not remove dependencies.

Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts

Get your Twitter follower count with jQuery

October 13, 2011 No Comments
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script>
$(function(){
    $.ajax({
        url: 'http://api.twitter.com/1/users/show.json',
        data: {screen_name: 'rcastera'},
        dataType: 'jsonp',
        success: function(data) {
            console.log(data.followers_count);
        }
    });
});
</script>
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts

A PHP function for the Fibonacci sequence

October 11, 2011 No Comments

I was recently asked as a test to write a function that outputs the Fibonacci sequence in PHP. Here it is:

PHP
1
2
3
4
5
6
7
8
9
10
11
12
function fib() {
    $current = 1;
    $previous = 0;
    $evaluation = 0;
    while($evaluation < 100) {
        $evaluation = ($current+$previous);
        $current = $previous;
        $previous = $evaluation;
        echo $evaluation . '<br>';
    }
}
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts Web Server

Getting MySQL and PHP running on Terminal with XAMPP

September 20, 2011 No Comments

I have XAMPP setup on my Mac. Getting MySQL and PHP to run in terminal didn’t work after installation. To be able to run mysql and php you have to add the xampp application to the .bash_profile file in your users home directory.

1
2
3
4
5
6
7
8
9
10
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export XAMPP_HOME=/Applications/xampp/xamppfiles
export PATH=${XAMPP_HOME}/bin:${PATH}
export PATH
unset USERNAME

To check that it has worked, open a new terminal session and type in:

1
2
which mysql
which php

Both should point to /Applications/xampp/xamppfiles

Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Page 1 of 91234»...Last »

About me

Hello, my name is Richard Castera. I have more than 12 years of experience architecting, implementing, leading and launching large scale, high performance software products in a fast-paced agile environment.

Popular Posts

Magento – Display new products on the home page

May 20, 2009

How to Fix “Internet Explorer Cannot Open the Internet Site- Operation Aborted” Error

May 9, 2009

PHP – Convert Array to Object with stdClass

July 5, 2009

Categories

  • Home Automation
  • Resources
  • Scripts
  • SEO
  • Thoughts
  • Web Server

Tags

Apache Apple Bash CSS Drupal Free home automation htaccess Java Javascript Magento PHP raspberry pi SEO SQL thoughts Wordpress

© 2019 copyright Richard Castera // All rights reserved