Linux Blog

Lite Reading : a Review of SQLite by Chris Newman

Filed under: General Linux — TheLinuxBlog.com at 4:45 pm on Monday, June 15, 2009

SQLite This review is sort of a long time coming. The book is simply called SQLite. SQLite (the book) was written by Chris Newman (0-672-32685-X) and is one of the books in the Developer’s Library from InformIT. Books in the Developer’s Library are designed for programmers as high quality references and tutorials on technical subjects. I believe that this is the first book that I have read and personally owned in the series. The book’s “tag-line” so to speak is:
A practical guide to using, administering, and programming the database bundled with PHP 5
and hits it right on the mark. While the book is small it packs a punch. Chris Newman makes it a point to go into detail where needed and skip the parts that are not necessary. One one of my gripes about programming books is that they contain too much programming and logic basics.

The book is split up into three logical parts, Part I consisting of General SQLite Usage, Part II Using SQLite Programming Interfaces and Part III SQLite Administration.

Part I has four chapters the first not being entirely necessary for the SQL guru, but I learned a few things that I would not have known otherwise, and it was a quick read if you skip the basic SQL stuff. The second through forth chapters are on actually working with SQLite such as the structures, syntax / usage and query optimization.

Part II is a chapter for each interface (PHP, C/C++, Perl, Tcl and Python.) Whether you use each of these technologies or not is irrelevant since it is invaluable as a reference if you wished to use your existing databases with these languages. Reading all of these chapters are not needed if you have no intention of using the language right away.

Part III discusses administration and the SQLite Virtual Database Engine. For me just wanting to learn SQLite the section on the VDBE was a little overkill, but interesting none the less. I like that it was included and think it will be useful in the future.

Overall I think SQLite has a good balance for SQL newbies and seasoned gurus just wanting to quickly get up to speed and implement SQLite. It has everything I’ve needed and then some for my tinkering with SQLite.

Reasons Why You Should Jailbreak YOUR iPhone

Filed under: General Linux — TheLinuxBlog.com at 12:10 am on Wednesday, January 28, 2009



I’m pretty sure that most Linux users understand what jailbreaking the iPhone is. For those that don’t in short its a way of breaking the restrictions Apple put on your phone, which allows you to escape the sandbox and do more with the phone.

Sure, jailbreaking may void your warranty (or may not) but why would you want to do it? Well the first and foremost reason is freedom.
Some of the greatest organizations in the open source industry were spawned from the inability to work with a particular device. I think jailbreaking your iPhone is similar to this, while the tools are so easy to use that any one can do it, jailbreaking your iPhone gives you the freedom to do what you want with it and this is what its all about right?

Bash. We all know that Mac OSX is based off of BSD and it just so happens the iPhone is too. By jailbreaking your phone part of the default installation (depending on how you do it) is a terminal with a bash shell. Most Linux users should be right at home here with utilities like apt-get, aptitude and ping.

Perl, Python, Java, PHP. These are some of the languages that you can configure to run on the iPhone. Sure, they may need some tweaking (especially Perl.) But it can be done. Who said iPhone development had to be done in Objective C?

Along with the Bash shell comes the Open SSH package giving you the ability to SSH into your phone, should you choose to install and configure. This can come in very handy for the Linux hacker. The ability to pretty much manipulate your phone however you want is a great reason to jailbreak.

You’ve always wanted to be able to record video right? Well you can, that is if you jailbreak and install an application. While the video quality is not exactly up to par its better than nothing. You could even turn your phone into a robot if you wished.

Also, do it because the Woz says so. Well, actually he didn’t explicitly say to do it, but apparently he does advocate it and “hacked” some chick called Griffin’s phone. So come on, be that “Throbbing brain with a tie” and jailbreak your iPhone.

A few things you may not know about YUM

Filed under: Linux Software — TheLinuxBlog.com at 3:14 pm on Tuesday, July 15, 2008

Yum stands for “YellowDog Updater Modified”

Yum is a standard way to update multiple distributions.

The openSUSE build repository uses the yum updating system

Yum was written in Python.

If you install the yum-utils package you can download yum rpm packages by running:

 yumdownloader --source yum

There are graphical front ends to YUM

Yum is maintained by the Linux@Duke project, thats right the basketball team you love to hate: The Blue Devils.

My Problems with Fedora 9

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 10:29 pm on Tuesday, June 3, 2008

Now, I know that Fedora is a community based operating system that Redhat just so happens to sponsor but I think there are some major problems with the release. Although I have been called “Bleeding Edge” I don’t think that I am quite there and actually I think I’m far from “Cutting Edge.”
I downloaded Fedora 9 on the day of its release to check it out. I started off by installing it onto a virtual machine. First time around the install failed for no reason, some Python error that I did not feel like debugging. I rebooted the VM , gave it another shot and it worked. The install process was pretty much the same as Fedora 8. I saw some minor differences but nothing that I can remember now. Once installed I fired it up and to say the least performance was not very good. I wanted to check out the KDE4, so I switched over. Nothing, the graphics support for the VMWare Toolbox driver is not good enough to really play with KDE4.

After toying with the Virtual Machine I decided to upgrade a test virtual machine from Fedora 8 to Fedora 9. The process to my surprise went smoothly. This was a vanilla Fedora 8 install with not too many bells and whistles. I administer a number of Fedora boxes and thought that I’d upgrade one that actually had software installed. The upgrade did not work, it failed and gave me an obnoxious error which had nothing to do with the task at hand. When I figure out exactly what the cause of the problem was, or if it is just a hardware issue I’ll report my findings here.

Despite feeling like I had not achieved too much I burned a copy of the DVD and installed it on my Desktop at the office. Its not the fastest machine on the planet but its no creeper. 1GB Ram, NVIDIA graphics and I think the upwards of 2GHz. The install went fine and gnome works great. I did not opt to install my window manager of choice (XFCE) since I was really wanting to play with KDE4. KDE4 installed fine and after switching desktops KDE worked. What’s the first thing I tried? You probably guessed it the Desktop effects. So, I try to enable them. No dice. So “I’ll just install the graphics card driver”
I thought since I know that it didn’t come bundled. This is where my troubles really began. The NVIDIA graphics will not compile on Fedora 9. Fedora 9 uses a version of XORG that has been stable for a while but NVIDIA has decided not to support yet. Thats exactly what you get when a vendor has control over source. Oh well.

I put up with the laggy graphics for a little while and tried to customize KDE. KDE4 to me seemed awfully buggy to be included as the only option for running KDE as a desktop. I happen to use KDE when not using XFCE and am quite happy with the 3.5 tree. My next problem apart was with Firefox. They include Firefox Beta 3, which I am undecided on. It crashed a number of times on me whist browsing since I hadn’t set anything up to do any real work on. I know that we would have to wait for Fedora 10 come out to see KDE4 and Firefox 3 if they were not included now but I didn’t see the legacy versions on the installer. For me Fedora 9 is not quite ready to use in a production environment.

For now I’m going to stick to Fedora 8 whilst providing feedback for 9. The moment that KDE, Firefox and XORG get patched I’m 100% there.

Fedora is not for every one but has any one else had any problems with Fedora 9 or interesting stories to share?

Using Bash Scripts in Web Applications

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:22 pm on Sunday, May 25, 2008

Using bash scripts for web applications is not exactly rocket science, nor is it necessarily the best idea in the world but it can be handy to do if you already have a bash script and want to use its functionality on the web. There are a couple of ways to use bash scripts on the web.

The first that I know of is as a CGI. All that you have to do for this one is create a cgi-bin or allow files with the extension .cgi to be executed this is done with apache in your httpd.conf file.

The Second is to use another scripting language to call the script. The easiest way for me is to use PHP. A system call to the script file can my made using the exec() function. Just make sure that the file has execute rights for the user that your web server runs as. Here is an example of using the exec() function in PHP:

$output = exec('/usr/local/bin/yourscript.sh');

The Third method is to use Server Side Includes to include the script. I personally am not familiar with setting up SSI’s but this is how you execute a command from within a SSI:

<!--#exec cmd="/usr/bin/date" -->

Which ever method you choose precautions have to be taken. Make sure that all inputs are sanitized so that a user cannot escape the command, pipe output to another file or manipulate the system in another way. In PHP it is easy to do this, but I can not speak for CGI’s or SSI’s. I hope this shows some insights as to how you can run bash scripts in your web application. If you have any other methods such as using mod_python or maybe tcl, please post them as a comment!

Digsby on Linux

Filed under: Linux Software — TheLinuxBlog.com at 1:41 pm on Monday, March 24, 2008

I was reading this: http://www.shankrila.com/tech-stuff/digsby-is-my-favorite-instant-messenger/ post and I thought I’d check out Digsby. Other then being a really neat idea I thought it would be a great app for me to test out and see if I could use it full time. The Linux / MacOSX version is not ready yet so, I thought I’d just give running it under Wine a shot.

With a bit of struggling I did get it to work. I needed some DLL’s so I borrowed some from my Windows install. Then I needed Python, got that installed with the msiexec. Same error under wine PYTHONDLL failed to load.

Back to the drawing board, I figured I’d give that WineCVS script a shot. I posted an article about it a couple of days ago, you can use it to download Cedega and all other kinds of Wine implementations. I got the latest Wine from CVS, compiled and installed. Same issues as with the stable Wine I run. So, again battled with DLL’s (this time I just copied them over from my other install) and low and behold, it looks like it works:

Digsby on Linux under Wine

Looks pretty good huh?
WRONG!

When I try to sign in with my user name it doesn’t do so well. Here is the output:
Digsby on Linux under Wine Debug
I’m not sure how much I’ll get to mess with this to see if I can get it working before they release the Linux version but I’m going to keep trying. If your interested in more detailed instructions or information on running Digsby under Wine I’ll be happy to provide that information for you.

I’ll keep everyone posted by comments in this blog post. Also, let me know your thoughts on this, and comments!

– Owen

Ubuntu & Gentoo Servers compromised

Filed under: General Linux — TheLinuxBlog.com at 11:00 pm on Wednesday, August 15, 2007

The case of the Ubuntu servers being breached [wiki.ubuntu.com]
Missing security updates and system administrators not running updates on servers is a problem. I don’t know why they didn’t do any updates past Breezy. They suggest that it was because of problems with network cards and later kernels but I don’t get it. Since when do software updates for an operating system have anything to do with what kernel is running? If there is a problem with hardware support for the network card you have two choices. The first is to fix the driver yourself or pay some one to do it. The second is to replace the network card to a better supported device. Both situations could be costly but it would get the problem fixed and five of the servers wouldn’t have been taken down at the same time.
If the kernels were configured correctly, the boxes probably wouldn’t of even had to have been rebooted.
Running FTP instead of a more secure version is not so bad unless they were running accounts with higher privileges than guest or using system accounts. In which case thats just stupid.

The Gentoo Situation [bugs.gentoo.org]
Apparently there is a problem in the packages.gentoo.org script. The bugzilla article goes into deeper explanation but basically there is some pretty unsafe code which could have allowed any one to run any command. I understand that the code is old but it probably should have been audited at some point. The problem would have stuck out like a soar thumb if looked at by a python coder and they probably would have fixed it, or at least suggested a fix. The problem was found on Tuesday the 7th. All of the infra- (I assume they mean infrastructure?) guys were at a conference last week so they couldn’t work on it. It still seems that if they were at the conference until midnight on the 12th they would still have been able to put up a coming back soon placeholder on the packages site by now. Hey, if they put some pay per click ads up there maybe they will get some additional funds during the down time. I would like to see what products would be pushed thru the advertising on that one. I believe that they could have reduced the downtime by releasing the code for the packages.gentoo.org site as open source or by asking for help from developers to review and upgrade the code as needed.

Its not strange for web servers get hacked. They get hacked all the time but who’s fault is it in the open source community? I really think that there is a problem in the community when it comes to situations like this but the blame can’t be placed on any one person. I would offer any assistance I could into getting these situations resolved but its not as easy as that. There has to be a certain level of trust for those working within a project. If they gave out keys to their servers to anyone the servers probably would have been compromised a long time ago. I hope that the affected sites can pull them selfs together and get back up and running as normal. It seems that Ubuntu did not have complete down time, but the Gentoo site is still down and there is no indication of when it will be back up.