Tips and tricks for using ImageMagick on Linux

Friday, November 9, 2007

There's nothing quite like command-line tools for handling large batches of tasks, and image manipulations are no exception. Web developers and administrators will appreciate the ability to handle large numbers of files easily, either at the command line or in scripts. The author presents more examples of the ImageMagick suite, this time demonstrating how to put curved corners, logos, or frames and borders on your images, as well as how to convert to and from multipage file formats including Adobe's PDF format.

How to build your own Linux distribution

Go to the source to learn Linux basics and build the right Linux for you. Linux From Scratch (LFS) and its descendants represent a new way to teach users how the Linux operating systems work. LFS is based on the assumption that compiling a complete operating system piece by piece not only teaches how the operating system works but also allows an independent operator to build systems for speed, footprint, or security.

Apple's "Time Machine" Now For Linux...

Wednesday, November 7, 2007

Apple's Time Machine is a great feature in their OS, and Linux has almost all of the required technology already built in to recreate it. This is a simple GUI to make it easy to use.
"Apple's 'Time Machine' is cool, but I use Linux, not MacOSX. So here is a Linux implementation (built off of rsync, of course). No fancy OpenGL, but quite functional none-the-less."

screenshot:

New Parental Controls Limit Xbox Time

As part of a new marketing blitz to promote the Xbox 360 as a "family friendly" video game console, Microsoft on Wednesday rolled out a new feature called Family Timer, which will show up in the Family Settings Screen.

The Timer will let parents limit the number of hours their kids can play the Xbox on a daily or weekly basis. When the time limit is reached, the console will automatically shut off, ostensibly after saving the game.


Microsoft says that more than 90 percent of parents placed restrictions on gaming, and over half the parents surveyed said they would use a timer if it was available. In conjunction with the new feature, the Redmond company is joining with the National PTA to encourage parents to talk with their kids about "screen time."

"The campaign is designed to educate parents on the tools and resources available that can help them manage their family's media use," explained Robbie Bach, president of Microsoft's Entertainment and Devices Division. "The main program was a 20-city bus tour where we visited with parents and showed them how to use the controls on the Xbox 360 and Windows Vista, and with kids showing them that there are fun games for all ages."

The Family Timer feature is already found in Windows Vista in order to limit the time kids can spend in front of the computer. The previously available parental controls in the Xbox 360 largely revolved around which time of games were allowed to be played based on rating.

My todays favourite pick from digg

CinemaNow and Sonic Try DVD Copying Despite CSS Headaches

Digital entertainment download service CinemaNow has announced a partnership with Sonic Solutions' QFlix, to develop a system which enables burning of protected DVDs that promise to be identical to those available off the shelf, with one very big catch.

CinemaNow holds protection of DVD copyrights high in its list of priorities. It had previously offered a download-and-burn service, though copied discs intentionally included a kind of defect that was supposed to protect against further copies. That defect defeated those copies to the extent that they did not even play on many DVD players.


Changes to the CSS license were recently approved by the DVD Copy Control Association, making it possible for licensed services to legally burn DVDs, a development which follows CinemaNow's business model perfectly. As a result of a court order, CinemaNow's and Sonic Solutions' joint development should not have to carry the copy-defeating mechanism.

But as a result of studios' ability to adjust the definition of "managed copy" when necessary, new language may be added to the CCA license that would create a situation where DVD copying is technically legal, but also highly improbable. The technicality is that managed copies could be made, but only played if an original resides in the player alongside a copy.

Adding insult to the injury of CinemaNow's adoption is that the downloaded material cannot even be burned on any presently available hardware. This means that CinemaNow's partnership with Sonic, barring other circumstances, would still not yield any fruit until ,someone releases an appropriate CSS-enabled burner and DVD-Rs.

Unity game engine updated for Leopard

Tuesday, November 6, 2007

Unity Technologies has announced the release of Unity 3D 2.0.1, an updated version of their 3D game design engine for Mac OS X. The free update for registered 2.0 users is ready for download.

The software runs on Mac OS X but enables developers to deploy across multiple platforms, including Mac OS X, Windows and the Web. It incorporates an integrated editor, asset importing, shadow and light support, optimized graphics for both OpenGL and DirectX, terrain modeling, shaders, scripting support, networking, physics, audio and video support and asset management.

New to the 2.0.1 release is support for Mac OS X v10.5 “Leopard,” along with some necessary documentation updates that “enhance the documentation for both pre-existing and new features introduced with the initial Unity 2.0 release,” according to the developers.

Unity 2.0 is available as a trial version download. It costs $199 for the “Indie” license and $1499 for the “Pro” license, which includes Asset Server. Upgrades from 1.0 start at $99.

Evolution of apple [pic]

A visual created to show the evolution of most all Apple products created over the past 30 years. This was created to show the evolution of the form factor and industrial design of the products, not to show every single model or upgrade Apple has launched.


Click here to view a “really” big image

Ipod saves Soldier's Life


The back of the Ipod.

Critical update***********************
I have talked to Kevin and he has told me the real story of getting shot in the iPod.

The Armor stopped the bullet. Kevin didn't know he was shot. The iPod was how he found out.

The full story:
iPod tells soldier he was shot - the real story

-----------------------------------------------------------------------------
Photos sent to me by my friend Danny with this caption:

My wife’s uncle works in a military hospital and told me about this. Its pretty amazing. Kevin Garrad (3rd Infantry Division) was on a street patrol in Iraq (Tikrit I believe) and as he rounded the corner of a building an armed (AK-47) insurgent came from the other side.

The two of them were within just a few feet of each other when they opened fire. The insurgent was killed and Kevin was hit in the left chest where his IPod was in his jacket pocket. It slowed the bullet down enough that it did not completely penetrate his body armor. Fortunately, Kevin suffered no wound.

I thought it was a great story so I posted them here.

Mozilla's Prism now available for Linux too

The Mozilla Prism project, which seeks to more closely integrate desktop and web applications, made its first release on 24 October, but only for the Windows platform. The Linux community reacted as one would expect. Mozilla has now announced the availability of a Linux version. Mac OS X support has been added as well.

Google rallies allies in open Linux phone initiative

Google and 33 other companies have announced an ambitious industry alliance that will maintain a completely open source mobile phone stack. The Open Handset Alliance (OHA) says phones based on its Linux-based "Android" stack will reach market in as soon as eight months.

The Android stack is based on "open Linux kernel," the group says. It also includes a full set of mobile phone application software, in order to "significantly lower the cost of developing and distributing mobile devices and services," OHA said.

The stack appears to have been created by Android, a mobile phone software house that Google acquired just over two years ago. The Android stack's name is apparently a reflection of co-founder Andy Rubin's fondness for robots. Rubin previously co-founded Danger, a software house that continues to provide software for the Sidekick "hiptop" marketed by T-Mobile.

Few real technical details about the Android stack are available at this point; however, an "early access" version of the Android SDK is being prepped for release on Nov. 12, the OHA said. The stack will be licensed under "one of the most progressive, developer-friendly open-source licenses," according to the fledgling organization.

In taking on not only the Linux kernel and middleware layer, but also the application stack, the OHA appears to have more ambition than earlier industry groups, such as the kernel-oriented LiMo Foundation, and the middleware-oriented LiPS (Linux Phone Standards Forum) and OMA (Open Mobile Alliance) initiatives, among others. In terms of its licensing and scope, the OHA's Android stack may more closely resemble Trolltech's Qtopia Phone Edition and FIC's OpenMoko projects.

The truth about the linux desktop market share

To understand the markets you have to know something about magicians, and how they work.

The magician will typically flourish something or gesture expansively with his right hand, while surreptitiously moving his left hand inside his jacket to remove or hide the next object to be palmed, so the trick with magicians is never look at what they want you to look at, and all of a sudden everything becomes quite clear, it is not magic, it is pop psychology, body language and misdirection.


You have to do the same thing with Linux on the desktop, comparing Open Office to MS Office is like watching the hand that the magician wants you to watch, you'll never get the trick and most importantly you'll never grok that the trick is social engineering, not magic.

I'll cite a case in point.

A few weeks ago a co-worker expressed an interest in buying a computer, going on the internet, etc.

As you do, I politely offered to help out.

I have enough bits lying around to have built him a pretty decent computer, around the 2.5 GHz CPU mark, none of it proprietary components, and I could have installed Linux (prolly Mepis, my personal favourite) or a warezed copy of XP+SP2 if he wanted to play games, maybe even dual boot.

Given current exchange rates I could have done this for about 100 US bucks, maybe 200 if we threw in a new fast hard disk and some new RAM, was he interested? no...

What he was interested in, and what he did, was go to Pissy World, and take out a credit agreement on an in-house branded piece of overpriced junk, which naturally enough came preinstalled with windows and and bunch of other rubbish.

If you think this was about buying a computer, or choosing between Operating Systems, then like the OLPC crowd, you are watching the magicians wrong hand...

This is about MONEY, more specifically debt, which is just another way of saying "power" and "influence" and "control"

The actual money doesn't matter, the money is just a vehicle, and what that vehicle provides is another individual with another lieu to big business, in addition to his rolling mobile phone contract and so on, he now has become entwined into a credit contract for some hardware and software which itself becomes a rolling upgrade contract cycle.

In this scenario where the actual money doesn't matter, all you need to do is ensure that the ticket price is high enough that the preferred method of entry is through the preferred turnstile, eg engaging in said rolling contractual relationships.

0.00 US$ Linux distros don't cut it, there is no "leverage" to be used there against the consumer, free as in beer or free as in speech discussions still don't really address this issue, they are still watching the magicians wrong hand.

For linux to enter the year of the linux desktop that we have all been waiting for, linux will have to be transformed, from free beer / speech into something that can be leveraged into a price point where the customer ostenibly has a choice between paying the ticket price in cash, but is penalised for this and encouraged to enter instead into the rolling contractual relationship.

The "free" computers idea that gets resurrected every now and again is an example of why linux fails, the idea there was that the users eyeballs would pay for and leverage the component cost of the equipment, it never stood a chance, because it was competing against a model where everything else, and I mean EVERYTHING from banks through credit card companies through insurance / warranty deals through hardware and microsoft all played the consumer into "voluntarily" signing up for the rolling contractual relationship business model, in which they become an asset which is tracked and analysed and traded and manipulated.

Linux will make it to the desktop along with the free PC and DN Forever, eg never.

Having said that, Linux adoption will continue, just as people like myself who have no mortgage, no overdraft, no hire purchase, no credit card debt, and no other rolling contract debts, like using linux wherever possible, because it is free not as in beer or speech, but free as in not leveraged against me, there will always be a core of people who feel this way, linux becomes what Karl Marx would have described as a "Political" choice, the workers control the means of production.

Microsoft et al like to stylise Linux and open source as a dangerous virus, we are talking about a subversive communist operating system and software, not a good old american capitalist one (capitalist doesn't mean monetary profit, capitalism means using monetary profit to leverage control, the money is the magicians right hand, control is his left, the one palming the cards) which means free software is dangerous, the enemy, a disease that in itself has no power, but which if it was allowed to eat into market share could sap the power and leverage of the incumbent market choices...

Linux is fairly safe and "benign", only those with market leverage and power can bring it to a point where it seriously impacts the incumbents, and by exercising that leverage you are by definition depleting your leverage and transferring all your power back to the individuals... not going to happen, not while there are capitalists in the same market to feed upon the prey.

Windows is a capitalist OS.

Linux is a anarcho syndicalist OS.

Mac is a communist OS.(chairman jobs' little red book)

PS3 etc is socialist.

10 Advantages of Ubuntu over Vista

Monday, November 5, 2007

I converted from Vista to Ubuntu a little over 2 months ago and am soooooo happy with it, best decision of my life. I am going to tell you my top 10 advantages of it over Windows Vista. Please remember these are my own opinions, if you have more advantages and indeed any disadvantages (if you can find any) then please post them as comments.

1) Eye Candy
If I am completely honest, the biggest reason why I converted was the eye candy. Sure Windows Vista comes with lots of it, but it just isn’t as good. Ubuntu 7.04 comes with just a few of the effects seen a lot nowadays, these effects include the rotating cube desktop and wobbly windows, it just makes it much nicer to use. I have installed Beryl on my computer to give much more eye candy. I base a lot of my judgments on looks first, features later.

2) Easy to Install Applications
Installing new programs in Ubuntu is a doddle, far easier than in Windows, because there is one program that basically gives you access to most applications available to Ubuntu, simply click the program you want and it will install, you don’t need to accept agreements because its all open source so there is no need to click Next 20 times before the program is installed. Simply select the program and click OK, wallah! done.

3) Secure
In Windows Vista, to change a setting requires a ridiculous amount of dialog boxes and passwords, in Ubuntu, you are never logged in as an administrator (root), you are logged in as a simple user, you can change options that are only applicable to your user area but for changing options that affect the system you are required to input the administrator password, one dialog and you’re in, simple and secure. There is also the added bonus that there are very few viruses for Linux, I haven’t ever come across one yet so you can feel safe, imagine not having any virus protection software installed in Windows, there is no need for it in Linux, freedom from the threat of losing all your data.

4) Easy to change options
Ubuntu comes with a control panel but also comes with a menu next to the Applications menu where you simply select the thing you want to change, be it the Desktop background or the network settings. Everything on the windows that appear is simple and there are just the options you need so it is easy to change the options.

5) Community
The community behind Linux, especially Ubuntu is what attracts many people to the operating system. People in the Linux community are mainly ex-Windows users so they know what it feels like to be new to an operating system, so they are happy to help. Whenever I had and have a problem with Ubuntu I simply post on the Ubuntu forum and within minutes there are answers to the problems. I never got put on hold or had to phone up customer service and wait for hours if I had any problems.

6) Free
Everything about Ubuntu is free, the operating system (you can even have them send you a free copy of the operating system, they even pay the postage charges), the software installed is free (including all the software you can download) any help and support is free. The whole experience is 100% free, because it is open source. Open source means that you can distribute and even edit the code behind the program.

7) Simple Networking
The other day I was amazed with how easy it was to connect my Ubuntu laptop to my Windows XP PC. I simply plugged in my laptop to the network hub and it immediately connected with no problems, I didn’t even have to configure it.

Mozilla Firefox
OK, I know that you can use Firefox on Vista as well, but on Ubuntu, there is no Internet Explorer that keeps popping up and cant get rid of. Mozilla Firefox is the number one web browser (remember, my opinions).

9) Fast
Windows Vista is slow and takes up a lot of resources which means you need a pretty decent computer to run it, I know with my 1GHz computer with 512MB of RAM it was too slow to work with. Ubuntu is just fast, it doesn’t slow down in performance when it has been on for a couple of hours, it just keeps on going and everything opens literally a second after you click the icon, and closes when you click the X, with Windows Vista you have to wait for like 30 seconds before a program starts and try shutting down a program like Word 2007 or Visual Studio after using it for a couple of hours, it takes forever.

10) Updates
Ubuntu gets updated every 6 months, well as close as it can do, and whenever I turn my computer on there are updates for the programs installed. Compare that to Windows, how often does that get updated, well the 5 years between Windows XP and Vista sort of answers that question.

So there you go, my top 10 advantages of Ubuntu over Windows Vista. As you can probably see I am very much into Ubuntu so obviously I am going to make Windows Vista look really bad compared to it, but it didn’t take much work to do that, so what does that say? Windows Vista is for some people and good luck to them (or you, if that is you), but Ubuntu offers a worthy alternative for all. Please leave your comments, I would like to hear from you.

Leopard spotted with more problems

Following shortly after installation issues, more problems are arising about Apple’s newly released OS X upgrade. Leopard, which came hailing hundreds of new features apparently has some features Apple failed to disclose. Heise Security, a private UK security firm, has found multiple leaks in the Leopard firewall that may give viruses and other malware direct access to your system.

One major issue is that when upgrading, even users who had the firewall activated on their previous install will find it deactivated once they fire Leopard up. Worse than that is that even once activated, the Leopard firewall has many holes that can allow outside sources to access both system data and user data.

The Apple firewall, similar to newer versions of Windows firewalls, is also capable of ground-level virus scanning. Unfortunately the Leopard firewall failed to detect viruses that infiltrated the system while the firewall was disabled, even after it was reactivated. Basically, users who haven’t noticed their firewall deactivated may potentially already be infected with malware that won’t be caught by Apple’s software, even after you reactivate it.

This isn’t the first time OS X has had serious security flaws. It has always had comparatively sub-par virus protection, and companies that provide additional virus scanning software don’t tend to focus on OS X nearly as heavily as Windows. This could be due to a few things – not the most subtle of which is market share.

Though Apple has made great advancements in the market since OS X was first released and has been gaining popularity even more rapidly since the company partnered with Intel, it still doesn’t have anywhere close to the saturation of Windows. OS X holds around 6.5% of the OS market currently, with all versions of Windows holding over 90% (statistics sourced from here).

Apple fans will always bring up two points to establish OS X’s seniority over Windows: how foolproof it is to install, and how secure it is. In the last few days we’ve seen news contradicting both of these points.

JACK Sync: A Primer For Linux Users


Recently I've been working with the transport synchronization capabilities of the JACK audio server. This article is a report on those capabilities as tested with a variety of Linux audio applications under the JAD and 64 Studio distributions.


JACK: The 1-minute Profile


By now everyone in the Linux music and sound world has heard about Paul Davis's JACK audio server and transport control system. By way of introducing this article and for the benefit of the remaining few people who don't yet know about it I'll briefly review JACK's more salient characteristics.


JACK's name is a recursive acronym for "JACK audio connection kit". The kit provides a system for freely connecting independent audio data I/O points, thus allowing the audio output from one JACK-savvy application to be sent to the audio input of any other JACK-aware client. The system supports multiple connections to and from any audio I/O points, and all data streams are synchronized to sample-accuracy.


As a sound server, JACK operates between the low-level sound system drivers and any JACK-aware client applications, managing the flow of multiple freely interconnected audio data streams. The system has been designed for professional use, and it has become an expected feature in Linux audio software. JACK has been extended recently to handle MIDI data streams in sample-sync with its audio I/O, an especially exciting development for those of us who await a MIDI-capable Ardour.


JACK was also designed from the start with a transport control system that would synchronize the operation of any subscribed clients, and that system is the focus of this article.


Synchronization: A Little Background


In the sound and music software world, synchronization typically refers to the precise timing of audio events with video, MIDI, and other event streams. Accurate synchronization of audio and video events is a critical part of movie production. Sounds must occur at the precise times of their associated visual cues, and our aural acuity will notice very quickly when sound and image don't correspond. What seems to be a simple problem turns out to be a complicated procedure, thanks to the different timebases used for audio and video, hence the need for some means of synchronizing disparate event streams.


In Ye Olden Tymes film composers calculated event correspondences with stopwatch and pencil. They let machines do the math now, but there is still a need to understand synchronization arcana such as the variety of SMPTE frame rates and how to successfully utilize MTC.


The advent of the MIDI sequencer ushered in an new crop of synchronization problems and solutions. First, sequencers and drum machines needed to be synchronized with each other (or with other sequencers and drum machines), hence the development of various MIDI synchronization protocols such as frequency shifted keying (FSK), song position pointer (SPP), and "smart" FSK sync. Next, the MIDI studio wanted to integrate with the tape studio. Since most tape recording studios already used SMPTE timecode as a synchronization solution it seemed only natural that the MIDI studio should adopt SMPTE as well. The original MIDI specification made no provision for carrying SMPTE timecode signals over a MIDI cable, so the spec was eventually extended to define an encoding of SMPTE into what is now known as MIDI Time Code (MTC).


The marriage of the MIDI sequencer and the hard-disk recorder brought in another synchronization headache. Computer-based recordists quickly discovered that the timing of audio tracks and MIDI tracks tended to drift apart after a few seconds of simultaneous play. This problem prompted the development of solutions for synchronizing audio and MIDI tracks within the same application, paving the way for the development of the modern audio/MIDI sequencer.


The JACK Transport Control System


The ability to manage multiplexed audio I/O is impressive, but it isn't worth much during recording or playback if the various tracks, channels, and streams don't stay in time with one another. To make that happen, JACK supplies a transport control subsystem. The system provides sample-accurate synchronization of streaming audio I/O, and any client that supports the JACK transport control can operate or be operated by any other similarly aware client. In a typical scenario where two or more applications agree to use the JACK transport control, any client can behave as the control master, thus eliminating the need to designate a master client. The transport timebase (i.e. the musical tempo) is set and maintained by only one of the clients, but it remains in effect regardless which application acts as the master control.


This transport control system is an integral component of JACK, and it is completely transparent at the user level. No extra software is required: When you load the jackd daemon you've loaded the transport control system as well. The client application's transport UI is used as it would be without JACK, and the user has no contact with the system's underlying details.


Space limits forbid an in-depth discussion of those details here, but interested readers can find full technical documentation of the system on the JACK Web site at jackaudio.org. Developers of audio and MIDI software for Linux and OSX are especially welcome and are encouraged to integrate JACK support into their own software.


JACK Sync In The Studio


Synchronizing with JACK is usually a straightforward process. My first example is typical: I started QJackCtl, Rui Nuno Capela's excellent GUI for controlling JACK, then I started the latest MusE sequencer (version 0.9) with no special options. MusE recognized JACK instantly, and I could control the start/stop and rewind/fast-forward functions at any time from either QJackCtl or MusE.



Figure 1: JACK sync with QJackCtl and MusE


Next I tried synchronizing Ardour and the seq24 MIDI sequencer. Seq24 works in two edit modes, a pattern composer and a performance arrangement editor (seq24's Song Editor), and it is designed to operate in only one of those modes at any time.



Figure 2: Configuring seq24 for JACK sync


Seq24's Files/Options dialog includes the JACK Sync tab seen in Figure 2. Unlike MusE, seq24 has a variety of options to condition its behavior with JACK. Each option works as reported by the tooltips help: JACK Transport enables seq24's status as a peer client, Transport Master attempts to set seq24 as the master controller, and Master Conditional will set seq24 to master status only if there is no other master defined elsewhere. The Live and and Song mode buttons determine which mode JACK will control (it can only do one at a time), and the Connect/Disconnect bars should be self-explanatory.



Figure 3: Ardour syncs with seq24


This example also illustrates how JACK handles different transport capabilities. By design, seq24 has no manual rewind controls, it automatically rewinds the pattern or song back to its beginning (or to the start of a designated loop in the Song Editor). The start/stop controls work perfectly, as does the autorewind, yet it also behaves as expected when controlled by the rewind buttons in Ardour or QJackCtl. Figure 3 shows off this synchronized network in action, with QJackCtl acting as the master transport control while Ardour records the audio output from QSynth (as played by the JACK-sync'd seq24). Yes, it's cool and a lot of fun.


My next experiment put Ardour in sync with a video display utility named xjadeo. Xjadeo was designed as a video monitor "assistant" specifically for the synchronization of audio samples with video frames. It is definitely not intended for general-purpose video file playback.



Figure 4: Video sync with Ardour and xjadeo


As previously, I set Ardour's sync status to JACK and Time Master, then I started xjadeo with this command line :



xjadeo -i 3 foo.avi


Xjadeo's bare appearance (Figure 4) conceals a powerful helper application. Its feature set includes various controls for frame rate and timecode display (the -i switch), color equalization controls, and the capability to sync via MTC (MIDI Time Code) instead of JACK. Again, space forbids a complete presentation of xjadeo and its features, but considering its price (free) and availability (free) you could just check it out for yourself.


The experiment was once again anticlimactic. Everything worked as advertised, I could control xjadeo's transport from either Ardour or QJackCtl to sync the audio and video streams, and I was a happy fellow. Even in my simple test it was easy to see how the program could be put to serious use.


For my last test I connected the audio output from the Hydrogen drum machine into an audio recording track in the Rosegarden sequencer. As usual, QJackCtl was also employed.


Setting Hydrogen for JACK sync is easy enough. Make sure the audio driver of choice is JACK (in the Tools/Preferences dialog), then click the JACK Trans button in Hydrogen's track display (see Figure 5). That's it, Hydrogen will now behave as the transport master or slave.



Figure 5: Rosegarden records Hydrogen


Setting up Rosegarden requires more navigation, but the process is equally straightforward. Go to the Settings/Configure Rosegarden panel, click on the Sequencer Settings icon, then select the Synchronization tab. Set the JACK transport mode to Sync, apply the changes, then click OK (Figure 6). Now Rosegarden shares JACK transport peer status with Hydrogen and QJackCtl.



Figure 6: Configuring Rosegarden for JACK sync


And yet once more it all worked as advertised. One extra step was added: I had to manually connect the stereo outputs from Hydrogen to the inputs for the Rosegarden track, a trivial task quickly completed in QJackCtl's audio connections panel. I also had to start from Rosegarden if I wanted to record the drum track. Alas, the sequencer's Record status is not available to the transport control.


JACK vs. ReWire


JACK is sometimes referred to as the Linux equivalent of ReWire, an audio/MIDI connection and transport protocol for Windows and Macintosh sound and music software. I have no Windows system here at Studio Dave, but a comparison of features revealed that JACK and ReWire indeed share some common design concerns. Both provide audio routing with flexible I/O and a master transport control system, and both are freely available. However, ReWire is available free of charge only to developers of proprietary software. JACK is GPL'd open-source free software, available at no charge to anyone, anywhere, anytime.


JACKing Out


At the start of this article I referred to "Paul Davis's JACK". Paul is indeed the chief architect and head honcho in charge of JACK, but his software has become the work of many hands. Its thriving development community ensures JACK's maintenance and further evolution: MIDI support is already available in versions >= 0.103.00, JACK for OSX exists now, and a rumored Windows port may yet see the light of day. Speaking personally, I'd like to see more applications incorporate the JACK transport control. For example, the LiVES video editor supports the JACK audio server, but it would be very cool if it also supported the transport control. Video editors are a natural choice, but other audio applications such as trackers and soundfile editors might make good candidates for JACK sync.




10 Linux commands you’ve never used

It takes years maybe decades to master the commands available to you at the Linux shell prompt. Here are 10 that
you will have never heard of or used. They are in no particular order. My favorite is mkfifo.
1.

pgrep, instead of:

# ps -ef | egrep '^root ' | awk '{print $2}'
1
2
3
4
5
20
21
38
39
...
You can do this:
# pgrep -u root
1
2
3
4
5
20
21
38
39
...


2. pstree, list the processes in a tree format. This can be VERY useful when working with WebSphere or other heavy duty applications.

# pstree
init-+-acpid
|-atd
|-crond
|-cups-config-dae
|-cupsd
|-dbus-daemon-1
|-dhclient
|-events/0-+-aio/0
| |-kacpid
| |-kauditd
| |-kblockd/0
| |-khelper
| |-kmirrord
| `-2*[pdflush]
|-gpm
|-hald
|-khubd
|-2*[kjournald]
|-klogd
|-kseriod
|-ksoftirqd/0
|-kswapd0
|-login---bash
|-5*[mingetty]
|-portmap
|-rpc.idmapd
|-rpc.statd
|-2*[sendmail]
|-smartd
|-sshd---sshd---bash---pstree
|-syslogd
|-udevd
|-vsftpd
|-xfs
`-xinetd


3. bc is an arbitrary precision calculator language. Which is great. I found it useful in that it can perform square root operations in shell scripts. expr does not support square roots.

# ./sqrt
Usage: sqrt number
# ./sqrt 64
8
# ./sqrt 132112
363
# ./sqrt 1321121321
36347
Here is the script:
# cat sqrt
#!/bin/bash
if [ $# -ne 1 ]
then
echo 'Usage: sqrt number'
exit 1
else
echo -e "sqrt($1)\nquit\n" | bc -q -i
fi


4. split, have a large file that you need to split into smaller chucks? A mysqldump maybe? split is your command. Below I split a 250MB file into 2 megabyte chunks all starting with the prefix LF_.

# ls -lh largefile
-rw-r--r-- 1 root root 251M Feb 19 10:27 largefile
# split -b 2m largefile LF_
# ls -lh LF_* | head -n 5
-rw-r--r-- 1 root root 2.0M Feb 19 10:29 LF_aa
-rw-r--r-- 1 root root 2.0M Feb 19 10:29 LF_ab
-rw-r--r-- 1 root root 2.0M Feb 19 10:29 LF_ac
-rw-r--r-- 1 root root 2.0M Feb 19 10:29 LF_ad
-rw-r--r-- 1 root root 2.0M Feb 19 10:29 LF_ae
# ls -lh LF_* | wc -l
126


5. nl numbers lines. I had a script doing this for me for years until I found out about nl.

# head wireless.h
/*
* This file define a set of standard wireless extensions
*
* Version : 20 17.2.06
*
* Authors : Jean Tourrilhes - HPL
* Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved.
*/#ifndef _LINUX_WIRELESS_H
# nl wireless.h | head
1 /*
2 * This file define a set of standard wireless extensions
3 *
4 * Version : 20 17.2.06
5 *
6 * Authors : Jean Tourrilhes - HPL
7 * Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved.
8 */9 #ifndef _LINUX_WIRELESS_H

6. mkfifo is the coolest one. Sure you know how to create a pipeline piping the output of grep to less or maybe even perl. But do you know how to make two commands communicate through a named pipe?First let me create the pipe and start writing to it:

Then read from it:




7. ldd, want to know which Linux thread library java is linked to?

# ldd /usr/java/jre1.5.0_11/bin/java
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00bd4000)
libdl.so.2 => /lib/libdl.so.2 (0x00b87000)
libc.so.6 => /lib/tls/libc.so.6 (0x00a5a000)
/lib/ld-linux.so.2 (0x00a3c000)


8. col, want to save man pages as plain text?

# PAGER=cat
# man less | col -b > less.txt


9. xmlwf, need to know if a XML document is well formed? (A configuration file maybe..)

# curl -s 'http://bashcurescancer.com' > bcc.html
# xmlwf bcc.html
# perl -i -pe 's@
@
@g' bcc.html
# xmlwf bcc.html
bcc.html:104:2: mismatched tag


10. lsof lists open files. You can do all kinds of cool things with this. Like find which ports are open:

# lsof | grep TCP
portmap 2587 rpc 4u IPv4 5544 TCP *:sunrpc (LISTEN)
rpc.statd 2606 root 6u IPv4 5585 TCP *:668 (LISTEN)
sshd 2788 root 3u IPv6 5991 TCP *:ssh (LISTEN)
sendmail 2843 root 4u IPv4 6160 TCP badhd:smtp (LISTEN)
vsftpd 9337 root 3u IPv4 34949 TCP *:ftp (LISTEN)
cupsd 16459 root 0u IPv4 41061 TCP badhd:ipp (LISTEN)
sshd 16892 root 3u IPv6 61003 TCP badhd.mshome.net:ssh->kontiki.mshome.net:4661 (ESTABLISHED)
Note: OpenBSD 101 pointed out that “lsof -i TCP” a better way to obtain this same information. Thanks!Or find the number of open files a user has. Very important for running big applications like Oracle, DB2, or WebSphere:


# lsof | grep ' root ' | awk '{print $NF}' | sort | uniq | wc -l
179


Note: an anonymous commenter pointed out that you can replace sort | uniq with “sort -u”. This is true, I forgot about the -u flag. Thanks!

htop: new generation Linux processes viewer

Saturday, November 3, 2007

As it comes from htop’s manual page, htop is free (GPL) ncurses-based process viewer, that is similar to top, but allows to scroll the list vertically and horizontally to see all processes and their full command lines. Tasks related to processes (killing, renicing) can be done without entering their PIDs.



I found this utility very useful and powerful in my everyday working process. Here is the comparison between htop and oldie top (taken from htop’s site):

1.In 'htop' you can scroll the list vertically and horizontally to see all processes and complete command lines.

2.In 'top' you are subject to a delay for each unassigned key you press (especially annoying when multi-key escape sequences are triggered by accident).

3.'htop' starts faster ('top' seems to collect data for a while before displaying anything).

4.In 'htop' you don't need to type the process number to kill a process, in 'top' you do.

5.In 'htop' you don't need to type the process number or the priority value to renice a process, in 'top' you do.

6.'htop' supports mouse operation, 'top' doesn't

7.'top' is older, hence, more used and tested.

As usual it’s possible to install htop in Ubuntu by single command: sudo aptitude install htop.

Interactive Linux kernel map

As it comes from name of the post, here is interactive Linux kernel map I recently came across. It’s available as web application as well as html version. I think you understand who it may be useful for… Good luck in programming...


full pic here

Linux distro timeline 1992-2007

It was started with Linus' announcement:

Hello everybody out there using minix - I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things). I've currently ported bash (1.08) and gcc (1.40), and things seem to work. This implies that I'll get something practical within a few months, and I'd like to know what features most people would want. Any suggestions are welcome, but I won't promise I'll implement them Linus (PS. Yes - it’s free of any minix code, and it has a multi-threaded fs. It is NOT portable (uses 386 task switching etc.), and it probably never will support anything other than AT-harddisks, as that’s all I have :-(.”

And today it’s timeline is shown at 2003x2841 image…Click on the image for a larger version..






Click here for larger version

Google phone (GPhone) rumors

Friday, November 2, 2007

LinuxDevices.org:

"Google’s first mobile phone will run a Linux operating system on a Texas Instruments "Edge" chipset, and will likely ship to T-Mobile and Orange customers in the Spring of 2008, according to unconfirmed reports. "GPhone" call minutes and text messages reportedly will be funded by mobile advertising…

News of the so-called "GPhone" or "G-Phone" broke quietly about two weeks ago in the island nation of Singapore, where Jennifer Tan of Reuters subsidiary Anian Research filed a report on July 12.

Tan cited "industry sources," "U.S. sources," and "manufacturing and component supply chain sources" in backing her assertion that after year-long delays finding a manufacturer, Google contracted Taiwan-based smartphone maker High Tech Computer (HTC) to design its phone hardware. HTC is best-known for its Windows Mobile smartphones, however, and Tan offered no conjecture about who might supply the phone’s Linux-based operating system.

Additional details reported by Tan include:

* The G-Phone will have a large color screen with a predictive Qwerty keypad to simplify Google searching
* A follow-up 3G-capable model (Edge is considered "2.75G") will use a Qualcomm chipset
* Scheduled for production in Q1 of 2006, the Google phone will hit retail shelves next spring
* Call minutes and text messages are to be funded by "mobile advertising"
* Google originally hoped to launch a phone this year, but was delayed by "difficulties in nailing down a deal with a handset maker"
* T-Mobile will carrier the phone in the U.S., along with (possibly) Orange in other markets

Tan quotes Susquehanna Financial Group analyst Marianne Wolk as having said, "A mobile offering would be consistent with Google’s goal to make search accessible. We believe Google would design a solution to facilitate greater use of Google Search and other applications like Google Talk, Gmail, Google Maps, encourage wireless video, and leverage this usage to hasten the market for mobile advertising."

Google itself has declined to comment on rumors it plans to produce a phone, Tan reported."

What is a Linux guy doing at Sun?

As part of Sun Microsystems' first CommunityOne, Ian Murdock, Sun’s chief operating system platform strategist and a self-described "Linux guy", hosted a noteworthy session that explored a curious question: How can we make Solaris a better Linux than Linux? Murdock has a storied history in relation to Linux. A Linux user, developer, and advocate since 1993, he founded Debian in 1993, with the goal of creating a complete operating system around the Linux kernel and expanding Linux to a broader audience. In 1999, he co-founded Progeny, a Linux distribution vendor that focused on customization for appliance environments. He was CTO of the Linux Foundation (formerly known as the Free Standards Group) from 2005-2007, and has been chair of the Linux Standards Base from 2005 to the present.




read more

Linux Halloween! [pic]

our friendly neighbourhood pengiun strikes again!



digg it

Engineering Students Build Next-Generation Bathyscaphe

Thursday, November 1, 2007

Computer, electrical, and mechanical engineering students at the University of Florida have built a fully automated underwater vehicle. Driven by five thrusters and controlled by complex electronics, the bathyscaphe can locate the source of sounds, investigate leaking pipes, and perform other civilian and military tasks that would be too dangerous for manned submergibles, especially during an emergency such as a hurricane .
A Russian submarine is trapped at the bottom of the sea, hurricanes crumble weak levees, and pipes leak. Most of these situations are too dangerous to send in a diver to investigate, but robots are becoming a reality. The military is using them on a daily basis, and now, the newest wave of robots may be diving into the ocean.

"You don't want to put somebody in the water. That's some of the worst, harshest environments. You can instead have a robot do it," says Eric Schwartz, an electrical and computer engineer at the University of Florida in Gainesville.

University of Florida computer, electrical and mechanical engineering students built the future of robotic underwater vehicles, called the SubjuGator. It's a submarine that's completely autonomous, working without any human involvement, and is controlled by 10 microprocessors and one computer. The key components are five thrusters and a highly involved electronics unit.

UF students tested it in a pool and trained it to locate underwater sounds, as well as breaks in pipelines or walls.

"We can go every other way. We can go forward. We can turn this way and that way. We can rotate about this axis..." Schwartz says. "It's programmed. It's basically trained you're trained. We say this is what a pipe looks like. This is what a pipe doesn't look like. This is what a box looks like."

From there, the SubjuGator can track down what it's looking for. And one day a sub like this could help to rescue trapped sailors, repair levees, and find oil leaks before any damage is done.

The applications for a sub like the subjugator are endless. According to Schwartz, they could help tap into oil in the ocean and even run undercover missions for the Navy.

MySpace and Google Join Forces to Launch Open Platform for Social Application Development

MySpace, the world's largest social network, and Google, Inc. (NASDAQ: GOOG) today announced that they are joining forces to launch OpenSocial— a set of common APIs for building social applications across the web. The partnership spearheads an initiative to standardize and simplify the development of social applications. Today's announcement underscores MySpace's commitment to supporting standards that foster innovation in an increasingly social Web.



Demo of a MySpace webpage using OpenSocial, a programming model developed at Google


"Our partnership with Google allows developers to gain massive distribution without unnecessary specialized development for every platform," said Chris DeWolfe, Chief Executive Officer and co-founder of MySpace. "This is about helping the start-up spend more time building a great product rather than rebuilding it for every social network. We're pleased to collaborate with Google to establish a landmark standard for social applications."

As a founding member of OpenSocial, MySpace will provide critical user mass and platform guidance. The OpenSocial standards are designed to evolve through contribution from the open source community and as new features are developed by various partners. Global members of the OpenSocial community include Engage.com, Friendster, hi5, Hyves, imeem, LinkedIn, Ning, Oracle, orkut, Plaxo, Salesforce.com, Six Apart, Tianji, Viadeo, and XING.

"As the most trafficked website in the country and the most popular social network in the world, MySpace is one of the leading forces in the global social Web," said Dr. Eric Schmidt, Chairman of the Executive Committee and Chief Executive Officer of Google. "We're thrilled to grow our strategic relationship with MySpace by joining forces on this important initiative."

"As an application developer, we're excited to see MySpace adopting the OpenSocial standard for social application development," said Joe Greenstein, CEO of Flixster. "Application developers have been working with MySpace for a long time—this takes what we can do together to a whole new level. The sheer scale of MySpace makes this extremely exciting for us."

"We're all citizens of a larger Web—no network is an island onto itself," said Aber Whitcomb, CTO of MySpace. "We look forward to continuing to develop great technology with Google and all of the OpenSocial participants. It's exciting that social networks are getting social with each other."

The launch of OpenSocial is the first release of technical details for the forthcoming MySpace Platform. Starting tonight, developers can start writing applications for OpenSocial at http://code.google.com/apis/opensocial which the MySpace Platform will support at launch.

New Software Helps Track the Path of Toxic Spills

Ecological engineers have developed software that can model the path of a toxic spill in waterways anywhere in the United States. The system can predict if and when a contaminant will reach a drinking water intake, and whether its concentration will be high enough to be a threat. The data base covers more than 300 potential water contaminants, and can be used to alert first responders of potential risks.
If our drinking water supply is contaminated, accidentally or intentionally, a spill response team goes to work, getting the situation under control as quickly as possible. Now new computer software is helping make the response even quicker -- all across the country.

"The first thing we want to do is find out how big of a threat it is," Doug Stolz, of Olympia, Washington's, Hazardous Materials Spill Response Team, tells DBIS. "We want to assess the threat, determine what the material is, and what its characteristics are."

Testing the water helps answer those questions. New software will help even more. Ecological engineer Douglas Ryan helped develop the Incident Command (IC) Water Tool. It shows a contaminant moving through water in real time.

"It puts the information that the incident commanders and the first responders need in their hands quickly enough that they can take action to protect the public at times when time is really critical," Ryan, of the USDA Forest Service, tells DBIS.

The IC Water Tool answers these four questions: Where's the contaminant going? Is there a drinking water intake along the path? If there is, when will the contaminant reach it? And will the contaminant's level be high enough to be a threat to people?

Ryan says, "Right now, that sort of information is scattered in many different places. And to pull it together quickly to be of use to incident commanders takes time and they often don't have that time."

The IC Water Tool can get the information to first responders anywhere in the country making our drinking water safer, quicker. The database covers more than 300 types of potential water contaminants. The software has maps of anywhere a contaminant can enter the water system and each location of where drinking water comes from nationwide. The Department of Defense is distributing the tool.

New Computer Architecture Aids Emergency Response

Princeton researchers have invented a computer architecture that enables the secure transmission of crucial rescue information to first responders during events such as natural disasters, fires or terrorist attacks.
Electrical engineering professor Ruby Lee said the new architecture allows for what she describes as "transient trust" -- the ability to transmit sensitive information to parties on an as-needed basis so that it cannot be intercepted by others and so that access stops as soon as the recipient no longer has a legitimate need for it.

Data provided on a transient-trust basis might include floor plans of a building, medical information about occupants, or satellite maps of a given area.

The new SP (Secret Protection) computer architecture relies on two new elements that are embedded in the hardware of an electronic device: a "device root key" and a "storage root hash."

A trusted authority such as a municipal Fire Department would initialize a device -- for example, a PDA used by a firefighter -- with these features so that during an emergency a firefighter could be given access to relevant floor plans, security codes or other essential information. Once the emergency was over, the access to this sensitive information would end.

This new research emerged from the Princeton Architecture Lab for Multimedia and Security (PALMS) led by Lee, the Forrest G. Hamrick Professor of Engineering. The lab's major focus is "clean-slate" computer architecture design. As chief computer architect at Hewlett-Packard, Lee was a key figure in a revolution in computer architecture that swept through the industry in the 1980s. Since coming to Princeton, Lee has been working to revolutionize computer architecture again.

"Computers were not originally designed with security as a goal," said Lee. "I'm trying to rethink the design of computers so they can be trustworthy while at the same time retain all their original design goals, such as high performance, low cost and energy efficiency."

Lee aims to build fundamental security features directly into the hardware of a device, whether it is a personal computer, cell phone or PDA. Her researchers are working to build "trust anchors" into computer hardware to which different software can be tethered, to provide important security coverage.

Lee said that many researchers do not think it is possible to build security features into computer hardware without slowing the computer down or causing it to consume lots of power. However, research done by her lab demonstrates that this is not the case.

"Our research shows that these hardware 'roots of trust' are actually quite deployable on consumer devices like desktop computers or PDAs, and also in sensor networks and larger servers," said Lee. The work is part of the SecureCore multi-university research project, funded by the NSF Cybertrust program and DARPA, which aims to integrate essential security into the hardware, software and networking at the core of commodity computing and communications devices.

In addition to trust anchors for software, Lee is also researching hardware "safety nets" to defend against software vulnerabilities that remote attackers exploit to gain entry into a computer. The ultimate goal is to inoculate individual computers and electronic devices such as cell phones against threats like viruses, worms and bots so that they cannot infect, or be used to attack, other machines.

A paper describing the new architecture by Lee and her graduate student Jeffrey Dwoskin will be presented Wed., Oct. 31, at the ACM Computer and Communications Security conference in Alexandria, Va.
Lee's students study all aspects of building more secure microprocessors and hardware. In June, at the IEEE Symposium on Computer Arithmetic, Lee and Yedidya Hilewitz, a graduate student at Princeton, published a paper which proposes a revolutionary design of a fundamental functional unit of microprocessors that greatly expands a computer's ability to perform "advanced bit manipulation operations," which are very useful for fast cryptography and cryptanalysis, as well as for many other applications.

Lee is also studying computer architecture that prevents leakage of information through covert channels and side channels. At the International Symposium on Computer Architecture in June, Zhenghong Wang, one of Lee's graduate students, presented a paper describing a hardware approach to preventing so-called "software side-channel attacks" during which attackers exploit the cache memories that are shared between computer programs to leak secret cryptographic keys .

In September, at the Cryptographic Hardware and Embedded Systems conference, Lee's researchers, Reouven Elbaz and David Champagne, presented a hardware memory integrity solution to rebuff memory replay attacks, where attackers try to trick a computer into accepting material as still legitimate even though it has already been officially deleted.

Open-Source 3D Printer Lets Users Make Anything

Picture a 3D inkjet printer that deposits droplets of plastic, layer by layer, gradually building up an object of any shape. Fabbers have been around for two decades, but they've always been the pricey playthings of high-tech labs — and could only use a single material. A Fab at Home kit costs around $2400 and allows users to print anything from Hors d'Oeuvres to flashlights."

Software 'Chipper' Speeds Debugging

Computer scientists at UC Davis have developed a technique to speed up program debugging by automatically "chipping" the software into smaller pieces so that bugs can be isolated more easily.
Computer programs consist of thousands, tens or even hundreds of thousands of lines of code. To isolate a bug in the code, programmers often break it into smaller pieces until they can pin down the error in a smaller stretch that is easier to manage. UC Davis graduate student Chad Sterling and Ron Olsson, professor of computer science, set out to automate that process.

"It's really tedious to go through thousands of lines of code," Olsson said.

The "Chipper" tools developed by Sterling and Olsson chip off pieces of software while preserving the program structure.

"The pieces have to work after they are cut down," Olsson said. "You can't just cut in mid-sentence."

In a recent paper in the journal "Software -- Practice and Experience," Olsson and Sterling describe ChipperJ, a version developed for the Java programming language. ChipperJ was able to reduce large programs to 20 to 35 percent of their former size in under an hour.

How to Turn your Mac into a Haunted Computer

How would you like to have someone walk by a Mac that no one is touching… and have it scare the beejeebuz out of them? It’s quite an easy thing to turn your Mac into a seemingly haunted machine, and I’m going to show you how. Thanks to Wirelesspacket for this tip.

You need to have at least one Mac in the house, of course, in order to do this. First you’ll need to prepare the Mac to talk by going into the System Preferences and make your way into Sharing Preferences. This is normally used for screen and file sharing. However, today we’re going to go there to enable SSH functionality and turn on Remote Login.

I can now connect to this Mac from any other machine on my network, be it another Mac, a Windows computer or even a Linux box. I’m going to need to open a Terminal Window (Command Prompt in Windows). There, I just type the command say followed by a space, and then whatever text I want the Mac to say out loud. Think about it. Someone could be working on their machine, and suddenly it could say to them “Fatal Error! Please Restart! Contact your System Administrator!”.

Want to embed this video on your own site, blog, or forum? Use this code or download the video:

Learn UNIX in 10 minutes(V-1.3)

 
Preface

This is something that I had given out to students (CAD user training) in years past.
The purpose was to have on one page the basics commands for getting started using
the UNIX shell (so that they didn't call me asking what to do the first time someone
gave them a tape).

This document is copyrighted but freely redistributable under the terms of the GFDL .

Send me patches, comments, corrections, about whatever you think is wrong or should be
included. I am always happy to hear from you. Please include the word "UNIX" in your subject.

Sections:


Directories:
Moving around the file system:
Listing directory contents:
Changing file permissions and attributes
Moving, renaming, and copying files:
Viewing and editing files:
Shells
Environment variables
Interactive History
Filename Completion
Bash is the way cool shell.
Redirection:
Pipes:
Command Substitution
Searching for strings in files: The grep command
Searching for files : The find command
Reading and writing tapes, backups, and archives: The tar command
File compression: compress, gzip, and bzip2
Looking for help: The man and apropos commands
Basics of the vi editor
FAQs

******************************************************************************************
Basic UNIX Command Line (shell) navigation : Last revised May 17 2001
******************************************************************************************


Directories:


File and directory paths in UNIX use the forward slash "/"
to separate directory names in a path.

examples:

/ "root" directory
/usr directory usr (sub-directory of / "root" directory)
/usr/STRIM100 STRIM100 is a subdirectory of /usr

Moving around the file system:


pwd Show the "present working directory", or current directory.
cd Change current directory to your HOME directory.
cd /usr/STRIM100 Change current directory to /usr/STRIM100.
cd INIT Change current directory to INIT which is a sub-directory of the current
directory.
cd .. Change current directory to the parent directory of the current directory.
cd $STRMWORK Change current directory to the directory defined by the environment
variable 'STRMWORK'.
cd ~bob Change the current directory to the user bob's home directory (if you have permission).


Listing directory contents:


ls list a directory
ls -l list a directory in long ( detailed ) format

for example:
$ ls -l
drwxr-xr-x 4 cliff user 1024 Jun 18 09:40 WAITRON_EARNINGS
-rw-r--r-- 1 cliff user 767392 Jun 6 14:28 scanlib.tar.gz
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
| | | | | | | | | | |
| | | | | owner group size date time name
| | | | number of links to file or directory contents
| | | permissions for world
| | permissions for members of group
| permissions for owner of file: r = read, w = write, x = execute -=no permission
type of file: - = normal file, d=directory, l = symbolic link, and others...

ls -a List the current directory including hidden files. Hidden files start
with "."
ls -ld * List all the file and directory names in the current directory using
long format. Without the "d" option, ls would list the contents
of any sub-directory of the current. With the "d" option, ls
just lists them like regular files.


Changing file permissions and attributes


chmod 755 file Changes the permissions of file to be rwx for the owner, and rx for
the group and the world. (7 = rwx = 111 binary. 5 = r-x = 101 binary)
chgrp user file Makes file belong to the group user.
chown cliff file Makes cliff the owner of file.
chown -R cliff dir Makes cliff the owner of dir and everything in its directory tree.

You must be the owner of the file/directory or be root before you can do any of these things.

Moving, renaming, and copying files:


cp file1 file2 copy a file
mv file1 newname move or rename a file
mv file1 ~/AAA/ move file1 into sub-directory AAA in your home directory.
rm file1 [file2 ...] remove or delete a file
rm -r dir1 [dir2...] recursivly remove a directory and its contents BE CAREFUL!
mkdir dir1 [dir2...] create directories
mkdir -p dirpath create the directory dirpath, including all implied directories in the path.
rmdir dir1 [dir2...] remove an empty directory


Viewing and editing files:


cat filename Dump a file to the screen in ascii.
more filename Progressively dump a file to the screen: ENTER = one line down
SPACEBAR = page down q=quit
less filename Like more, but you can use Page-Up too. Not on all systems.
vi filename Edit a file using the vi editor. All UNIX systems will have vi in some form.
emacs filename Edit a file using the emacs editor. Not all systems will have emacs.
head filename Show the first few lines of a file.
head -n filename Show the first n lines of a file.
tail filename Show the last few lines of a file.
tail -n filename Show the last n lines of a file.


Shells


The behavior of the command line interface will differ slightly depending
on the shell program that is being used.

Depending on the shell used, some extra behaviors can be quite nifty.

You can find out what shell you are using by the command:

echo $SHELL

Of course you can create a file with a list of shell commands and execute it like
a program to perform a task. This is called a shell script. This is in fact the
primary purpose of most shells, not the interactive command line behavior.


Environment variables


You can teach your shell to remember things for later using environment variables.
For example under the bash shell:

export CASROOT=/usr/local/CAS3.0 Defines the variable CASROOT with the value
/usr/local/CAS3.0.
export LD_LIBRARY_PATH=$CASROOT/Linux/lib Defines the variable LD_LIBRARY_PATH with
the value of CASROOT with /Linux/lib appended,
or /usr/local/CAS3.0/Linux/lib

By prefixing $ to the variable name, you can evaluate it in any command:

cd $CASROOT Changes your present working directory to the value of CASROOT

echo $CASROOT Prints out the value of CASROOT, or /usr/local/CAS3.0
printenv CASROOT Does the same thing in bash and some other shells.


Interactive History


A feature of bash and tcsh (and sometimes others) you can use
the up-arrow keys to access your previous commands, edit
them, and re-execute them.


Filename Completion


A feature of bash and tcsh (and possibly others) you can use the
TAB key to complete a partially typed filename. For example if you
have a file called constantine-monks-and-willy-wonka.txt in your
directory and want to edit it you can type 'vi const', hit the TAB key,
and the shell will fill in the rest of the name for you (provided the
completion is unique).


Bash is the way cool shell.

Bash will even complete the name of commands and environment variables.
And if there are multiple completions, if you hit TAB twice bash will show
you all the completions. Bash is the default user shell for most Linux systems.


Redirection:


grep string filename > newfile Redirects the output of the above grep
command to a file 'newfile'.
grep string filename >> existfile Appends the output of the grep command
to the end of 'existfile'.

The redirection directives, > and >> can be used on the output of most commands
to direct their output to a file.

Pipes:


The pipe symbol "|" is used to direct the output of one command to the input
of another.

For example:

ls -l | more This commands takes the output of the long format directory list command
"ls -l" and pipes it through the more command (also known as a filter).
In this case a very long list of files can be viewed a page at a time.

du -sc * | sort -n | tail
The command "du -sc" lists the sizes of all files and directories in the
current working directory. That is piped through "sort -n" which orders the
output from smallest to largest size. Finally, that output is piped through "tail"
which displays only the last few (which just happen to be the largest) results.

Command Substitution


You can use the output of one command as an input to another command in another way
called command substitution. Command substitution is invoked when by enclosing the
substituted command in backwards single quotes. For example:

cat `find . -name aaa.txt`

which will cat ( dump to the screen ) all the files named aaa.txt that exist in the current
directory or in any subdirectory tree.



Searching for strings in files: The grep command


grep string filename prints all the lines in a file that contain the string


Searching for files : The find command


find search_path -name filename

find . -name aaa.txt Finds all the files named aaa.txt in the current directory or
any subdirectory tree.
find / -name vimrc Find all the files named 'vimrc' anywhere on the system.
find /usr/local/games -name "*xpilot*"
Find all files whose names contain the string 'xpilot' which
exist within the '/usr/local/games' directory tree.


Reading and writing tapes, backups, and archives: The tar command


The tar command stands for "tape archive". It is the "standard" way to read
and write archives (collections of files and whole directory trees).

Often you will find archives of stuff with names like stuff.tar, or stuff.tar.gz. This
is stuff in a tar archive, and stuff in a tar archive which has been compressed using the
gzip compression program respectivly.

Chances are that if someone gives you a tape written on a UNIX system, it will be in tar format,
and you will use tar (and your tape drive) to read it.

Likewise, if you want to write a tape to give to someone else, you should probably use
tar as well.

Tar examples:

tar xv Extracts (x) files from the default tape drive while listing (v = verbose)
the file names to the screen.
tar tv Lists the files from the default tape device without extracting them.
tar cv file1 file2
Write files 'file1' and 'file2' to the default tape device.
tar cvf archive.tar file1 [file2...]
Create a tar archive as a file "archive.tar" containing file1,
file2...etc.
tar xvf archive.tar extract from the archive file
tar cvfz archive.tar.gz dname
Create a gzip compressed tar archive containing everything in the directory
'dname'. This does not work with all versions of tar.
tar xvfz archive.tar.gz
Extract a gzip compressed tar archive. Does not work with all versions of tar.
tar cvfI archive.tar.bz2 dname
Create a bz2 compressed tar archive. Does not work with all versions of tar


File compression: compress, gzip, and bzip2


The standard UNIX compression commands are compress and uncompress. Compressed files have
a suffix .Z added to their name. For example:

compress part.igs Creates a compressed file part.igs.Z

uncompress part.igs Uncompresseis part.igs from the compressed file part.igs.Z.
Note the .Z is not required.

Another common compression utility is gzip (and gunzip). These are the GNU compress and
uncompress utilities. gzip usually gives better compression than standard compress,
but may not be installed on all systems. The suffix for gzipped files is .gz

gzip part.igs Creates a compressed file part.igs.gz
gunzip part.igs Extracts the original file from part.igs.gz

The bzip2 utility has (in general) even better compression than gzip, but at the cost of longer
times to compress and uncompress the files. It is not as common a utility as gzip, but is
becoming more generally available.

bzip2 part.igs Create a compressed Iges file part.igs.bz2
bunzip2 part.igs.bz2 Uncompress the compressed iges file.



Looking for help: The man and apropos
commands
Most of the commands have a manual page which give sometimes useful, often more or less detailed, sometimes cryptic and unfathomable discriptions of their usage. Some say they are called man pages because they are only for real men.

Example:

man ls Shows the manual page for the ls command

You can search through the man pages using apropos

Example:

apropos build Shows a list of all the man pages whose discriptions contain the word "build"

Do a man apropos for detailed help on apropos.


Basics of the vi editor

Opening a file
vi filename

Creating text
Edit modes: These keys enter editing modes and type in the text
of your document.

i Insert before current cursor position
I Insert at beginning of current line
a Insert (append) after current cursor position
A Append to end of line
r Replace 1 character
R Replace mode
<ESC> Terminate insertion or overwrite mode

Deletion of text

x Delete single character
dd Delete current line and put in buffer
ndd Delete n lines (n is a number) and put them in buffer
J Attaches the next line to the end of the current line (deletes carriage return).

Oops

u Undo last command

cut and paste
yy Yank current line into buffer
nyy Yank n lines into buffer
p Put the contents of the buffer after the current line
P Put the contents of the buffer before the current line

cursor positioning
^d Page down
^u Page up
:n Position cursor at line n
:$ Position cursor at end of file
^g Display current line number
h,j,k,l Left,Down,Up, and Right respectivly. Your arrow keys should also work if
if your keyboard mappings are anywhere near sane.

string substitution

:n1,n2:s/string1/string2/[g] Substitute string2 for string1 on lines
n1 to n2. If g is included (meaning global),
all instances of string1 on each line
are substituted. If g is not included,
only the first instance per matching line is
substituted.

^ matches start of line
. matches any single character
$ matches end of line

These and other "special characters" (like the forward slash) can be "escaped" with \
i.e to match the string "/usr/STRIM100/SOFT" say "\/usr\/STRIM100\/SOFT"

Examples:

:1,$:s/dog/cat/g Substitute 'cat' for 'dog', every instance
for the entire file - lines 1 to $ (end of file)

:23,25:/frog/bird/ Substitute 'bird' for 'frog' on lines
23 through 25. Only the first instance
on each line is substituted.


Saving and quitting and other "ex" commands

These commands are all prefixed by pressing colon (:) and then entered in the lower
left corner of the window. They are called "ex" commands because they are commands
of the ex text editor - the precursor line editor to the screen editor
vi. You cannot enter an "ex" command when you are in an edit mode (typing text onto the screen)
Press <ESC> to exit from an editing mode.

:w Write the current file.
:w new.file Write the file to the name 'new.file'.
:w! existing.file Overwrite an existing file with the file currently being edited.
:wq Write the file and quit.
:q Quit.
:q! Quit with no changes.

:e filename Open the file 'filename' for editing.

:set number Turns on line numbering
:set nonumber Turns off line numbering



FAQs

The USENET FAQs should be the first place you look for an answer to specific questions.
You can find most of them at RTFM
The contents of this directory includes vi, bash, and comp.unix.questions FAQs.
Searching USENET archives are very useful too.
google.com has a USENET archive (formerly Deja.com's) .
Advanced Group Search rules.


This document was converted from plain text using Vim and
then hacked. Vim is the best version of the one true text editor: vi.




why Apple should buy Sony?

When a company becomes as big as Apple is today, acquisitions become a way to grow quickly and increase synergy towards major corporate goals. Apple long ago stated its
target of living room convergence with video, computer and music, all interactive with the Mac. AppleTV is the first element of that convergence. Steve Jobs has publicly stated that he admires Sony. Apple and Sony go way back in minor collaborations. My first laptop was a PowerBook 100, an Apple Mac manufactured by Sony.

Sony represents some great building blocks to make the transformation of Apple Computer into Apple, the electronics company. Owning Sony would combine the strengths of two great companies into a conglomerate that might blow the competition away. Sony has recently lost its way and needs focus to regain its former glory. Its value is down enough to make it a takeover target in the right situation. Look at the intersections of interest between the companies.

Sony of course, owns PlayStation, which would give Apple the game franchise it lacks. Apple could use that block in building the electronic living room of the future. How would you like to run PlayStation games on a Mac or in HDTV format on your Sony theater HD video display? How about a Sony HDTV camcorder with a built-in hard drive built in that records video in a format that would allow your Mac to use that video directly in the camera and then burn to a Blu-Ray disk, without ever transferring the video into the computer. Electronic devices are commonly "close but no cigar" to doing the cool things that are so "Apple." Sony needs that extra "cool factor" that they have lost sight of over the years, that instinct to know what customers really want is what Apple has in spades.

Blu-ray is another Sony property that Apple can help Sony build on. Apple is one of the early adopters of the Blu-ray high definition video format and we will see Blu-ray disk drives in Macs very soon. The "Apple falling on the Blu-ray side of the fence" will help stop HD-DVD (Toshiba) and make Blu-ray the standard HD disk format. Apple is far and away the innovation leader in computer technology and Apple controlling Blu-Ray technology would send a powerful message; and don't forget the revenue stream from licensing Blu-ray.

Sony TV sets are some of the best video displays in the market place. Like Apple, Sony tends to be the quality leader in it's products. Apple could help Sony focus its R&D, spell that "Steve Jobs," Mr. focus himself. The world class product design of Apple combined with Sony could create an entirely new design engine that might revolutionize our living rooms in 5 years time. Sony has been losing ground on it's market share of big screen TV sets, perhaps Apple can help them design wise, especially with user interface and connect-ability.

Sony holds a lot of patents (over 25,000 US Patents) that combined with Apple technology would be a powerful collaboration of synergy. Intellectual property alone, makes the collaboration interesting, let alone the market and manufacturing implications. The international aspect of Sony and Apple would wear out Steve's old jet, and allow him to buy a nicer brand new one. (Steve, you deserve it) This combination might help Apple sell Macs and iPods in Japan. Remember the halo effect.

Sony pictures and music is an additional property that Steve might find useful, since he's Disney's largets individual shareholder anyway. With the entire Disney and Sony film library in the iTunes store, you have instant content, to make the lagging Apple TV device succeed. Content, content content! Sony's music portfolios and recording companies in addition to the extensive movie library are very valuable to Apple for exclusive sale though the iTunes store. Why negotiate a deal when you can just own them?

Some Sony products that are lagging could be discontinued such as Sony's lackluster music players in favor of iPods sold through Sony distribution. Keep in mind the Sony distribution channels are well established and have valuable marketing aspects Apple might well use to its advantage. Sony has a repair system in place to help with electronic repairs across the board. Some Sony assets could be sold off to help pay for the purchase.

Apple has a big fat bank account, a virtual mountain of cash and perhaps it is time to spend some of it to control Sony. There are a lot of creative ways to do it and I wonder if the thought has crossed the mind of Mr. Jobs. I am thinking Wall Street would like the idea. And Sony might even favor a merger as well. As a die hard Mac fan I can only hope that as Apple grows, it never ceases to be the "Apple" that us Mac fans know and love!

144,000 Installs of AppSnapp

iPhoneAtlas reports that one click web-based Jailbreak for the iPhone and iPod Touch has seen 144,000 downloads since its release. The programmers estimates that this number represents approximately 100,000 actual devices.

AppSnapp allows iPhone and iPod Touch users to "jailbreak" their device easily to allow installation of 3rd party applications. Using the known TIFF exploit, by simply downloading the image on your device's Safari browser triggers the application to open up the iPhone and install the proper applications.

How ATI's new numbering works

Wednesday, October 31, 2007

THE NEW NAMING scheme for ATI cards is about to see the light of day, and frighteningly enough, this one makes sense. What were those product planners thinking?

Theo told you about the names Monday, but how those names come about is interesting. Take the 3870 for example, or to use the full marketspeak, ATI Radeon HD 3870. The first number, 3, denotes the Generation. Why this is different from the 2x00 line I don't know, but from now on, this should advance generationally, whatever that means.

The second number, in this case x8xx, connotes Family, and the last two digits, xx70 is the Variant. 70 is equivalent to XT, 50 is the new name for Pro, and 13 is the card from that company you never heard of with the Englishish manual and no web site. Don't buy the 3813.

When the next gen variants of the 2400 and 2600 come out, expect to see a 3x50 and 3x70, and likely with a few other variants as well.

Last up, there is a card named ATI Radeon HD 3870 X2 on the slides that we have seen, with a release date of 'winter'. The non-X2 line has a price listed as $150-250, while the X2 is in the same price point as the 2900XT, or about $400. I guess that would make the X2 two higher end 3870s on a PCB, but that is not specified.

I suppose all of these questions and more will be answered on the 15th.

Why Non-Technical Users Might Find Shell Scripting Useful

You know, I've never found any real use for a shell script. Recently, I found an actual reason to write one for moving and converting audio files using a few less keystrokes.

I admit it, I'm really a desktop user who doesn't mind getting under the hood every now and then. I enjoy playing with the 'big' toys, like RDBMSes because I can afford to. But mostly, using GNU/Linux affords me an opportunity to do what I need and want to do for a price that can't be beat. Much as I've tried, the only shell scripts I've written in the past were pretty contrived, or simply following some tutorial. Now I have a shell script I can actually make use of.

I'm not going to try to teach Bash scripting here. There are plenty of places where you can learn that. LinuxCommand.org is one. The Advanced Bash-Scripting Guide is another. But I do want to make the argument that even non-technical people ought to consider taking a little time to learn something about the Bash shell and how to write a simple script.

For those that don't already know, I'm using gNewSense, a GNU/Linux distribution that aims at being completely libre, on my laptop. But at least one site I use offers some content only in RealMedia or MP3 format. Unfortunately, MP3 is hampered by patent issues, and I prefer to avoid that. So I started downloading the MP3 files and converting them to Ogg-Vorbis, and then deleting the MP3 files. But that requires downloading the files, moving them into the folder I want, and then converting and deleting them.

First, let me explain the need to move the files. Most of the time, I put my downloaded files in one folder, and choose a different folder for multimedia files by choosing "Save link as" from the context menu. In this case, the site uses a dialog that makes this approach impossible. So, after I download the file, it's a matter of dragging it to the right place in Konqueror, or typing the appropriate command at a Bash prompt. Then I have to run mp32ogg using Bash. And, of course, I have to delete the MP3 file when I'm finished. Using a shell script simplifies this task.

The whole command-line sequence to accomplish my task involves three commands: 'mv', 'mp32ogg', and 'rm'. Of course, in the text file I created, I added the standard initial comment lines:

#!/bin/bash
# Move MP3 files from /downloads to /media/mp3 and convert to Ogg-Vorbis format

mv downloads/*.mp3 media/mp3

mp32ogg media/mp3/

rm media/mp3/*.mp3

So then I saved the file and made it executable. Now, instead of typing those commands, I just open a Bash prompt and type the one new command I created, like this, after downloading the file:
dw_convert

So, now I download the file, type the new command, and play it Amarok.

This may seem a bit contrived. After all, why not just download the MP3 codec, or use a distribution that supports MP3 out of the box? I've already answered that - there are legal issues that lead me to avoid MP3. The site I use has not responded yet to my request for Ogg-Vorbis files, and avoiding the site is detrimental to my goals, unfortunately.

The other reason this is a good example, rather than a bad one, is that, in the Free/Open Source Software community, there are numerous ways to do any particular task. So, while some newbies or non-technical folks might prefer the path of least resistance, and choose a distro that supports MP3 out of the box, this example demonstrates that you can make up new commands as you go (within reason, of course) to simplify what might seem like an otherwise daunting task.

A more typical task for shell scripting is automating your back-ups or auto-configuring your wifi card at boot-time, depending on your location. Blue GNU readers will surely be able to offer other examples. But I hope that non-technical people will be able to see better why anyone would even bother trying to write a shell script.

Note:As has been pointed out in the comments, this script needs some error checking and could probably be greatly enhanced.

Don't be afraid, Linux isn't just for geeks

Monday, October 29, 2007

It came out earlier this week that Dell will soon offer computers running Linux instead of Windows. Not all of its machines, obviously — the company wants to stay in business — but Linux will be an option on at least two desktops and one laptop models.

It's going to be an interesting experiment. Linux is an incredibly powerful operating system, but it's a tinkerers' OS designed to let you get under the hood. There is also a huge base of developers who are coming up with new features, new software, and better ways to do things.

Older versions of Linux were strictly the province of geeks who wanted to play. But for the past several years there's been a large and growing movement to make it accessible to the non-geek — to make it as user-friendly as Windows, but with the power of the Linux community behind it.

The version of Linux Dell will be offering, Ubuntu (it's pronounced "oo-boon-too"), is one of the most popular, user-friendly, and well-designed versions — or distros —available. It's got all of Linux's power and stability, it's completely free (as is most of the software available for it), it's tweakable, and it's — mostly — easy to use.

But "mostly" is the key.

For me, part of determining whether Linux is ready for primetime is whether it would pass the Minandeli test. That refers to my parents, Min and Eli, who are no longer novice Windows users, but far from experts. Could they use Linux?

That in mind, a few weeks ago I set out to play with the latest versions of some Linux distros. The four at the top of my list were Ubuntu and its sister, Kubuntu, as well as OpenSUSE and PCLinuxOS, all of which were reportedly well designed and easy to use.

Alas, the PCLinuxOS download sites were offline and OpenSUSE didn't like my monitor, so I spent my time with Ubuntu and Kubuntu. (They're based on the same underlying code, but have different desktops, analogous to hatchback and sedan versions of the same car.)

Conveniently, Dell played right into my hands by choosing to offer a Linux distro that I had an opportunity to use.

Smooth operators

Let no one say that Linux — specifically Ubuntu and Kubuntu — isn't a beautiful, mature operating system. It installs quickly and easily.

A Windows or Mac user would feel quickly at home, and would enjoy some of Linux's nicer features, such as my favorite: multiple desktops you can switch among.

And Windows has nothing on Adept, Linux's add and remove programs feature. It doesn't just help you remove unwanted programs. It also gives you access to hundreds of pieces of software — from simple games to powerful office applications — stored in online libraries called repositories. It's like having a huge software store at your fingertips, where everything is free.

And that's where you get the first inkling of Linux's weak spots. There are two facts about Linux that deeply affect the user experience. First, there is a huge and dedicated Linux development community. This is good and bad.

If you thought the amount of software that's preinstalled on a new Windows computer was bad, Ubuntu will knock you over. Sure, it's nice having all those free programs at your disposal (unlike what's on a lot of Windows systems, this stuff isn't trialware). But for someone just getting his feet wet on a new operating system it's what psychology professor Barry Schwartz famously termed " a tyranny of choice."

Want to play music? There are 11 music players to choose from, including Audacious, JuK, and Quark. Need a text editor? Would you prefer GTKedit, Kate, KEdit, KWrite, Leafpad, Mousepad, or xae? All are available with a click or two from the gigantic repository.

If you want to install something that's not in the repositories, though, you might run into another non-Windows-like aspect of Linux. It's much more modular than Windows, so many programs need other software in place in order to work — something called "dependencies."

Thus when I tried to install the Cinelerra video editor, I had to first install some other things, and some of those needed things as well. Had my geek gene not been expressing itself, it would have been impossible.

Linux users are comfortable with this, judging by a comment in an article written earlier this year about Cinelerra: "...installation is simple: I add the correct Cinelerra repository for my CPU, along with the Debian Multimedia repository, to my /etc/apt/sources.list file, then update and install Cinelerra."

Linux folks are some of the best tinkerers on the planet, so this kind of stuff is second nature to them. My parents, not so much.

And while Linux itself — especially the version Dell will offer — is slick, much of the software available for it is not. It lacks the polish of many of the applications you'll find for Windows and the Mac.

The GIMP, the Linux image editor on par with Photoshop, really isn't on par at all. Yes, you can do most of the same things, but if you're coming over from the Adobe product you'll find The GIMP rough around the edges, to say the least.

And if you want to do video editing, forget it. There are a handful of programs available, notably Kino and Cinelerra, but neither works as smoothly as, say, Sony Vegas or even Adobe Premiere.

The best office suite for Linux is OpenOffice.org, which is very, very good ... but, again, a step below Microsoft Office when it comes to smoothness and polish.

Is Linux a viable desktop option if you're buying a Dell computer? Absolutely, as long as you're not interested in video editing (and you image-editing needs are limited), and as long as you're willing to put up with rough edges in exchange for a free operating system, freedom from just about any virus, and the potential to tinker to your heart's content.