Richard Castera - Explorations in Software Development
Richard Castera - Explorations in Software Development
Browsing Category
Web Server
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
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 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
Scripts Web Server

Recursively remove .svn folders on Windows

September 14, 2011 No Comments

I’m not an SVN guy; I love my GIT but, sometimes you inherit projects where SVN was the choice used for version control. There are many ways to do this of course but my preferred method is creating a Batch (.bat) file in the root of the target folder, add this line and run it.

1
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G"
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Resources Scripts Web Server

Drupal – How to install Drush

August 27, 2010 3 Comments

What is Drush?

It’s a command line shell and scripting interface for Drupal. The Drush Package Manager allows you to download, enable, disable, uninstall, update modules/themes/profiles/translations from the command line in a very simple way (apt-get style) – just type,

1
drush dl views

and

1
drush pm-enable views

in a Drupal directory to install the Views project! Additionally, the Drush Package Manager also allows you to update all your modules and even Drupal core with just one command,

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

Magento – Add Static Block to CMS Page

July 29, 2010 5 Comments

Static blocks are a great way to add sections of HTML to your CMS or Catalog pages. I’m going to show you how to add a static block to a CMS page.

It’s a 2 step process and a very simple one. First, create your static block by going to CMS->Static Blocks. You will use the identifier of your static block to reference it on the CMS page. Edit the CMS page you would like this block to appear in, and add this code in the location where you would like it to show up:

1
{{block type="cms/block" block_id="home-page-promo"}}
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Scripts Web Server

MySQL – Using a Column Name Inside the LIKE Keyword

June 14, 2010 7 Comments

When using the LIKE keyword in a MySQL query, I use it the most typical way, LIKE ‘%STRING%’. One day, I was in need to use a column name instead and could not figure out how to do it! At first, I tried to just replace the string value with the column name like this, LIKE (%t.column%). The end-result was not good as the LIKE keyword expects a string.

So, I thought of trying the CONCAT() function since that returns a string. And it worked!

MySQL
1
LIKE CONCAT('%', t.column)

Hope this helps someone!

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

MySQL – How to Export and Import tables with the Command Line

June 13, 2010 2 Comments

2 commands I use often throughout the day is importing and exporting large databases into MySQL VIA the command line. Here is how I do it where “USERNAME” is your username, “PASSWORD” is your password and “DATABASE” is your database name.

To Export:

MySQL
1
mysqldump -uUSERNAME -pPASSWORD DATABASE | gzip -c > ~/dump_2010-06-14.sql.gz

To Import:

MySQL
1
mysql -uUSERNAME -pPASSWORD DATABASE < database.sql

Also, you may have a large database that may give you errors while importing. You can use this command to force the import without warnings or errors:

MySQL
1
mysql -f -uUSERNAME -pPASSWORD DATABASE < database.sql
Continue reading
Reading time: 1 min
Share:
Written by: rcastera
Page 1 of 212»

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