Book Image

Raspberry Pi for Secret Agents

By : Stefan Sjogelid
Book Image

Raspberry Pi for Secret Agents

By: Stefan Sjogelid

Overview of this book

Ever wished you could play around with all the neat gadgets your favorite spies use (like James Bond or Michael Westen)? With the introduction of the remarkable Raspberry Pi and a few USB accessories, anybody can now join in on the action.Discover how to turn your Raspberry Pi into a multipurpose secret agent tool! Through a series of fun, easy-to-follow projects you'll learn how to set up audio/video surveillance, explore your Wi-Fi network, play pranks on your friends, and even learn how to free your Raspberry Pi from the constraints of the wall socket.Raspberry Pi for Secret Agents starts out with the initial setup of your Raspberry Pi, guides you through a number of pranks and secret agent techniques, and then shows you how to apply what you've learned out in the real world. Learn how to configure your operating system for maximum mischief and start exploring the audio, video, and Wi-Fi projects. Learn how to record, listen, or talk to people from a distance and how to distort your voice. You can even plug in your webcam and set up a motion detector with an alarm, or find out what the other computers on your Wi-Fi network are up to. Once you've mastered the techniques, combine them with a battery pack and GPS for the ultimate off-road spy kit.
Table of Contents (12 chapters)
Raspberry Pi for Secret Agents
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Writing Raspbian OS to the SD card


Computers can't do anything useful without an operating system, and the Pi is no exception. There is a growing collection of operating systems available for the Pi, but we'll stick with the "officially recommended" OS—the Raspbian GNU/Linux distribution.

Getting Raspbian

There are two main ways to obtain Raspbian. You can either buy it preinstalled on an SD card from your Raspberry Pi dealer, or download a Raspbian image yourself and write it to an empty SD card on a computer with an SD card slot.

Note

If you do have access to a computer but it lacks an SD card slot, it's a wise choice to invest in an external SD card reader/writer. They don't cost much and chances are you'll want to re-install or try a different operating system on your SD card sooner or later.

To download a Raspbian image, visit the site http://www.raspberrypi.org/downloads. Instead of version numbers, Raspbian uses code names (names of characters from the movie Toy Story) and the latest version at the time of writing is Wheezy. Just click on the link for the ZIP file and wait for your download to start or use the torrent link if you prefer, but we will not cover that in this book.

SD card image writing in Windows

Two things are needed to prepare your SD card—an uncompressed image and an image writer application. Perform the following steps to prepare your SD card:

  1. When your image has finished downloading, you'll need to unzip it, usually by right-clicking on the ZIP file and selecting Extract all or by using an application such as WinZip. Once extracted, you should end up with a disc image file named YYYY-MM-DD-wheezy-raspbian.img.

  2. It is highly recommended that you disconnect any attached USB storage devices for now to minimize the risk of writing the Raspbian image to the wrong place.

  3. Visit http://sourceforge.net/projects/win32diskimager/ and download the latest version of the Win32DiskImager application (win32diskimager-v0.7-binary.zip at the time of writing).

  4. Extract that ZIP file too and run the Win32DiskImager application. On Windows 7/8 you might need to run it as an administrator by right-clicking on the application and selecting Run as administrator.

  5. Select the IMG file you extracted earlier and choose the volume letter of your SD card slot from the Device drop-down menu. It is very important to verify that you have the correct volume of your SD card! Finally, click on Write and wait for the process to finish.

SD card image writing in Mac OS X or Linux

Two things are needed to prepare your SD card – an uncompressed image and an image writer script.

  1. When your image has finished downloading, you'll need to unzip it, usually by double-clicking on the ZIP file or by right-clicking and selecting Extract here. Once extracted, you should end up with a disk image file named YYYY-MM-DD-wheezy-raspbian.img.

  2. It is highly recommended that you disconnect any attached USB storage devices for now, to minimize the risk of writing the Raspbian image to the wrong place.

  3. To help us write the Raspbian image file to the SD card, we will be using a Python script written by Aaron Bockover. Visit http://www.intestinate.com/imagewriter.py to download the script and save it to your Desktop folder.

  4. Open up a Terminal (located in /Applications/Utilities on the Mac).

  5. Now we need to start the imagewriter.py script and tell it where to find the Raspbian IMG file. Adapt the following command to suite the paths of your files:

    sudo python ~/Desktop/imagewriter.py ~/Desktop/YYYY-MM-DD-wheezy-raspbian.img
    

    If you don't know the full path to your script or IMG file, you can just drag-and-drop the files on to the Terminal window and the full path will magically appear.

  6. You might be asked to input your user password so that sudo is allowed to run. The script will ask which device you'd like to write the image to. It will present a list of all the currently attached storage devices. Identify your SD card slot with the help of the device description, and the size that should match your card. Finally, type the number of your device and press the Enter key.

  7. If your SD card is currently mounted, the script will prompt you to unmount it first and you'll get a final warning before the operation starts. Answer y to both questions to continue. The progress meter will tell you when the image has been successfully written to your card. You might notice a new storage volume called Untitled. That's the boot partition of Raspbian. You should right-click on this volume and Eject it to safely remove your SD card.

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.