Indiana University
University Information Technology Services

Tom Mason's Archive

Using SQL: Data Retrieval in Self-Study Mode

This article contains information about how to configure your personal computer to use these materials at your own pace. All you will need is access to the internet.

First, let’s launch Aqua Data Studio. We will be using IUAnyWare. Follow the instructions here to get logged in and the Citrix Client installed.

Once you are logged in and have the Citrix Client installed, all we have to do is launch the application. Aqua Data Studio is located inside the Databases folder.

Once you have clicked on Aqua Data Studio, you can pick up where you left off in the materials.

PHP Workshops: Install and Use PHP Locally

To develop database-driven PHP applications, we need three things, the Apache web server, the PHP processor, and MySQL. This tutorial will walk you through all of the installation and setup that you need to do on your own machine to have a local instance of a Apache/MySQL/PHP (AMP) environment.

The instructions below will walk you through the setup you need for each of our PHP workshops, starting with PHP: The Basics.

At the time of writing, PHP: The Basics is the only PHP workshop offered by IT Training.

PHP: The Basics

The following links contain step-by-step instructions on configuring XAMP for the PHP: The Basics workshop.

Macintosh OS: Install and Configure MAMP for PHP Development

If you are planning on developing PHP applications on Mac OS X, you’re in luck! Most of the tools come built-in to the operating system; all we need to do is activate them.

This tutorial is written for the most recent (at time of writing) version of Mac OS X, 10.8 Lion. The instructions listed here will work on most of the recent versions of Mac OS X. If you need help with another OS version, leave a comment on this post.

This instruction set is also focused primarily on the setup needed to complete PHP: The Basics. Specifically, this post will not detail what needs to be done to set up MySQL and phpMyAdmin to administer a MySQL database. Instructions for that topic will be included in another post.

Configuring Apache for Mac OS X 10.8 Lion

Let’s start with Apache, the web server. This is built in to the operating system, but it’s not accessible by any of the graphical interfaces available. Let’s begin by launching Terminal.

  1. To launch Terminal,
    Press Command – Space,
    Type Terminal,
    Press Return

    This will launch Terminal to your home directory:

  2. To start Apache, type: sudo apachectl start
    Press Return

    Apache will start.

Other Useful Apache Commands

Now that Apache has started, let’s take a moment to review some other useful Terminal commands for Apache.

  • sudo apachectl stop — stops the Apache service
  • sudo apachectl graceful — restarts the Apache service
  • httpd -v — shows the current version of Apache (Apache 2.2.22 comes installed with Mac OS X 10.8 Lion)

These commands will be useful throughout your time working with apache. Let’s test that Apache has started.

  1. To see if Apache has started,
    Launch a Web Browser,
    In the Address bar, type: localhost,
    Press Return

    If apache has started, you should see a web page that says “It works!

    By default, this will make your document root be /Library/WebServer/Documents. When we navigate to http://localhost, the files in this directory are displayed. This is not a good place to do our work since it’s in the root level of the operating system. We will create a folder inside our own user directory that will contain all of our sites. This will be referred as User Root.

    To begin this process, let’s set up a folder called Sites in our user directory.

  2. To make the appropriate directory, in Therminal, type:
    mkdir /Users/username/Sites

    Where username is replaced with the short username of your account. If you do not know your short username, in Terminal, type: whoami and press return.Now that we have a User Root directory for all of our sites, let’s tell Apache where to find them. To do this, we need to create a file called username.conf and add some XML to that file.

  3. To create username.conf, in terminal, type:
    sudo nano /etc/apache2/users/username.conf

    Replacing username with your short username.The nano editor launches with a new file called username.conf. This is where we will add our XML.

  4. To add the XML needed to configure the User Root, type:
    <Directory "/Users/username/Sites/">
    Options Indexes MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

    Again, replacing username with your short username.

  5. To save the file, press:
    Ctrl – O, Return, Ctrl – X

    Before we are finished, let’s make sure the file has the correct permissions.

  6. To change the permissions of the file, in Terminal, type:

    sudo chmod 644 /etc/apache2/users/username.conf

    Replacing username with your short username.

    Apache is now configured to look in /Users/username/Sites when we browse to http://localhost/~username. Let’s restart Apache and configure PHP.

  7. To restart apache, in Terminal, type:
    sudo apachectl graceful

Configuring PHP

Now that Apache is running, we need to start PHP. This is done by uncommenting a line in the Apache configuration file located at /etc/apache2/httpd.conf. Let’s do that now.

  1. To open the httpd.conf file, in Terminal, type:
    sudo nano /etc/apache2/httpd.conf
    Press Return

    Now, we will use nano’s built-in search functionality to find the line that talks about PHP.

  2. To search for PHP, in nano, type:
    Ctrl – W, php, Return

    This will locate the apropriate line.

  3. To uncomment the line,
    Remove the octothorp (#) from the beginning of the line

  4. To save the file and continue, press:
    Ctrl – O, Return, Ctrl – X

    Now that the line is uncommented, let’s restart Apache to have the changes take affect.

  5. To restart Apache, in Terminal, type:
    sudo apachectl graceful
    Press Return

Testing PHP

Now that we have PHP configured, let’s test the installation by creating a php document that contains the phpinfo(); function in our User Root directory.

  1. To create the PHP information file, in Terminal, type:
    nano /Users/username/Sites/phpinfo.php
    Press Return

    Again, replace username with your short username.

    This will create the file, now let’s add the code.

  2. To add the PHP code, type:
    <?php phpinfo(); ?>
  3. To save the file, press:
    Ctrl – O, Return, Ctrl – X

    This saves the file. We are now ready to test the connection.

  4. To test the PHP configuration, in a Web Browser, navigate to:
    http://localhost/~username/phpinfo.php

    You should now see the PHP installation information.

This concludes what is needed to move through PHP: The Basics in self-study mode. The last bit of information here is a list of recommendations on how to set up your Sites folder to complete the workshop.

  • Create a sub-folder in your User Root directory named PHPBA. This will be the Local Site Folder when configuring your site in Dreamweaver.
  • Since you are working on your local machine, you do not have to upload files using the Ctrl – Shift – U keyboard shortcut in Dreamweaver. Simply save and refresh the web browser.
  • To make sure all of your exercise files are ready to go, place the contents of the PHPBA folder in your newly created PHPBA folder inside your User Root directory.

That’s it! Happy PHP’ing!

Understanding Mac Keyboard Shortcuts

Apple has made a lot of changes to the behavior of their keyboard shortcuts over the last several operating systems. In the days before Exposé, things were pretty straightforward; the function keys worked the same regardless of how the operating system was configured.

Today, with Mission Control and Exposé, things aren’t so easy. Apple keyboards now have fancy little icons on some of the F-keys, and by default, they don’t function like a windows F-key. This can be confusing and it makes it difficult for us to keep our materials accurate for Macintosh systems.

(more…)

Windows 7: The Least You Should Know About Keyboard Shortcuts

Are you stuck in a world dominated by a mouse and clicking around a screen? Have you ever wanted to be more of a “Keyboard Junkie?”

Today, I’m going to introduce you to several keyboard shortcuts that will make your life easier while working in Windows. These keyboard shortcuts are tricks that I have been trying to pass along to participants in my workshops over the years, but now they’re written down in one place for easy reference.

I’m not going to be discussing specific applications, but rather universal shortcuts. I’ve also included some web browser short cuts toward the end that will make your life easier.

Let’s start by taking a tour of the common keys that will be used throughout this post:

Labeled Keyboard

Above, you’ll see several keys pointed out and numbered. The numbers correspond with the list below.

  1. Escape (Esc)
  2. Function Keys (F#)
  3. Tab
  4. Control (Ctrl)
  5. Windows Key (Win)
  6. Alt
  7. Home Group
  8. Arrow Keys
  9. Option Menu
  10. Shift

The only keys that are discussed in this post that are not labeled on the above image are the letter keys.

(more…)

Windows 7: How to Invert Your Mouse’s Scroll Wheel

In the last year or so, I’ve become increasingly dependent on my tablet for day-to-day computing. I’m finding that I rarely need a full desktop computer, but when I’m in the office, that’s what’s most convenient. Everywhere else, however, I have my tablet in my bag and can pull it out for anything from taking notes in a meeting, to grocery shopping, to entertaining myself or friends, to writing, email, and reading. One of the design philosophies in tablet OS design deals with scrolling the content instead of scrolling the viewport. What I mean is this, if I want to scroll down a page on my tablet (or phone), I push the page upwards, I don’t drag the device’s screen down.

If you were to put your hand on your screen, grab the document/page/file you’re viewing, and try to push it down to see the content below. It simply won’t work.

Here’s a more real-world example: Imagine that you can’t move your eyes; they are permanently fixed viewing a specific location on your desk. When you grab a piece of paper on your desk and move your hand downward, the page moves down, changing your focus to an area higher up on the page. If you move the page up, your focus changes to a location further down the page.

This is how tablet scrolling is designed.

This is something that I’ve found myself having trouble with lately on my desktop computer. I browse to a web page, open an email, edit a document, and I find myself pushing my mouse wheel upwards to scroll down a page rather than rolling it downward. Apple’s Mac OS X Lion has inverted the scroll direction, making for a more uniform experience across a myriad of different devices.

I began thinking, “I wonder if I can do that with my Windows 7 machine in the office.” Turns out, it can be done, and it takes changing a registry value in several places.

Here’s how I did it:

(more…)

Protect Your iOS Devices Without a Passcode

iPhone Lock Screen with a Passcode PromptIf you have an iPad, iPhone, or iPod Touch, you’ve probably played around with your passcode lock. If you’re not familiar with the passcode, it’s a way for you to have to “log in” to the device using a four digit PIN or a passphrase. While there is a way to set the device to let you lock and unlock it several times without using a passcode (the “I text message constantly” setting), having an unprotected device is much easier to use.

If you’re like me, you’ve used a passcode sometimes, removed it other times, forgotten it on occasion, etc. This article will detail how I’ve set up my iOS devices to not use a passcode, but for me to still be able to track them down using Find My iPhone as well as preventing them from being wiped and restored should they be stolen.

A quick note before we continue: I am not suggesting that the data on iOS devices is more secure without a passcode. In fact, the opposite is true. All this article is offering is a way to keep your device unlocked while still allowing you to track it down using Find My iPhone should it get lost or stolen.

(more…)

Free Workshops for Faculty and Staff

This spring, and this spring only, UITS IT Training is offering our workshops to faculty and staff for no charge!

That’s right, instructor-led UITS IT Training workshops covering various topics are free for university faculty and staff this spring 2012.

This is a pilot program to assess the demand for barrier-free training for IU faculty and staff. So, if there is a workshop that you’ve been wanting to take, but couldn’t spare the extra cash, let us know by signing up for that workshop today!

Have you always been wanting to learn how to use Photoshop so you can advance your photography hobby? Have you wanted to better your skills in Excel to make your workday less stressful? Have you been wanting to explore different ways to program a computer? Now is your chance to learn these things, and more, for FREE!

Along with signing up for our workshops for free, you can request a special session of one of our workshops to be taught to your group or class for free. Visit our special request page to see more details and to request a workshop.

We are excited to offer these workshops to IU faculty and staff for free and hope you are just as excited to attend them!

If you have any questions, feel free to leave them in the comment section of this post.

Creating a Gmail-Like Experience in Outlook: Using Macros to Mimic Starring

This is the second in a series of articles about how to create specific functionality from Gmail in Outlook using various tools and features. Today’s article uses built-in Outlook functionality combined with macros to attempt to create staring functionality.

Outside keyboard shortcuts to move conversations to folders, there is no good way to ‘star’ messages in Outlook with the keyboard. In this article, I will show you a macro that builds on the macro functionality explained in this article by using follow-up flags to mimic the star functionality in Gmail.

Before I go any further, I’ll add the same warning I included in the last post here:

This article is not for beginning users of Microsoft Outlook or for users who only use one incoming mail folder. It requires a decent understanding about how to organize email, work with the Office 2010 interface, and knowledge about how to create and modify a macro. Information about how to create a macro can be found in the workshop Excel 2010: Basic Automation Using Macros and more in-depth Visual Basic for Applications information can be found in the workshop Excel 2010: Advanced Macros and User Defined Functions.

Now that that’s out of the way, I’m going to show you how to use a macro to add a one day flag to a particular message and then move it to a folder called ’01 – Today’.

(more…)

Social Media Protip: Filter Tweets Based on Source, Keyword, or Person Using TweetDeck

I caused quite the stir earlier today on my personal Twitter account when I announced:

Oh man... global filter in TweetDeck, why have I not discovered you before now! No updates from Foursquare OR Tumblr now!!

So I decided that I would share with you all. If you’ve been a long-time TweetDeck user like I have been, you may or may not have noticed the added feature called Global Filter. (more…)