Coredump

Work, play, and everything in-between.

Archive for the ‘tips’ tag

Quick directory switching

with 3 comments

At work, I do a lot of directory traversal: going from one location to another within the whole (global) filesystem structure. So, to conveniently go back to a previous directory, I use pushd and popd, aside from the usual cd:

$ pwd
/home/iandexter
$ pushd /etc/sysconfig
$ pwd
/etc/sysconfig
$ popd
$ pwd
/home/iandexter

You can even echo $DIRSTACK to list the current directories in the stack, and push multiple directories.

Written by Ian Dexter

August 17th, 2007 at 2:07 am

Posted in Play, Work

Tagged with , , , , , ,

From my ‘digital’ baul: Notes on news writing

without comments

I was rummaging through my backup CDs — yes, I keep those, despite the fact that there’s always FTP. (Torvalds)

A bit of a backgrounder: I used to be an editor for the school publication back in college. In fact, I was with the national secretariat of the College Editors Guild of the Philippines from 1996 to 1998. During my stint with the CEGP, we give journalism training to other student writers. This was a part of my notes on editorial writing. I’ve had notes on other topics: editorial analysis, publication design and features writing. Only, those aren’t in my known backups. But they’re in there somewhere.

I borrowed copiously from Vergel Santos, my dad’s former editor in the now-defunct Today, who gave a particularly refreshing and unconventional talk on writing way back in 1997.

Some notes on news writing

Definition.

  • “History in a hurry.” (Nick Joaquin)
  • Derived, presumably, from the cardinal directions, hence, coming from all sides, everywhere.
  • “Fresh info of something recent; new or strange.” (Webster)

Types.

  • Verbal. Grows out of speeches, interviews, press releases, documents. “Stories you listen to.”
  • Visual. Elements that are concrete, explicit. Involves human struggle, action. Typically sports and police stories. “Stories you can see.”

Structure.

  • Conventional. Inverted pyramid.

    News structure - pyramid

    Most of the time, this still works but is considered passe. It came from when reporters used to call in their stories. (Aside: my dad spent some of his time filing his stories this way.) Sometimes, the transmission gets cut off so it was necessary to put everything important in the first few paragraphs. (Another aside: also, back in the days of literal cut-and-paste, it’s often okay to just cut off the end parts of the columns to fit the copy in the page, hence the publication term, “copyfitting”.) With the advent of fax machines and emails, complete stories can reach the desk on the fly and intact. Another reason why this is considered almost obsolete is that it is too mechanical to order the importance of paragraphs in a story — it goes against the natural flow of thought.

  • New. “Hour glass” configuration.

    News structure - hour glass

    This is more flexible and solves the problem of natural flow. As always, the lead is at the core of every news story. A reporter cannot cram all the salient facts in the lead to drive the point in, so a lead support is used to back it up. The lead support can consist of as many as two to three paragraphs. Details can then follow, going through the natural motion of the story. Background material can be inserted to prop everything up and add spice to the rest of the article.

    The point is to take care of the important points first: what happened? (lead); why? how? (lead support); what does it mean? what makes it unique? (detail). Write a story as if you’re telling it to a friend, a neighbor or a colleague.

Elements. What makes news news?

  • Immediacy. Something that just happened, is happening, or is about to happen.
  • Proximity. Anything that directly or indirectly affects the audience, their families and friends, neighborhood or community. Not just physical but psychological. Mental as well as linear. How close is it?
  • Consequence. Significance of the story for the readers. What will this bring about? What’s it to me? Closely related to immediacy and proximity.
  • Prominence. Well-known people, events, places (remember Loren Legarda’s PEP Talk?) by virtue of achievements or notoriety.
  • Conflict. The struggle between good and evil is always a central element in every human conflict: the criminal versus the victim; the landlord versus peasants; Lucio Tan and the Estrada regime versus striking PAL workers [NB: The age of this article shows.]; repressive school administration policies versus students.
  • Suspense. Piling up of action to an unpredictable climax.
  • Oddity. Anything strange, rare, unfamiliar, novel.

Lead. The “core” of a news story.

In a lead, facts must be at the maximum, words kept at a minimum. (Fifteen to 20 words standard; one sentence, one paragraph.) More sentences mean more words; more words, more relationships; more relationships, more effort to the reader; a greater chance of misunderstanding by the reader; the sooner he will just quit reading. KISS: keep it short and sweet.

  • Conventional. Summary or capsule lead (5Ws, 1H).
  • Grammatical.
    • Subject - emphasis on individuals, events, places, objects.
    • Phrase - prepositional (to).
    • Clause - conditional (if), causal (because), substantive (what), concessive (although), temporal (after, before).
  • Teasers.
    • Quotation - direct or indirect, often forceful.
    • Allusion - coining a literary phrase, for example.
    • Staccato - build-up of action.
    • Question - posing something to be answered in the succeeding paragraphs, or not at all.

Tips.

  • Use natural language. Be comfortable with the reader: try to establish rapport, but don’t get too chummy — be reserved, not aloof. Use simple words: avoid heavy phraseology — you are writing for the reader, not for your editor nor yourself. Take pains in explaining terms, if jargon is unavoidable. Know the nuances of the language — remember, words are weapons. Mind your grammar, use appropriate tensing.
  • Edit your own work. Cut ruthlessly. Read your story. Then cut some more. (Aside: In the editorial office of the Assumption College’s publication, I read this sign: “Macro-edit, then micro-edit.”) Less verbal fat, more contextual muscle.
  • Establish meaning, context and perspective in your story. These can be inferred from the detail and background aspects. But don’t keep your readers guessing. Get to the point, and quickly.
  • Remember your ABCs: accuracy, brevity and coherence.
  • Attribute. If possible, reveal your source at the onset of the story to establish credibility and authority. Or, for effect, delay the introduction of the source until the later paragraphs. Protects against libel, too.
  • Assume your reader knows nothing of the story. Convince him that it will affect him and everyone around him. Make your story significant. Make it interesting, but don’t dumb it down. Do not put on a condescending tone, “preach to the choir”, nor proselytize.
  • Cover everything. Gather facts conscientiously and present them clearly. Avoid generalizations and speculations — reserve that for opinion writers, pundits and your readers.
  • Take sides. Objectivity comes from the careful presentation of facts — nothing more. Take all sides of the story, but always emphatize with the aggrieved party.

Written by Ian Dexter

September 13th, 2006 at 9:39 pm

Posted in Play, Work

Tagged with , , , ,

BIND in a jiffy

without comments

I’m coaching a new engineer on Linux- and systems administration-related tasks. Here’s a set of exercises I did for DNS.

  1. Install BIND. By default, what packages does Red Hat (RH) install? How would you find out? Hint: `man rpm`.
  2. View the configuration file in /etc/named.conf. Describe what each section is for:
    1. options { }
    2. controls { }
    3. key "rndc_key" { }
    4. zone "." { }
    5. zone "0.0.127.in-addr.arpa" { }
  3. What is the /var/named/named.ca file? How do you update this file? Hint: `dig` it up.
  4. Describe the function of each record in /var/named/named.local:
    1. SOA
    2. NS
    3. PTR

    Notice the ‘.‘ at the end of the domain name? What is it for? What will happen if you take it out?

  5. Configure your box to use your recently installed DNS server.
    1. Edit /etc/resolv.conf. Add your nameserver. (Don’t forget to restart the networking service.)
    2. Start BIND. How? What would you check to see if BIND starts at boot?
    3. Test your nameserver. Hint: `man dig`.
    4. Do a DNS lookup for an external domain:
      $ dig google.com
      $ dig google.com
      

      What’s the difference between the two commands above? Hint: It has something to do with the way DNS works.

  6. Create your own domain.How will you do that? Hint: Copy, edit and rename named.local.
    1. Create a new zone in named.conf.
    2. Edit the zone file. It should contain something like this:
      ; Zone - iandexter.net
      $TTL 3D
      @   IN   SOA   hiraya.iandexter.net. hostname.iandexter.net. (
         20060901   ; serial
         8H      ; refresh
         2H      ; retry
         4W      ; expire
         1D)      ; minimum
      ;
         NS   hiraya.   ; name server
         MX   5 padme.iandexter.net
         MX   10 arwen.iandexter.net.
         MX   15 eowyn.iandexter.net.
         MX   20 mail.
      ;
      localhost   A   127.0.0.1
      hiraya   A   192.168.1.101
      ns   CNAME   hiraya
      mail   CNAME   hiraya
      pop   CNAME   hiraya
      www   CNAME   hiraya
      proxy   CNAME   hiraya
      ftp   CNAME   hiraya
      padme   A   192.168.1.51
      arwen   A   192.168.1.150
      eowyn   A   192.168.1.153
      

      Explain what the following means:

      1. A
      2. MX What about the number beside it?
      3. CNAME
      4. serial
      5. refresh
      6. retry
      7. expire
      8. minimum
      9. TTL
    3. Restart BIND.
      # rndc reload
  7. Test your new domain.
    $ dig any your.domain

    What do you notice? Hint: Something’s awfully wrong. (Look at step 4 above.) Correct it, then test your domain again.

    # rndc reload; dig axfr your.domain
  8. Create a reverse zone. Why do you need it? You should have something like this:
    ; Reverse zone - 1.168.192
    $TTL 3d
    @   IN   SOA   hiraya.iandexter.net. hostmaster.iandexter.net. (
       20060901   ; serial
       8H      ; refresh
       2H      ; retry
       4W      ; expire
       1D)      ; minimum
    ;
       NS   hiraya.iandexter.net.
    ;
    101   PTR   hiraya.iandexter.net.
    102   PTR   mithi.iandexter.net.
    150   PTR   arwen.iandexter.net.
    151   PTR   padme.iandexter.net.
    152   PTR   mathilda.iandexter.net.
    153   PTR   eowyn.iandexter.net.
    154   PTR   evey.iandexter.net.
    155   PTR   galadriel.
    

    Notice the last line above: it’s just another way of writing it — saves typing, too. Test your reverse zone.

    # rndc reload; dig -x your.server.ip
    # dig axfr your.reverse.zone
    
  9. Test your new domain on another machine.
    1. In Windows, add your nameserver in the DNS list. Try to look up records in your domain.

      C:\> nslookup
      > server your.nameserver.ip
      > set type=all
      > your.domain
      
    2. Ping your nameserver (or hosts you have added to that zone) using fully qualified domain names.
  10. Secure your nameserver.
    1. Disable queries from domains you don’t own, except from your servers or subnet.
    2. Disable recursive queries, except internally.
    3. By default, RH runs BIND in a chroot jail. Why?

Bonus question:
Why go through all this trouble when you can have Linux (even Windows, actually) resolve hostnames to their IP addresses? How do you do that?

Written by Ian Dexter

September 1st, 2006 at 3:38 pm

Posted in Work

Tagged with , , , ,

CLI keyboard shortcuts

without comments

Got this from CJ Pangilinan, through the PLUG mailing lists:

  • Ctrl+S. Scroll lock.
  • Ctrl+Q. Release scroll lock.
  • Home or Ctrl+A. Move the cursor to the beginning of the current line.
  • End or Ctrl+E. Move the cursor to the end of the current line.
  • Alt+B. Move the cursor to the beginning of the current or previous word.
  • Alt+F. Move the cursor to the end of the next word.
  • Ctrl+U. Erase the current line.
  • Ctrl+K. Delete the line from the position of the cursor to the end of the line.
  • Ctrl+W. Delete the word before the cursor.
  • Shift+PageUp. Scroll terminal output up.
  • Shift+PageDown. Scroll terminal output down.
  • Ctrl+L. Does exactly the same as typing the clear command.
  • ArrowUp or Ctrl+P. Scroll up in the history and edit the previously executed commands. To execute them, press Enter like you normally do.
  • ArrowDown or Ctrl+N. Scroll down in the history and edit the next commands.
  • Ctrl+R. Find the last command that contained the letters you’re typing.
  • Ctrl+C. Kill the current process.
  • Ctrl+Z. Send the current process to background. Type the command fg to get the process back.
  • Ctrl+D. Log out from the current terminal.

Thanks, CJ!

Written by Ian Dexter

May 23rd, 2006 at 5:28 pm

Posted in Play

Tagged with , , ,

Using Flickr to organize my toy collection

without comments

I’ve posted this howto in my toy-collection journal.

I collect diecast Mini Coopers, and I’ve been wanting to organize my miniscule collection for sometime. Well, Flickr does the trick for me. [via Me want Minis!]

Written by Ian Dexter

January 10th, 2006 at 2:43 pm

Posted in Play

Tagged with , , , , ,