Synopses & Reviews
Ideal for UNIX users who hunger for technical -- yet accessible -- information, UNIX Power Tools, 2nd Edition, consists of tips, tricks, concepts, and freeware (CD-ROM included). It also covers add-on utilities and how to take advantage of clever features in the most popular UNIX utilities.
Loaded with even more practical advice about almost every aspect of UNIX, this edition addresses the technology that UNIX users face today, differing from the first edition in a number of important ways.
First, it slants the blend of options and commands more toward the POSIX utilities, including the GNU versions; the bash and tcsh shells have greater coverage, but we've kept the first edition's emphasis on the core concepts of sh and csh that will help you use all UNIX shells; and, Perl is more important than awk these days, so we've de-emphasized awk in this edition.
This is a browser's book...like a magazine that you don't read from start to finish, but leaf through repeatedly until you realize that you've read it all. The book is structured so that it bursts at the seams with cross references. Interesting "sidebars" explore syntax or point out other directions for exploration, including relevant technical details that might not be immediately apparent. You'll find articles abstracted from other O'Reilly books, new information that highlights program "tricks" and "gotchas," tips posted to the Net over the years, and other accumulated wisdom.
The 53 chapters in this book discuss topics like file management, text editors, shell programming -- even office automation. Overall, there's plenty of material here to satisfy even the most voracious appetites. The bottom line? UNIX Power Tools is loaded with practical advice about almost every aspect of UNIX. It will help you think creatively about UNIX, and will help you get to the point where you can analyze your own problems. Your own solutions won't be far behind.
The CD-ROM includes all of the scripts and aliases from the book, plus perl, GNU emacs, netpbm (graphics manipulation utilities), ispell,screen, the sc spreadsheet, and about 60 other freeware programs. In addition to the source code, all the software is precompiled for Sun4, Digital UNIX, IBM AIX, HP/UX, Red Hat Linux, Solaris, and SCO UNIX.
Synopsis
Campus cultism pervades Nigerian higher educational institutions. It is producing a culture of fear and speculation and hindering academic pursuits. The malevolent nature of the cultists manifests itself in people being disfigured, raped and killed. This book examines the role of the education institutions, religion, the courts, examination bodies, government policies and the military, in propagating the cults. The author contends that the cultism in the universities is embedded in Nigerian society more widely; and that the universities may be considered microcosms of Nigeria at large and its problems. He proposes solutions to combat cultism, but maintains that any solutions must be accompanied by a general overhaul of the country's inefficient and kleptocratic systems.
Synopsis
This concise guide pares down installation and configuration instructions into a series of checklists for Windows administrators. Topics include: Windows NT/2000 security threats, architecture of the Windows NT/2000 operating system and typical perimeter networks, how to build a Windows NT bastion host, and configuring Windows and network services.
Synopsis
In recent years, Windows NT and Windows 2000 systems have emerged as viable platforms for Internet servers. More and more organizations are now entrusting the full spectrum of business activities--including e-commerce--to Windows.
Unfortunately, the typical Windows NT/2000 installation makes a Windows server an easy target for attacks, and configuring Windows for secure Internet use is a complex task. Securing Windows NT/2000 Servers for the Internet suggests a two-part strategy to accomplish the task:
- "Hardening" any Windows server that could potentially be exposed to attacks from the Internet, so the exposed system (known as a "bastion host") is as secure as it can be.
- Providing extra security protection for exposed systems by installing an additional network (known as a "perimeter network") that separates the Internet from an organization's internal networks.
Securing Windows NT/2000 Servers for the Internet is a concise guide that pares down installation and configuration instructions into a series of checklists aimed at Windows administrators. Topics include:
- Introduction--Windows NT/2000 security threats, architecture of the Windows NT/2000 operating system and typical perimeter networks.
- How to build a Windows NT bastion host.
- Configuring Windows and network services, encrypting the password database, editing the registry, setting system policy characteristics, performing TCP/IP configuration, configuring administrative tools, and setting necessary permissions.
- Differences between Windows NT and Windows 2000 security including IPSec (IP Security Protocol) configuration.
- Secure remote administration--SSH, OpenSSH, TCP Wrappers, the Virtual Network Console, and the new Windows 2000 Terminal Services.
- Windows NT/2000 backup, recovery, auditing, and monitoring--event logs, the audit policy, time synchronization with NTP (Network Time Protocol), remote logging, integrity checking, and intrusion detection.
Administrators who carefully follow the detailed instructions provided in this book will dramatically increase the security of their Windows NT/2000 Internet servers.
Synopsis
Loaded with even more practical advice about almost every aspect of UNIX, this new second edition of "UNIX Power Tools" addresses the technology that UNIX users face today. You'll find increased coverage of POSIX utilities, including GNU versions, greater "bash" and "tcsh" shell coverage, more emphasis on Perl, and a CD-ROM that contains the best freeware available.
Synopsis
This comprehensive guide covers buying, building, upgrading, and repairing Intel-based PCs for novices and seasoned professionals alike. It features buying guidelines, how-to advice on installing, configuring, and troubleshooting specific components, plus ample reference material and a complete case study on building a PC from components.
Synopsis
PC Hardware in a Nutshell is a comprehensive guide to buying, building, upgrading, and repairing Intel-based PCs, presented in O'Reilly's concise "In a Nutshell" format. The three major thrusts of the book are:
- Buying guidelines. In supplying advice on how to choose optimum systems and components, the book focuses on teaching the reader how to evaluate alternatives rather than on recommending specific products.
- How-to advice. The book is loaded with practical, hands-on information about how to install, configure, and troubleshoot specific components.
- Reference. Numerous tables and the topical organization let novices and professionals alike consult the book for the specifications and steps they need in order to perform discrete tasks.
In addition to covering the fundamentals and general tips about working on PCs, the book includes chapters focusing on motherboards, processors, memory, disks (floppies, hard drives, and optical drives), tape devices, video devices, input devices, audio components, communications, power supplies, and maintenance. The last chapter is a complete case study in building a PC from components.
PC Hardware in a Nutshell is supported by a web site that provides:
- A depository of obsolescent or arcane material that didn't make the book but may still be useful to some
- New and updated material that will appear in updated editions
- Errata
- A Mail drop for reader feedback and suggestions
PC Hardware in a Nutshell is a compact guide, accessible to the ordinary reader and invaluable for the seasoned professional.
Synopsis
PHP is a simple yet powerful open source scripting language that has become a big player in web development. Over a million web sites, from large corporate sites to small personal sites, are using PHP to serve dynamic web content. PHP's broad feature set, approachable syntax, and support for different operating systems and web servers make it an ideal language for rapid web development.
The PHP Cookbook is a collection of problems, solutions, and practical examples for PHP programmers. The book contains a unique and extensive collection of best practices for everyday PHP programming dilemmas. For every problem addressed in the book, there's a worked-out solution or "recipe" -- short, focused pieces of code that you can insert directly into your applications. But this book offers more than cut-and-paste code. You also get explanations of how and why the code works, so you can learn to adapt the problem-solving techniques to similar situations.
The recipes in the PHP Cookbook range from simple tasks, such as sending a database query and fetching URLs, to entire programs that demonstrate complex tasks, such as printing HTML tables and generating bar charts. This book contains over 250 recipes on the following topics:
- Working with basic data types, including strings, numbers, dates and times, and arrays
- PHP building blocks, such as variables, functions, classes, and objects
- Web programming, including forms, database access, and XML
- Useful features like regular expressions, encryption and security, graphics, internationalization and localization, and Internet services
- Working with files and directories
- Command-line PHP and PHP-GTK
- PEAR, the PHP Extension and Application Repository
This book contains an impressive collection of useful code for PHP programmers, from novices to advanced practitioners. Instead of poking around mailing lists, online documentation, and other sources, you can rely on the
PHP Cookbook to provide quick solutions to common problems, so you can spend your time on those out-of-the-ordinary problems specific to your application.
About the Author
is an independent software development and strategic technology consultant. He was a co-founder and the Chief Technology Officer of Student.Com and TVGrid.Com. At both companies, David oversaw the architecture and development of varied systems to deliver personalized dynamic content to users around the world. After discovering PHP as a solution to his web programming needs in 1996, he created the PX (http://px.sklar.com/), which enables PHP users to exchange programs. Since then, he has continued to rely on PHP for personal and professional projects. When away from the computer, David eats mini-donuts, plays records, and likes to cook. He lives in New York City and has a degree in Computer Science from Yale University.
Adam Trachtenberg has an MBA from Columbia Business School. At business school, he focused on general management and operations, with an emphasis on the field of technology. Adam also has a BA from Columbia University. As an undergraduate, he majored in mathematics and his other studies included computer science and Chinese. Before returning to school, he co-founded and served as Vice President for Development at two companies, Student.Com and TVGrid.Com. At both firms, he led the front- and middle-end web site design and development, worked on corporate planning and strategy, and served as liaison between the product and marketing teams. During study breaks, Adam enjoys playing squash, reading fiction, and eating in New York City's many wonderful restaurants. He wishes he was a better at playing pool, knew the constellations, and was handy around the house.
Table of Contents
Preface; Who This Book Is For; What Is in This Book; Other Resources; Conventions Used in This Book; Comments and Questions; Acknowledgments; Chapter 1: Strings; 1.1 Introduction; 1.2 Accessing Substrings; 1.3 Replacing Substrings; 1.4 Processing a String One Character at a Time; 1.5 Reversing a String by Word or Character; 1.6 Expanding and Compressing Tabs; 1.7 Controlling Case; 1.8 Interpolating Functions and Expressions Within Strings; 1.9 Trimming Blanks from a String; 1.10 Parsing Comma-Separated Data; 1.11 Parsing Fixed-Width Delimited Data; 1.12 Taking Strings Apart; 1.13 Wrapping Text at a Certain Line Length; 1.14 Storing Binary Data in Strings; Chapter 2: Numbers; 2.1 Introduction; 2.2 Checking Whether a String Contains a Valid Number; 2.3 Comparing Floating-Point Numbers; 2.4 Rounding Floating-Point Numbers; 2.5 Operating on a Series of Integers; 2.6 Generating Random Numbers Within a Range; 2.7 Generating Biased Random Numbers; 2.8 Taking Logarithms; 2.9 Calculating Exponents; 2.10 Formatting Numbers; 2.11 Printing Correct Plurals; 2.12 Calculating Trigonometric Functions; 2.13 Doing Trigonometry in Degrees, not Radians; 2.14 Handling Very Large or Very Small Numbers; 2.15 Converting Between Bases; 2.16 Calculating Using Numbers in Bases Other Than Decimal; Chapter 3: Dates and Times; 3.1 Introduction; 3.2 Finding the Current Date and Time; 3.3 Converting Time and Date Parts to an Epoch Timestamp; 3.4 Converting an Epoch Timestamp to Time and Date Parts; 3.5 Printing a Date or Time in a Specified Format; 3.6 Finding the Difference of Two Dates; 3.7 Finding the Difference of Two Dates with Julian Days; 3.8 Finding the Day in a Week, Month, Year, or the Week Number in a Year; 3.9 Validating a Date; 3.10 Parsing Dates and Times from Strings; 3.11 Adding to or Subtracting from a Date; 3.12 Calculating Time with Time Zones; 3.13 Accounting for Daylight Saving Time; 3.14 Generating a High-Precision Time; 3.15 Generating Time Ranges; 3.16 Using Non-Gregorian Calendars; 3.17 Program: Calendar; Chapter 4: Arrays; 4.1 Introduction; 4.2 Specifying an Array Not Beginning at Element 0; 4.3 Storing Multiple Elements per Key in an Array; 4.4 Initializing an Array to a Range of Integers; 4.5 Iterating Through an Array; 4.6 Deleting Elements from an Array; 4.7 Changing Array Size; 4.8 Appending One Array to Another; 4.9 Turning an Array into a String; 4.10 Printing an Array with Commas; 4.11 Checking if a Key Is in an Array; 4.12 Checking if an Element Is in an Array; 4.13 Finding the Position of an Element in an Array; 4.14 Finding Elements That Pass a Certain Test; 4.15 Finding the Largest or Smallest Valued Element in an Array; 4.16 Reversing an Array; 4.17 Sorting an Array; 4.18 Sorting an Array by a Computable Field; 4.19 Sorting Multiple Arrays; 4.20 Sorting an Array Using a Method Instead of a Function; 4.21 Randomizing an Array; 4.22 Shuffling a Deck of Cards; 4.23 Removing Duplicate Elements from an Array; 4.24 Finding the Union, Intersection, or Difference of Two Arrays; 4.25 Finding All Element Combinations of an Array; 4.26 Finding All Permutations of an Array; 4.27 Program: Printing an Array in a Horizontally Columned HTML Table; Chapter 5: Variables; 5.1 Introduction; 5.2 Avoiding == Versus = Confusion; 5.3 Establishing a Default Value; 5.4 Exchanging Values Without Using Temporary Variables; 5.5 Creating a Dynamic Variable Name; 5.6 Using Static Variables; 5.7 Sharing Variables Between Processes; 5.8 Encapsulating Complex Data Types as a String; 5.9 Dumping Variable Contents as Strings; Chapter 6: Functions; 6.1 Introduction; 6.2 Accessing Function Parameters; 6.3 Setting Default Values for Function Parameters; 6.4 Passing Values by Reference; 6.5 Using Named Parameters; 6.6 Creating Functions That Take a Variable Number of Arguments; 6.7 Returning Values by Reference; 6.8 Returning More Than One Value; 6.9 Skipping Selected Return Values; 6.10 Returning Failure; 6.11 Calling Variable Functions; 6.12 Accessing a Global Variable Inside a Function; 6.13 Creating Dynamic Functions; Chapter 7: Classes and Objects; 7.1 Introduction; 7.2 Instantiating Objects; 7.3 Defining Object Constructors; 7.4 Destroying an Object; 7.5 Cloning Objects; 7.6 Assigning Object References; 7.7 Calling Methods on an Object Returned by Another Method; 7.8 Accessing Overridden Methods; 7.9 Using Property Overloading; 7.10 Using Method Polymorphism; 7.11 Finding the Methods and Properties of an Object; 7.12 Adding Properties to a Base Object; 7.13 Creating a Class Dynamically; 7.14 Instantiating an Object Dynamically; Chapter 8: Web Basics; 8.1 Introduction; 8.2 Setting Cookies; 8.3 Reading Cookie Values; 8.4 Deleting Cookies; 8.5 Redirecting to a Different Location; 8.6 Using Sessionnnnnn Tracking; 8.7 Storing Sessions in a Database; 8.8 Detecting Different Browsers; 8.9 Building a GET Query String; 8.10 Using HTTP Basic Authentication; 8.11 Using Cookie Authentication; 8.12 Flushing Output to the Browser; 8.13 Buffering Output to the Browser; 8.14 Compressing Web Output with gzip; 8.15 Hiding Error Messages from Users; 8.16 Tuning Error Handling; 8.17 Using a Custom Error Handler; 8.18 Logging Errors; 8.19 Eliminating headers already sent” Errors; 8.20 Logging Debugging Information; 8.21 Reading Environment Variables; 8.22 Setting Environment Variables; 8.23 Reading Configuration Variables; 8.24 Setting Configuration Variables; 8.25 Communicating Within Apache; 8.26 Profiling Code; 8.27 Program: Website Account (De)activator; 8.28 Program: Abusive User Checker; Chapter 9: Forms; 9.1 Introduction; 9.2 Processing Form Input; 9.3 Validating Form Input; 9.4 Working with Multipage Forms; 9.5 Redisplaying Forms with Preserved Information and Error Messages; 9.6 Guarding Against Multiple Submission of the Same Form; 9.7 Processing Uploaded Files; 9.8 Securing PHPs Form Processing; 9.9 Escaping Control Characters from User Data; 9.10 Handling Remote Variables with Periods in Their Names; 9.11 Using Form Elements with Multiple Options; 9.12 Creating Dropdown Menus Based on the Current Date; Chapter 10: Database Access; 10.1 Introduction; 10.2 Using Text-File Databases; 10.3 Using DBM Databases; 10.4 Connecting to a SQL Database; 10.5 Querying a SQL Database; 10.6 Retrieving Rows Without a Loop; 10.7 Modifying Data in a SQL Database; 10.8 Repeating Queries Efficiently; 10.9 Finding the Number of Rows Returned by a Query; 10.10 Escaping Quotes; 10.11 Logging Debugging Information and Errors; 10.12 Assigning Unique ID Values Automatically; 10.13 Building Queries Programmatically; 10.14 Making Paginated Links for a Series of Records; 10.15 Caching Queries and Results; 10.16 Program: Storing a Threaded Message Board; Chapter 11: Web Automation; 11.1 Introduction; 11.2 Fetching a URL with the GET Method; 11.3 Fetching a URL with the POST Method; 11.4 Fetching a URL with Cookies; 11.5 Fetching a URL with Headers; 11.6 Fetching an HTTPS URL; 11.7 Debugging the Raw HTTP Exchange; 11.8 Marking Up a Web Page; 11.9 Extracting Links from an HTML File; 11.10 Converting ASCII to HTML; 11.11 Converting HTML to ASCII; 11.12 Removing HTML and PHP Tags; 11.13 Using Smarty Templates; 11.14 Parsing a Web Server Log File; 11.15 Program: Finding Stale Links; 11.16 Program: Finding Fresh Links; Chapter 12: XML; 12.1 Introduction; 12.2 Generating XML Manually; 12.3 Generating XML with the DOM; 12.4 Parsing XML with the DOM; 12.5 Parsing XML with SAX; 12.6 Transforming XML with XSLT; 12.7 Sending XML-RPC Requests; 12.8 Receiving XML-RPC Requests; 12.9 Sending SOAP Requests; 12.10 Receiving SOAP Requests; 12.11 Exchanging Data with WDDX; 12.12 Reading RSS Feeds; Chapter 13: Regular Expressions; 13.1 Introduction; 13.2 Switching From ereg to preg; 13.3 Matching Words; 13.4 Finding the nth Occurrence of a Match; 13.5 Choosing Greedy or Nongreedy Matches; 13.6 Matching a Valid Email Address; 13.7 Finding All Lines in a File That Match a Pattern; 13.8 Capturing Text Inside HTML Tags; 13.9 Escaping Special Characters in a Regular Expression; 13.10 Reading Records with a Pattern Separator; Chapter 14: Encryption and Security; 14.1 Introduction; 14.2 Keeping Passwords Out of Your Site Files; 14.3 Obscuring Data with Encoding; 14.4 Verifying Data with Hashes; 14.5 Storing Passwords; 14.6 Checking Password Strength; 14.7 Dealing with Lost Passwords; 14.8 Encrypting and Decrypting Data; 14.9 Storing Encrypted Data in a File or Database; 14.10 Sharing Encrypted Data with Another Web Site; 14.11 Detecting SSL; 14.12 Encrypting Email with GPG; Chapter 15: Graphics; 15.1 Introduction; 15.2 Drawing Lines, Rectangles, and Polygons; 15.3 Drawing Arcs, Ellipses, and Circles; 15.4 Drawing with Patterned Lines; 15.5 Drawing Text; 15.6 Drawing Centered Text; 15.7 Building Dynamic Images; 15.8 Getting and Setting a Transparent Color; 15.9 Serving Images Securely; 15.10 Program: Generating Bar Charts from Poll Results; Chapter 16: Internationalization and Localization; 16.1 Introduction; 16.2 Listing Available Locales; 16.3 Using a Particular Locale; 16.4 Setting the Default Locale; 16.5 Localizing Text Messages; 16.6 Localizing Dates and Times; 16.7 Localizing Currency Values; 16.8 Localizing Images; 16.9 Localizing Included Files; 16.10 Managing Localization Resources; 16.11 Using gettext; 16.12 Reading or Writing Unicode Characters; Chapter 17: Internet Services; 17.1 Introduction; 17.2 Sending Mail; 17.3 Sending MIME Mail; 17.4 Reading Mail with IMAP or POP3; 17.5 Posting Messages to Usenet Newsgroups; 17.6 Reading Usenet News Messages; 17.7 Getting and Putting Files with FTP; 17.8 Looking Up Addresses with LDAP; 17.9 Using LDAP for User Authentication; 17.10 Performing DNS Lookups; 17.11 Checking if a Host Is Alive; 17.12 Getting Information About a Domain Name; Chapter 18: Files; 18.1 Introduction; 18.2 Creating or Opening a Local File; 18.3 Creating a Temporary File; 18.4 Opening a Remote File; 18.5 Reading from Standard Input; 18.6 Reading a File into a String; 18.7 Counting Lines, Paragraphs, or Records in a File; 18.8 Processing Every Word in a File; 18.9 Reading a Particular Line in a File; 18.10 Processing a File Backward by Line or Paragraph; 18.11 Picking a Random Line from a File; 18.12 Randomizing All Lines in a File; 18.13 Processing Variable Length Text Fields; 18.14 Reading Configuration Files; 18.15 Reading from or Writing to a Specific Location in a File; 18.16 Removing the Last Line of a File; 18.17 Modifying a File in Place Without a Temporary File; 18.18 Flushing Output to a File; 18.19 Writing to Standard Output; 18.20 Writing to Many Filehandles Simultaneously; 18.21 Escaping Shell Metacharacters; 18.22 Passing Input to a Program; 18.23 Reading Standard Output from a Program; 18.24 Reading Standard Error from a Program; 18.25 Locking a File; 18.26 Reading and Writing Compressed Files; 18.27 Program: Unzip; Chapter 19: Directories; 19.1 Introduction; 19.2 Getting and Setting File Timestamps; 19.3 Getting File Information; 19.4 Changing File Permissions or Ownership; 19.5 Splitting a Filename into Its Component Parts; 19.6 Deleting a File; 19.7 Copying or Moving a File; 19.8 Processing All Files in a Directory Recursively; 19.9 Getting a List of Filenames Matching a Pattern; 19.10 Processing All Files in a Directory; 19.11 Making New Directories; 19.12 Removing a Directory and Its Contents; 19.13 Program: Web Server Directory Listing; 19.14 Program: Site Search; Chapter 20: Client-Side PHP; 20.1 Introduction; 20.2 Parsing Program Arguments; 20.3 Parsing Program Arguments with getopt; 20.4 Reading from the Keyboard; 20.5 Reading Passwords; 20.6 Displaying a GUI Widget in a Window; 20.7 Displaying Multiple GUI Widgets in a Window; 20.8 Responding to User Actions; 20.9 Displaying Menus; 20.10 Program: Command Shell; 20.11 Program: Displaying Weather Conditions; Chapter 21: PEAR; 21.1 Introduction; 21.2 Using the PEAR Package Manager; 21.3 Finding PEAR Packages; 21.4 Finding Information About a Package; 21.5 Installing PEAR Packages; 21.6 Installing PECL Packages; 21.7 Upgrading PEAR Packages; 21.8 Uninstalling PEAR Packages; 21.9 Documenting Classes with PHPDoc; Colophon;