Skip to content

16 search results for "python"

Linux in a Nutshell, sixth edition

Years ago I purchased a copy of Linux in a Nutshell, fourth edition. That book has been well used and is looking a bit shabby. When O’Reilly offered me a free review copy of Linux in a Nutshell, sixth edition, I jumped at the chance. Some of the thoughts that follow will apply to either edition (as well as the not-reviewed fifth edition, which I don’t have), but I will point out some of the more important or obvious updates to help others who also own older editions to determine whether the changes are sufficient to convince them to buy the new version.

This book is not intended as a tutorial, but rather as a quick reference. While the irony of titling a 900+ page book “… in a Nutshell” is not lost on me, like all of the books in O’Reilly’s Nutshell series, this book is a fabulous resource for finding out the details of a specific command or concept rapidly.

Let me start with the foundation for my opinion that this book is one of the most useful and important books for anyone who uses Linux from the command line on a regular basis or wants to be able to or plans to do so. Any command you should desire to use is listed in chapter 3, with the command’s syntax and options. This gives you one place to look that does not require an internet connection or the patience to scroll up and down reading man pages for commands. This is a book about Linux as it was originally conceived and intended: a powerful operating system based directly upon and consistent with the philosophy and design of Unix, but free for anyone to download, install, copy, modify, share and use.

This book is not about how to use Linux on the desktop, and in fact, the sixth edition does not cover the Linux desktop at all. What you do find are discussions, descriptions, and definitions of all of the main tools and tricks a person needs to get work accomplished using Linux as a platform–not the specific programming languages like C, Java or Python, but the underlying tools such as commands from the GNU project and BSD, editors like vi and emacs, using the bash shell, source code management using subversion and git (both new to this edition, replacing a discussion of CVS), and great introductions to Linux system and network administration. In addition, we have a wonderful new chapter on virtualization command line tools that covers all the main options such as KVM, Xen and VMware.

I am amazed that my description thus far has only scratched the surface of the book. I haven’t yet mentioned the chapters covering sed and gawk, the discussion of software package management, the chapter detailing LILO and Grub boot loaders, or the lovely section on pattern matching which should save a lot of people a good amount of time.

My disappointments in the book are a bit niggly. While the book was written and tested using each of the main Linux distributions (Debian, Ubuntu, Fedora and SUSE), there have been a couple of updates to software covered in the book that were not available when the book went to press. Since I know how long it takes to write and prepare a manuscript for printing, it is kind of silly for me to want a book that was published in September 2009 to cover Windows 7 (although dual booting with earlier versions is covered), ext4, or Grub2, even if these are all current in late October 2009 (the latter two being included in Ubuntu 9.10).

The positives are that this is a clear, well written and edited (disclosure: I worked with one of the editors, Andy Oram, on VMware Cookbook), and filled with valuable information with an easy to use index and table of contents with a tighter than previous focus on the internal bits of Linux without the earlier distractions of trying to mention GNOME and KDE or a wider variety of shell options while only covering each with too little detail to be useful. This edition expands the content on the things it does cover to a very useful level of detail while making the hard decision of what to omit to keep the book within a bindable number of pages.

In any edition, this book has a permanent place on my shelf for reference. If you own an older version, the decision to buy the latest edition will depend on whether you want or need the absolute latest info on specific commands (this stuff doesn’t change often, but it does change) and whether you are interested in the new or expanded material covered in this edition as outlined above. If you never use the command line in Linux, the book might not interest you. Otherwise, I can’t imagine using Linux without having a copy nearby.

Disclosures: I bought an earlier edition, but was given the sixth edition free by O’Reilly as a review copy, I write for O’Reilly, and I have worked with one of the editors who also worked on this book.

Programming the Semantic Web

The semantic web. We have all heard about it, the buzz, the hype, and the excitement. Much of it seems well founded once you look deeper into the idea of organizing and making data available in a way that machines can find it, share it, and combine it in new ways that were not considered or even thought of when the data was being collected. This can yield amazing results and discoveries, but to do it, we need to move beyond theory and into practice. That is what this book is about.

Programming the Semantic Web starts with a clear and practical introduction to the idea of the semantic web that will give any web developer the background necessary to comprehend the potential and usefulness of the concept. This is not a book for complete novices as it does anticipate that the reader will have previous experience with programming for the web, including the concepts of relational databases, familiarity with HTML and XML and perhaps a little RDF, and it would be useful to have some knowledge of Python and/or other computer programming languages.

The first part of the book, about 20% of the text, is dedicated to a discussion of what semantics are, how they can be used to express meaning, and why they have the potential to make data storage easily searchable and allow the discovery of new connections that were not considered during the design or collection stages. We learn here how semantic modeling can be expanded with far less pain than a traditional relational database format, allowing the administrator to adjust interfaces and searches quickly in response to the needs of users.

In Part II, the book discusses the practical technological foundations necessary to begin using RDF and other formats to store data in semantic fashion and make it useful. This involves understanding the libraries available to various programming languages and sources of semantic data from which connections may be made or discovered. One of the really powerful aspects here is that you are not constrained to using data from only one database or server, but when the data is organized and stored in a standardized semantic format such as RDF, it may be made available for reading by anyone (if desired) without any risk of it being overwritten by using a query language like SPARQL instead of the better known SQL.

The rest of the book is where the real meat and uniqueness lie. We need the foundation of the previous parts to be certain that everyone has the same understanding of the philosophy and goal of the semantic web. However, the third part of the book is what makes this discussion unique and useful. Here we get a practical overview of toolkits and examples, both code and frameworks, to enable web designers and data wranglers to begin to use the ideas in real life scenarios. Finally we have a way to move beyond all of the discussions and evangelism into implementation! The examples given are clear, useful, practical, and cover all of the sorts of things one might want to do with data. This section is the reason anyone interested in the semantic web should buy the book, and it is also the reason that anyone buying the book should be familiar with coding for the web. The examples are often given in Python and/or Java, using specific toolkits and frameworks like Sesame. The section describes how to publish for internal use as well as how to format and publish data so that others may use it without risking it being corrupted or changed.

The book ends with a short section intended to separate hype from reality and give some vision for where semantic web design might fit in with other technologies already in use, coming alongside already useful tools, not to make them obsolete, but to make them even more beneficial.

The Manga Guide to Databases

I have used relational databases for years. I’ve used them to store mailing lists, email account data for postfix, blog and forum data, and more. They are convenient and powerful time savers. Most of what I have learned has been indirectly learned while studying something else; documentation for a computer programming language like PHP or Python, a book on website design for commerce, or documentation and code for an open source project like WordPress or Drupal. As a result, my knowledge is adequate for simple tasks and queries, but I’m nowhere near ready to be a database admin. What I know is incomplete, adequate for my actual needs, but with gaping holes in my knowledge.

Until this week, I was comfortable with this fact.

Since I read and enjoyed the other manga guides in this series that I have read, I picked up a copy of The Manga Guide to Databases. I wanted to see whether the book made the subject interesting and whether it taught the subject well.

The short answer is that I found the systematic and foundational introduction to database design clear, interesting, and enjoyable–so much so that I have ordered a few more books on database theory and design and SQL for further study (stay tuned, I may review them later). Contrast that with the indirect introductions I have previously encountered that made me want to ignore the topic, except for the aspects vital to my task(s) at hand.

The Manga Guide to Databases uses a somewhat silly, but pleasant story with well drawn artwork to ease the reader into a complicated subject that requires paying a bit of attention to for comprehension. It begins with the assumption that the reader knows nothing about the topic, so it would be perfect as a base level introductory text, especially for high school aged readers (or those of us who are a bit older, but who still enjoy a bit of whimsy).

We start with the question “What is a database?” and a great description of how and why they are useful. We move into a basic definition of relational databases with a very brief mention of other types of databases that exist. The fun continues with a chance to design a database around the model of entities and relationships.

Once the foundation is laid with a conceptual understanding of databases and their design, structured query language (SQL) is introduced. I was thrilled to discover this wasn’t product specific language, but rather standard ANSI, at least as far as I can tell (okay, I know a little more than I let on earlier, but I still consider myself a database/SQL novice). That is great, because it means that whatever is learned here should apply anywhere, whether using MySQL, PostgreSQL, Oracle, Access, Microsoft SQL Server, or whatever, so long as the product conforms to the standard. This certainly isn’t a complete SQL introductory text, but it is enough to get a person started understanding the basic concepts and how to operate a database.

Ultimately, the book was a success. I wouldn’t kid anyone into thinking that reading and understanding this book would make a person capable of real database administration, but it does give a clear and solid foundation for further study, and in my case has whet my appetite for going back to fill in some personal knowledge gaps that I have been content to let exist for a very long time.

Learning JavaScript

I recently became the maintainer for a site that uses a bit of JavaScript. Surprisingly, I have no previous experience writing or maintaining anything in JavaScript, so I needed to get up to speed, if only to know what is going on. To help me out, I picked up a copy of Shelley Powers’ new book, Learning JavaScript.

I am familiar with Shelley Powers’ work, having read Unix Power Tools, a book that holds a special place on my shelf for its usefulness and depth. She is obviously someone who knows what she is doing.

This book states in the preface that

Readers of this book should be familiar with web page technology, including Cascading Style Sheets (CSS) and HTML/XHTML. Previous programming experience isn’t required, though some sections may require extra review if you have no previous exposure to programming.

That sums up the only negative thing I might be tempted to say about the book. Usually, O’Reilly’s “Learning” series books are excellent resources for complete newcomers and are the sort of books that I might point a novice toward. While this book is designed for the JavaScript novice, it is not the best resource for a programming/web creation novice. If you can’t follow or understand the following quoted sentences, this book isn’t for you. If you can, this book does an excellent job of covering the basics of JavaScript in depth and may end up being the only text you need on the topic.

JavaScript has just three primitive data types: string, numeric, and boolean. Each is differentiated from the others by the type of value it contains: string, numeric, and boolean, respectively.

My first exposure to programming was in 1981, using BASIC on a Radio Shack TRS-80 Color Computer. Over the years, I have studied (and often forgotten, but can certainly read a bit and understand the concepts of) LISP, C, Bash scripting, Perl, Python, and more. Lately I have spent more time using PHP and enjoying it, since that is the language of things like WordPress, Drupal, vBulletin and other commonly used CMS and interactive web site software. The two sentences quoted above seem perfectly clear to me, but I can imagine what they must seem like to someone with no experience with programming languages. So, now you have been warned. Let’s get to the good stuff for those who understand the jargon.

This book is clear, with enough detail to help you understand what is happening without bogging you down in the minutiae. The reader is expected to see how and why each facet of the language would be useful, so the examples given are simple and seem to be designed to help her get the feel for usage without pretending to be a cookbook of programming recipes, although some seem quite useful as they are such as Chapter 6’s code for browser detection, which allows you to modify content and/or how it is displayed based on the web browser being used to view your site.

The text covers everything you are likely to need while using JavaScript, and more importantly for me, most everything a person is likely to stumble across when reading existing code. You get a solid introduction to data types and variables, operators, statements, objects, and functions. This is built upon with chapters on debugging and cross-browser compatibility. This new second edition (just released earlier in 2009) has several updates and changes from the previous version including a wonderful comparison of the benefits of generating and processing XML data using Ajax versus using JSON.

If you are considering using JavaScript on a website that includes the dynamic creation of web pages, or if you have inherited one that you are now responsible for maintaining, this book would be a good resource to help you start to understand one of the more common languages used for doing so. This is especially true if you have any prior experience with any other programming language. If you want a cookbook, scripted-style, “do this, now do that” sort of beginner’s guide to making a site that holds your hand through the whole process, this is not the book you want.

An interview with Nicolas Valcárcel

Today’s interviewee volunteered to participate in the Ubuntu Community Interviews series some time ago. He is involved in some of the more technical aspects of the community, helping maintain and place packages in the repositories, working to keep Ubuntu up to date with security, and lots more. Enjoy!

1. Tell as much as you’re willing about your “real” life – name, age, gender, location, family, religion, profession, education, hobbies, etc.

I’m Nicolas Valcárcel Scerpella. I am a 24 years old male Peruvian student living in Lima – Perú with my parents, 2 sisters and a rotweiler. I’m coursing the 7th-8th period of systems engineering at the University “de lima”, working as Security Engineer in the OEM Solutions Group for Canonical. Before that i was Senior consultant in Aureal Systems, doing mainly sysadmin work on the client’s server (primary in Linux, but here was some other *nix like ones). I love adventure sports and outsides, i used to surf, skate and also played rugby at the university. While i was still at school i also used to row at the “Club de Regatas Lima” from 1998 until 2001.

2. When and how did you become interested in computers? in Linux? in Ubuntu? In computers?

Since i remember. When i was really young (4 years or so) my mother used to bring me to her work and sit me on a computer to play games all day long, i can’t remember any time of my life without a computer (well, only when i travel to outsides). With Linux i started late, in summer 2004 IIRC when read about this “OS for hackers” while i
was on the underground world of internet :P, then i tested a lot of distros until i found debian, after using it for a while Warty Warthog showed and i started using Ubuntu since then.

3. When did you become involved in the forums (or the Ubuntu community)? What’s your role there?

I’m not involved in the forums, but i started involving myself in the Ubuntu community on May 2007 when i sent my first patch ). Then it was a non stop road, slow at the beginning, until now that i’m a MOTU. Also i am part of the Peruvian LoCo team council, where we do a lot of advocacy. Now i’m focusing myself on bringing more people to the packaging world.

4. Are you an Ubuntu member? If so, how do you contribute? If not, do you plan on becoming one?

Yes i am! I contribute in the Server Team primarily.

5. What distros do you regularly use? What software? What’s your favorite application? Your least favorite? Distros?

Now only ubuntu, but on my previous work i use CentOS on servers for the clients due a company policy which i couldn’t change. For software i mostly use Firefox as a web browser, Evolution as mail client, Terminator as terminal emulator, Pidgin as msn messenger, Empathy as jabber client, python as programming language and a LOT of console tools.

6. What’s your fondest memory from the forums, or from Ubuntu overall? What’s your worst?

Well that would be my lovely mentors and sponsors. I have so much to thank them. When i give a talk i always remark how wonderful developers the ubuntu community have and how norsetto, persia and ScottK help me at
the very beginning. Also some people i admire (and always talk about them) are TheMuso and heno, who having real problems are so good at what they do, it’s just amazing, i really admire them. The worst? I don’t have any bad moment in mind (i haven’t had one or i have just forget them).

7. What luck have you had introducing new computer users to Ubuntu?

Really good, with the LoCo team we do a lot of advocacy and we have a lot of happy new ubuntu users.

8. What would you like to see happen with Linux in the future? with Ubuntu?

I really want to see more companies stop seeing linux as a hippies thing (or insignificant OS). I want to see more Hw manufacturers writing drivers for Linux, and more software being developed for it (as in propietary software migrating to linux [To think on them open his source is just craziness]).

9. If there was one thing you could tell all new Ubuntu users, what would it be?

Don’t quit, there is a wonderful world of amazing people and communities working behind the scenes for you to have this amazing product on hands. It’s hard at the beginning but really wonderful once you catch it.

An interview with the SABDFL

Our next interviewee in these Ubuntu community interviews really needs no introduction, but this is me, so I’ll write one anyway. The Self-Appointed Benevolent Dictator for Life, or SABDFL (see the bottom of the linked page), is an exceptional person. Mark Shuttleworth, in addition to being an all-around nice guy, is also a true geek at heart, with the credentials and accomplishments to prove it. I am sure you would enjoy his blog, and to answer the question on everyone’s mind, yes, he does have an Ubuntu Forums account, but he is a busy guy and isn’t able to spend much time using it. That can certainly be forgiven, as he does so many other wonderful things for our community. So, without further ado, I present one of my favorite interviews thus far.

1. Tell as much as you’re willing about your “real” life – name, age, gender, location, family, religion, profession, education, hobbies, etc.

Ubuntu is my real life!

I don’t believe in separating work and play – I try to work only on the things that are really interesting, and where I think I can make a unique difference. Last year, as a snowboarding project, I built a communications package that integrated cell, walkie-talkie and ipod into a single audio stream, with builtin microphone and speakers in the helmet. That was play, but it was also work, I learned a lot in the process.

By way of stats I suppose I would say 34, South African, straight male, London, wonder-filled-atheist (by which I mean I consider the universe to be wondrous in ways we can’t even comprehend, but I don’t think I’m made in god’s image any more than a jellyfish might be), investor-in-change, Bachelor’s in Business Science (Finance, IS), snowboarding and wine/women/song.

2. When and how did you become interested in computers? in Linux? in Ubuntu?

Computers, technology generally, and the changes they are bringing about in society, have been a fascination for me as long as I can remember. My folks bought me a chemistry set when I was a wee lad and I promptly covered the kitchen in various kinds of ash and other explosive debris. While I never managed to build a rocket engine, I spent hours trying to and loved the fact that old encyclopedias would happily give you the recipe for gunpowder, unlike today’s bland and politically correct safety-first stuff. Thank goodness for the web!

I became interested in Linux while at university. I was really interested in the net and the web, and couldn’t get Windows to do any of that properly (run a web server, even a decent browser or TCP/IP stack). So I sat down with a stack of slackware floppies and never looked back. Linux provided the canvas for me and many other entrepreneurs to draw our net dreams on, and I was luckier than most. Today, I’d like to bring that same freedom of technological expression to everyone, and that means finding a way to contribute to the spread of free software – hence Ubuntu.

Ubuntu started with the belief that we could find a business model which would let us deliver free software free of charge, unlike the existing commercial distributions, which take free software and turn it into something that only some people are allowed to use if they’ve paid the necessary fee. The key values were that it should be released on a predictable schedule, should be part of the Debian family, should always deliver the very best of the free software stack in a nicely integrated stack, should be governed as a community independent of the company(s) that back it, and should be available free of charge, with all security updates, for a long enough period that it’s actually useful as a commercial, production platform. I would credit the whole Ubuntu community with helping to turn those ideals into a real, and quite remarkable, product.

3. When did you become involved in the forums (or the Ubuntu community)? What’s your role there?

I lead the Community Council, which is the group entrusted with the “constitutional” issues in Ubuntu. We are responsible for governance in the project at large, and we delegate authority to the leaders in each part of the community who are most competent to be responsible for that piece.

I’d never used a web forum before Ubuntu. Ryan Troy really got the Forums going in 2004, and did a great job of building a community and a leadership team there, that is now the Forums Council [Ryan Troy is also known as ubuntu-geek, ed.]. We worked to integrate that into the broader Ubuntu community governance structure, and I’m delighted with the results. There’s a huge amount of activity in the forums, and I would like to make sure that the people who contribute there are recognised widely within the community for that contribution. For example, we really should have Community Karma for folks who post in the forums – that’s been discussed for a long time, but never fully implemented in Launchpad.

4. Are you an Ubuntu member? If so, how do you contribute? If not, do you plan on becoming one?

Yes, mainly though time and effort on CC issues as well as helping to fund Canonical’s activity in the community.

5. What distros do you regularly use? What software? What’s your favorite application? Your least favorite?

Only Ubuntu. I also use a Mac at home and Windows on occasion. My favourite application is bzr, because I have worked closely with the leaders in that community and feel some fatherly influence on its growth and development. I’m really interested in how Canonical and Ubuntu can help to pioneer genuinely better practices in the state fo the art of software, and Bzr is a wonderful contribution to that which I hope will make a big difference across the whole of the open source ecosystem, including other distributions.

My least favourite app… probably GCC, just because I don’t have the clarity of engineering to work in C! I think it’s a great pity that Objective C hasn’t taken root more deeply in the free software world. My ideal development environment would have elements of Python syntax all the way from the shell, through the script (Python) and down to the fastest-compiled language.

6. What’s your fondest memory from the forums, or from Ubuntu overall? What’s your worst?

My favourite memories are stories of how people are using Ubuntu. Often, I’m with folks wearing Ubuntu t-shirts walking in the street, and we get stopped by other people who say “Man, I love Ubuntu”, and what I find fascinating about it is that they are in the most amazing spread of professions, from taxi drivers to librarians and musicians. My worst memories… I think the open source community has a dangerous habit of reserving the nastiest vitriol for factions of itself. I always find it disappointing when one group of open source folks is really nasty about another group. We have bigger fish to fry.

7. What luck have you had introducing new computer users to Ubuntu?

Rather a lot!

8. What would you like to see happen with Linux in the future? with Ubuntu?

I’d like to see free software become the de facto standard way “people do software”, and I hope Ubuntu is making a big contribution in that regard.

9. If there was one thing you could tell all new Ubuntu users, what would it be?

Share it! Help other users to gain the confidence with free software that they need to try it in ever more demanding environments.

If you enjoyed this interview, please accept our invitation to read the others in the series, both on this blog, and it the series’ previous home.