2009 102: Difference between revisions
No edit summary |
|||
(14 intermediate revisions by the same user not shown) | |||
Line 76: | Line 76: | ||
* http://tipotheday.com/2007/10/11/wget-some-quick-tips/ | * http://tipotheday.com/2007/10/11/wget-some-quick-tips/ | ||
* http://ubuntuforums.org/showthread.php?t=718549&page=2 | * http://ubuntuforums.org/showthread.php?t=718549&page=2 | ||
=== Solutions === | |||
<source lang="bash"> | |||
wget -r -nd -np --follow-tags=img http://www.colourlovers.com -A.jpg,.jpeg | |||
montage *.jpg ../public_html/montage.jpg | |||
</source> | |||
Blurps out this file: http://pzwart2.wdka.hro.nl/~tklok/montage.jpg | |||
(Notice the wget is run from a different directory the where the picture is placed) | |||
*http://pzwart2.wdka.hro.nl/~ebonetti/Emanuele/montage.png | |||
*http://pzwart2.wdka.hro.nl/~svilayphiou/techdaze/102/montage.jpg | |||
*http://pzwart2.wdka.hro.nl/~cbaronavski/static/hate.jpg | |||
*http://pzwart2.wdka.hro.nl/~mappelman/montage.png | |||
== Assignment for next week == | == Assignment for next week == |
Revision as of 16:43, 14 October 2008
this page is under construction ;)
Command Line Media / "Media Bashing"
While the command line, or shell, is a text-based interface, this does not mean that manipulating other kinds of media, image, sound, video, is excluded. Far from it, many command line tools offer extremely useful and uniquely powerful functionality difficult to achieve with GUI programs. In addition, by applying the basics of pipelining and abstraction (through creating your own scripts with parameters), the command line enables highly particular and personal media tools to be created by pulling existing tools together in novel ways.
Making a "frontpage" snapshot tool
An exercise to build a simple tool to support visual comparison of front pages newssites a la Sarah Charlesworth's Modern History (1978). The work, among many other works of interest, can be seen as part of the Order Of Things exhibition, through the end of the year at the MuKHA, Antwerp.
Exercise explores the principle of:
- simple command line tools focused on doing a simple task
- the idea of a pipeline to join various commands together
- introducing the concept of a variable to make a personal "tool"
- cron jobs to automate a process over a long time period
Tutorial
Getting a grip on a tool
Command line programs, as focused and "simple" as they may be, often take some time to get used to. The initial man-page dump of possible options may seem overwhelming at first, but if you simply have a little discipline to try some variations, and above all to record your successes (in a text file and/or by taking notes on a printed copy of a man page), you can soon feel comfortable to use the new program.
We start with the tool wget.
First, simply try to run it:
wget
wget --help
Too much information! A pipeline to the rescue!
wget --help | less
man wget
Man has an option to output print-friendly postscript output. It's described on the "man" man page. (That's right: "man man"!)
man -t wget
man -t wget > wget.ps
evince wget.ps
Necessary Tools / Topics
- Shell basics: cd, pwd, mv, cp
- Connecting to a "remote" server with ssh
- public_html
- scp
- wget
- ImageMagick: convert, mogrify, montage
Concepts
- man pages
- command line options
Examples of wget
- http://linuxgazette.net/issue70/chung.html
- http://tipotheday.com/2007/10/11/wget-some-quick-tips/
- http://ubuntuforums.org/showthread.php?t=718549&page=2
Solutions
wget -r -nd -np --follow-tags=img http://www.colourlovers.com -A.jpg,.jpeg
montage *.jpg ../public_html/montage.jpg
Blurps out this file:
(Notice the wget is run from a different directory the where the picture is placed)
Assignment for next week
- Chapters 3 & 4 from Think Python
- Exercises from the book plus the additional exercise
Chapter 4 introduces some Turtle Graphics!