Sci-fi ponderings when (almost) idle

June 22, 2009 by f241vc15

I was talking to one of my housemates last night while I was taking a break from using my PC when we came to the topic of Terminators.  Being sci-fi fans (me especially) we talked about the realism of robots and computer software taking over the world.

The proposed problems pertaining to plausibilities

Now, my housemate proposed that Skynet, the autonomous computer program that took over the world and is responsible for the decline and domination of the human race, isn’t very plausible, or at least isn’t ‘too’ smart. His propositions are the following:

a) Skynet should have made the Terminators smarter so as to make them more adaptable to human circumstances, issues, and environment.

He mentions that though they look like humans, they (or at least the ones in the movies, unlike in the Terminator TV series) they still act relatively cold and robot-like. Adapting to human behavior, emotions, idiosyncrasies, at least temporarily, may help them perform their missions better, i.e. terminating their targets.

b) Skynet, at least in the future (so my housemate concedes), should have made itself connected/linked to Terminators so that it can use it’s powerful processors and information on humans, including their tactics, to finally wipe out the human race and leave nothing to stand up against it.

I made my housemate actually concede early in this proposition that this can only work in the future, because how would Skynet of the future control and communicate with Terminators it has sent to the past? It could be quite given that future Skynet would be linked to the Terminator pawns via some wireless technology, but wireless technology across time? Dubious.

The proposed answers to the problems

a) Now this one has been answered already in Terminator 2: Judgement Day, when John Connor asks (approximately at 1 hour 6 minutes of the Special Edition of the movie) if Terminators (or at least the T-800 model 101 Terminator a.k.a. Arnold model/line of terminators) can learn new things so they can be more human. The terminator responds by saying that Skynet “presets the switch to ‘read-only’ when terminators are sent out alone”, to prevent them from “thinking too much”. This then prevents terminators by default, or at least the movie terminators such as the T-800, T-850 T-1000, and T-X, from learning a lot of things about what makes humans humans.

b) One solution I’ve thought about for this specific conundrum in the Terminator universe, which could also be said in real life hardware/software,  is that if Skynet ‘hooks’ itself up to every terminator walking around trying to find, infiltrate, and terminate humans, i.e. connect its thinking to the terminators, then that would lead to a vulnerability. The vulnerability comes from the fact that by doing so (hooking up/connecting to terminators in the field) would allow humans to insert a virus or ‘anti-Sknet’ software to one or more captured terminators, which could then be uploaded to the main Skynet program and destroy Skynet entirely. This is possible because Skynet has to maintain a duplex connection to the terminators in the field if Skynet is to control them and still be in sync with the main Skynet program. I think this is a risk Skynet would not dare take.

Questions/comments/arguments? Feel free to post them as long as they’re calm, ruly. :)

In Linux, no cpu-z you see…

June 22, 2009 by f241vc15

… which may be bad at the start, but isn’t so if you really know how powerful Linux is. In this case, you don’t really need to acquire a cpu-z-like software, unless of course you’re freaked out by the command line (which we’ll use in this case).  Linux (at least those that use kernel versions 2.6 and above) have quite  an array of commands that lets you acquire most info that cpu-z will give you on a Window$ box, sometimes less, sometimes more. These commands are especially useful in cases like (this was my case a week ago, that’s why I had to find out about them) there’s no graphical interface for you since you’re either remotely doing administration or the server just doesn’t have any graphical server/service installed.

To list information about the CPU enter the command

cat /proc/cpuinfo

To list your PCI devices type the command

lspci

To acquire information about your installed memory/RAM sticks or modules, one command to do this is

sudo dmidecode —type 17

To check your hard drives, the following commands give you loads of info

cat /proc/diskstats | egrep "^\s?+8"
df -hT
ls -lh /dev/disk/by-path/
ls -lh /dev/disk/by-id/
ls -lh /dev/disk/by-uuid/
cat /proc/scsi/scsi

you then can find out disk info by running the following on each node listed (device name in third column):

sudo fdisk -l /dev/NODE (e.g. sudo fdisk -l /dev/sda, if you have SCSI drives)

There are quite a lot more commands to get information about the hardware you are running, without shutting it/them down so you can open them up and check the hardware yourself. Or you won’t have to grab your hardware’s manual (whether locally or online) just to get info about your hardware. Good especially for sys ads like me. :)

Quite Quotable Quotes: Star Trek (2009 film)

May 11, 2009 by f241vc15

From the new (and I should say fascinating) Star Trek film comes the following quotable quotes.

From Spock Prime (Leonard Nimoy) at the end of the film, the updated Star Trek mantra is as follows:

Space: the final frontier. These are the continuing voyages of the starship Enterprise. Her ongoing mission: to explore strange new worlds, to seek out new life-forms and new civilizations; to boldly go where no one has gone before.

And from Scotty (played by actor Simon Pegg):

So, the Enterprise has had its maiden voyage, has it? She is one well endowed lady! I like to get my hands on her ample nacelles if you’ll pardon the engineering parlance

And  from “Bones” McCoy (Karl Urban) and young James Kirk’s (Chris Pine) exchange:

Bones: Don’t pander to me, kid. One tiny crack in the hull and our blood boils in thirteen seconds. Solar flare might crop up, cook us in our seats. And wait till you’re sitting pretty with a case of Andorian shingles, see if you’re so relaxed when your eyeballs bleed. Space is disease and danger wrapped in darkness and silence.
Kirk: I hate to break it to you, but Starfleet operates in space.
Bones: Yeah. Well, I got nowhere else to go. The ex-wife took the whole damn planet in the divorce. All I’ve got left is my bones.

Finally, what would Spock and the Vulcans be without the Vulcan salute coupled with

Live long, and prosper

:D

And some thoughts immediately after watching Star Trek:

1. Fascinating.

2. Can’t wait for the DVD and Blu-ray to come out.

3. Can’t wait for a TV series.

4. Can’t wait for the sequel (as confirmed by this site, the major cast  and crew are signed up for 2 more sequels. Yay!)

5. Can’t wait for more official books and comics.

Ubuntu, Ubuntu 9.04 Jaunty Jackalope, MSI Wind netbook, and everything in between

April 30, 2009 by f241vc15

I just downloaded Ubuntu 9.04 codename Jaunty Jackalope (let’s call it Jaunty for brevity’s sake). I’ve been very occupied the past few days with my morning and afternoon/evening work that’s why it took me this long to sit down and check out Jaunty.  And this post is a quick overview of what’s it like to experience Jaunty, specifically over my MSI Wind U100x.

Aesthetics

Jaunty looks much sleeker and more streamlined than previous Ubuntu incarnations, as shown by the loading splash image.

The login screen has also been revamped and kind of feels more like KDE (which isn’t bad in my opinion).

The geeky stuff

Jaunty gives you the option to install your system using the new ext filesystems, ext4. I tried it out and though I haven’t done any timing tests, the bootup from a clean install seems to be slightly faster. Of course, ext4 has been released for quite a while now and one more reason to use it other than it improves upon the performance of ext3 is that Ubuntu usually never releases/allows untested software (filesystems not the least of these) so you can be pretty sure ext4 is a safe bet. Plus, there’s support from Canonical.

I’m still plowing through Jaunty but the news is that ctrl+alt+backspace, used for restarting the X server, doesn’t work by default. To turn it on, edit your xorg.conf and add:

Option "DontZap" "false"

to the ‘ServerFlags’ section which you should also create/add. The result should look something like

Section "ServerFlags"
    Option         "DontZap" "false"
EndSection

and can also be quickly resolved via a quick Google search. If you want to turn off the restarting effect of ctrl+alt+backspace, then change ‘false’ to ‘true’. More info here.

The boys and girls at the MSI Wind forums have been talking about how Jaunty works in MSI wind. The MSI Wind wiki even has an entry for Jaunty found here, though I must say I didn’t really need much or even all of it to make everything run on my Wind. I’m also quite surprised that that wiki is pretty updated, last updated April 30 when I checked last. The webcam, wi-fi (which is quite surprising since it’s been plagued with problems since Hardy and Intrepid, the 2 previous Ubuntu releases before Jaunty) and others work after a fresh install. Of course for the web cam, you’d have to install a web cam softwaree like Cheese for example, which is readily available in the list of availabe software for download. No config whatsoever as written by the links I gave above. That hassle free setup is kind of scary (at least for me) since I usually like fiddling with my *nix box via the console, but then again nothing is really stopping me right?

Ubuntu 8.04.X (Hardy Heron) wi-fi on Wind

As for making wi-fi run on Hardy, I essentially followed what’s been written here in this part of the MSI Wind forum, particularly this section:

First, you need a proper build environment with the appropriate kernel headers. This is done fairly easily:

Code:
sudo apt-get install build-essential linux-headers-`uname -r`

Next, download and unpack the modified driver sources:

Code:
wget http://scopeboy.com/things/rtl8187se_linux_26.1012.0331.2008_modified.tar.gz
tar xvzf rtl8187se_linux_26.1012.0331.2008_modified.tar.gz

Now build them. Note that you’ll need to set an environment variable in order to avoid a certain problem:

Code:
cd rtl8187se_linux_26.1012.0331.2008
export KBUILD_NOPEDANTIC=1
./makedrv

Now, assuming everything compiled without errors, try starting it all up using the wlan0up script. This will insert the appropriate modules and enable the wireless device. You should then be able to use it with Ubuntu’s network manager.

Code:
sudo ./wlan0up

One other thing to note here is that the person who wrote the piece above was using 8.04.1, and not just 8.04, so it may not necessarily work for you. What you do is just download (from the same forums) the tar.gz driver appropriate for your Hardy version. I myself was using 8.04.2 so I used a .1016.0331 driver package instead of the .1012.0331 shown above. The you can install programs like wi-fi radar (to install it just run ‘apt-get install wifi-radar’) to scope out existing wifi networks around you.

The cool commandline tool I like using is iftop  (apt-get install iftop). The tool iftop shows you what networks/hosts/IP addresses you are connecting to or they to you. It also shows you all the traffic that goes your network card’s way. You run it via

    sudo iftop

which by default let’s you view your first NIC which is usually your wired connection so you do a

    sudo iftop -i wlan0

to view the traffic passing through your wireless card (just replace wlan0 with whatever the command ifconfig gives you as the device name for your wifi card). Then assuming you followed the steps above correctly and you didn’t encounter an error, you should be seeing arrows pointing to and from your IP address coupled with the download and upload speeds (in Bytes, KB or even MB depending on how fast your wireless connection is).

Verdict

So if you really want to stick with Ubuntu’s current LTS (i.e. Hardy) since it gets software updates till 2011, then try the trick above to make your wifi run. Otherwise if you don’t really mind updating your system every 12 months or so, then go for Jaunty. Look and feel and performance is topnotch. So far :) But knowing Ubuntu’s history on software updates and support, plus the huge community and industry support/help you can get, it’s more than enough I think to make you switch from the ‘other’ popular operating system with 4 colors :)

Quite Quotable Quotes: Mulder and Scully

April 1, 2009 by f241vc15

These are from FBI special agents Mulder and Scully’s conversation on the X-Files episode “The Unnatural”, season 6 episode 19:

SCULLY: Mulder, it is such a gorgeous day outside. Have you ever entertained the idea of trying to find life on this planet?

MULDER: (looking at the record book) I have seen the life on this planet, Scully and that is exactly why I am looking elsewhere.

:)

Quite Quotable Quotes: Rorschach

March 30, 2009 by f241vc15

I’m starting a series of short posts from people (real or imaginary) I admire or those that interest me and have affected me in one way or another.
First off is a journal entry from Rorschach’s journal, Watchmen issue #2 by Alan Moore and Dave Gibbons:

“I heard a joke once: Man goes to doctor. Says he’s depressed. Says life is harsh and cruel. Says he feels all alone in a threatening world. Doctor says, “Treatment is simple. The great clown Pagliacci is in town tonight. Go see him. That should pick you up.” Man bursts into tears. Says, “But doctor… I am Pagliacci.” Good joke. Everybody laugh. Roll on snare drum. Curtains.”

This quote is also mentioned by Rorschach in the Watchmen movie.

Pretty Practicable PDF Tricks In Linux

March 23, 2009 by f241vc15

I still don’t have quite a lot of time to write a more or less decent technology or philosophy or science/math related post, but I just want to put this on my blog for the sake of reference  again (as most, if not all, of my blog entries).

My Dilemma

I have a copy of a pdf file from which I want to share some parts only to my lab exercise partner (for reasons I can’t exactly divulge in the public Internet). So I Google around how to manipulate, specifically to  pluck/extract specific pages from a pdf file, and still output the extracted files as pdf file/s themselves. Then I found pdftk. Fantastic tool. Really.

Why Is It Fantastic?

Here are a few reasons why:

For such a small (more or less) package (3408kB in my Ubuntu 8.10 installation) you can:

Pdftk can join and split PDFs; pull single pages from a file; encrypt and decrypt PDF files; add, update, and export a PDF’s metadata; export bookmarks to a text file; add or remove attachments to a PDF; fix a damaged PDF; and fill out PDF forms. In short, there’s very little pdftk can’t do when it comes to working with PDFs.

Also,

Developer Sid Steward describes pdftk as the PDF equivalent of an “electronic staple remover, hole punch, binder, secret decoder ring, and X-ray glasses.”  Pdftk can join and split PDFs; pull single pages from a file; encrypt and decrypt PDF files; add, update, and export a PDF’s metadata; export bookmarks to a text file; add or remove attachments to a PDF; fix a damaged PDF; and fill out PDF forms.

Swiss army knife of PDF files anyone? And thankfully, it’s free and open source. The above quotes are from linux.com, and a lot of us know that once something gets posted on linux.com, it’s more or less worthwhile to learn, more so to read at the very least. pdftk is a command line tool (sorry, but check out my further references below).

And installing it is just simply

sudo apt-get install pdftk

in my Ubuntu 8.04 and 8.10 installations. Again, quoting from linux.com, here are some very useful (at least to me) things you can do with pdftk. Of course, with a bit of knowledge in scripting or programming (bash, php, python etc) you can work wonders with this tool:

Joining files

Pdftk’s ability to join two or more PDF files is on par with such specialized applications as pdfmeld and joinPDF (discussed in this article). The command syntax is simple:

pdftk file1.pdf file2.pdf cat output newFile.pdf

cat is short for concatenate — that is, link together, for those of us who speak plain English — and output tells pdftk to write the combined PDFs to a new file.

Pdftk doesn’t retain bookmarks, but it does keep hyperlinks to both destinations within the PDF and to external files or Web sites. Where some other applications point to the wrong destinations for hyperlinks, the links in PDFs combined using pdftk managed to hit each link target perfectly.

Splitting files

Splitting PDF files with pdftk was an interesting experience. The burst option breaks a PDF into multiple files — one file for each page:

pdftk user_guide.pdf burst

I don’t see the use of doing that, and with larger documents you wind up with a lot of files with names corresponding to their page numbers, like pg_0001 and pg_0013 — not very intuitive.

On the other hand, I found pdftk’s ability to remove specific pages from a PDF file to be useful. For example, to remove pages 10 to 25 from a PDF file, you’d type the following command:

pdftk myDocument.pdf cat 1-9 26-end output removedPages.pdf

Updated Man page

For all the geeks and geekettes out there (no this sub heading is not sexist), here’s an updated man page from my Ubuntu 8.10 server installation:

PDFTK(1)                                                                                                                          PDFTK(1)

NAME
pdftk – A handy tool for manipulating PDF

SYNOPSIS
pdftk <input PDF files | – | PROMPT>
[input_pw <input PDF owner passwords | PROMPT>]
[<operation> <operation arguments>]
[output <output filename | - | PROMPT>]
[encrypt_40bit | encrypt_128bit]
[allow <permissions>]
[owner_pw <owner password | PROMPT>]
[user_pw <user password | PROMPT>]
[flatten] [compress | uncompress]
[keep_first_id | keep_final_id] [drop_xfa]
[verbose] [dont_ask | do_ask]
Where:
<operation> may be empty, or:
[cat | attach_files | unpack_files | burst |
fill_form | background | stamp | generate_fdf
dump_data | dump_data_fields | update_info]

For Complete Help: pdftk –help

DESCRIPTION
If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses.
Pdftk is a simple tool for doing everyday things with PDF documents.  Use it to:

* Merge PDF Documents
* Split PDF Pages into a New Document
* Rotate PDF Documents or Pages
* Decrypt Input as Necessary (Password Required)
* Encrypt Output as Desired
* Fill PDF Forms with X/FDF Data and/or Flatten Forms
* Generate FDF Data Stencil from PDF Forms
* Apply a Background Watermark or a Foreground Stamp
* Report PDF Metrics such as Metadata and Bookmarks
* Update PDF Metadata
* Attach Files to PDF Pages or the PDF Document
* Unpack PDF Attachments
* Burst a PDF Document into Single Pages
* Uncompress and Re-Compress Page Streams
* Repair Corrupted PDF (Where Possible)

OPTIONS
A summary of options is included below.

–help, -h
Show summary of options.

<input PDF files | – | PROMPT>
A list of the input PDF files. If you plan to combine these PDFs (without using handles) then list files in  the  order  you
want  them  combined.  Use – to pass a single PDF into pdftk via stdin.  Input files can be associated with handles, where a
handle is a single, upper-case letter:

<input PDF handle>=<input PDF filename>

Handles are often omitted.  They are useful when specifying PDF passwords or page ranges, later.

For example: A=input1.pdf B=input2.pdf

[input_pw <input PDF owner passwords | PROMPT>]
Input PDF owner passwords, if necessary, are associated with files by using their handles:

<input PDF handle>=<input PDF file owner password>

If handles are not given, then passwords are associated with input files by order.

Most pdftk features require that encrypted input PDF are accompanied by the ~owner~ password. If the input PDF has no  owner
password,  then  the  user  password  must be given, instead.  If the input PDF has no passwords, then no password should be
given.

When running in do_ask mode, pdftk will prompt you for a password if the supplied password is incorrect or none was given.

[<operation> <operation arguments>]
If this optional argument is omitted, then pdftk runs in ’filter’ mode.  Filter mode takes only one PDF input and creates  a
new PDF after applying all of the output options, like encryption and compression.

Available operations are: cat, attach_files, unpack_files, burst, fill_form, background, stamp, dump_data, dump_data_fields,
generate_fdf, update_info. Some operations takes additional arguments, described below.

cat [<page ranges>]
Catenates pages from input PDFs to create a new PDF.  Page order in the new PDF is specified by the order  of  the  given
page ranges.  Page ranges are described like this:

<input PDF handle>[<begin page number>[-<end page number>[<qualifier>]]][<page rotation>]

Where  the  handle  identifies one of the input PDF files, and the beginning and ending page numbers are one-based refer‐
ences to pages in the PDF file, and the qualifier can be even or odd, and the page rotation can be N, S, E, W, L,  R,  or
D.

If the handle is omitted from the page range, then the pages are taken from the first input PDF.

The  even  qualifier  causes  pdftk  to  use only the even-numbered PDF pages, so 1-6even yields pages 2, 4 and 6 in that
order.  6-1even yields pages 6, 4 and 2 in that order.

The odd qualifier works similarly to the even.

The page rotation setting can cause pdftk to rotate pages and documents.  Each option sets the page rotation  as  follows
(in  degrees):  N:  0,  E: 90, S: 180, W: 270, L: -90, R: +90, D: +180. L, R, and D make relative adjustments to a page’s
rotation.

If no arguments are passed to cat, then pdftk combines all input PDFs in the order they were given to create the  output.

NOTES:
* <end page number> may be less than <begin page number>.
* The keyword end may be used to reference the final page of a document instead of a page number.
* Reference a single page by omitting the ending page number.
* The handle may be used alone to represent the entire PDF document, e.g., B1-end is the same as B.

Page Range Examples w/o Handles:
1-endE – rotate entire document 90 degrees
5 11 20
5-25oddW – take odd pages in range, rotate 90 degrees
6-1

Page Range Examples Using Handles:
Say A=in1.pdf B=in2.pdf, then:
A1-21
Bend-1odd
A72
A1-21 Beven A72
AW – rotate entire document 90 degrees
B
A2-30evenL – take the even pages from the range, remove 90 degrees from each page’s rotation
A A
AevenW AoddE
AW BW BD

attach_files <attachment filenames | PROMPT> [to_page <page number | PROMPT>]
Packs  arbitrary  files  into  a  PDF  using PDF’s file attachment features. More than one attachment may be listed after
attach_files. Attachments are added at the document level unless the optional to_page option is given, in which case  the
files are attached to the given page number (the first page is 1, the final page is end). For example:

pdftk in.pdf attach_files table1.html table2.html to_page 6 output out.pdf

unpack_files
Copies  all  of  the attachments from the input PDF into the current folder or to an output directory given after output.
For example:

pdftk report.pdf unpack_files output ~/atts/

or, interactively:

pdftk report.pdf unpack_files output PROMPT

burst  Splits a single, input PDF document into individual pages. Also creates a report named doc_data.txt which is the same  as
the  output  from dump_data.  If the output section is omitted, then PDF pages are named: pg_%04d.pdf, e.g.: pg_0001.pdf,
pg_0002.pdf, etc.  To name these pages yourself, supply a printf-styled format string via the output section.  For  exam‐
ple,  if  you  want  pages  named: page_01.pdf, page_02.pdf, etc., pass output page_%02d.pdf to pdftk.  Encryption can be
applied to the output by appending output options such as owner_pw, e.g.:

pdftk in.pdf burst owner_pw foopass

fill_form <FDF data filename | XFDF data filename | – | PROMPT>
Fills the single input PDF’s form fields with the data from an FDF file, XFDF file or  stdin.  Enter  the  data  filename
after fill_form, or use – to pass the data via stdin, like so:

pdftk form.pdf fill_form data.fdf output form.filled.pdf

After  filling  a  form, the form fields remain interactive unless you also use the flatten output option. flatten merges
the form fields with the PDF pages. You can use flatten alone, too, but only on a single PDF:

pdftk form.pdf fill_form data.fdf output out.pdf flatten

or:

pdftk form.filled.pdf output out.pdf flatten

If the input FDF file includes Rich Text formatted data in addition to plain text, then the Rich Text data is packed into
the form fields as well as the plain text.  Pdftk also sets a flag that cues Acrobat/Reader to generate new field appear‐
ances based on the Rich Text data.  That way, when the user opens the PDF, the viewer will create the Rich Text fields on
the  spot.   If the user’s PDF viewer does not support Rich Text, then the user will see the plain text data instead.  If
you flatten this form before Acrobat has a chance to create (and save) new field appearances, then the plain  text  field
data is what you’ll see.

background <background PDF filename | – | PROMPT>
Applies  a  PDF  watermark  to the background of a single input PDF.  Pass the background PDF’s filename after background
like so:

pdftk in.pdf background back.pdf output out.pdf

Pdftk uses only the first page from the background PDF and applies it to every page of  the  input  PDF.   This  page  is
scaled and rotated as needed to fit the input page.  You can use – to pass a background PDF into pdftk via stdin.

If  the input PDF does not have a transparent background (such as a PDF created from page scans) then the resulting back‐
ground won’t be visible — use the stamp feature instead.

stamp <stamp PDF filename | – | PROMPT>
This behaves just like the background feature except it overlays the stamp PDF page on top of the  input  PDF  document’s
pages.  This works best if the stamp PDF page has a transparent background.

dump_data
Reads  a  single, input PDF file and reports various statistics, metadata, bookmarks (a/k/a outlines), and page labels to
the given output filename or (if no output is given) to stdout.  Does not create a new PDF.

dump_data_fields
Reads a single, input PDF file and reports form field statistics to the given output filename or (if no output is  given)
to stdout.  Does not create a new PDF.

generate_fdf
Reads  a single, input PDF file and generates a FDF file suitable for fill_form out of it to the given output filename or
(if no output is given) to stdout.  Does not create a new PDF.

update_info <info data filename | – | PROMPT>
Changes the metadata stored in a single PDF’s Info dictionary to match the input data file. The input data file uses  the
same  syntax  as  the  output from dump_data. This does not change the metadata stored in the PDF’s XMP stream, if it has
one. For example:

pdftk in.pdf update_info in.info output out.pdf

[output <output filename | - | PROMPT>]
The output PDF filename may not be set to the name of an input filename.  Use  -  to  output  to  stdout.   When  using  the
dump_data  operation,  use output to set the name of the output data file. When using the unpack_files operation, use output
to set the name of an output directory.  When using the burst operation, you can use output to  control  the  resulting  PDF
page filenames (described above).

[encrypt_40bit | encrypt_128bit]
If an output PDF user or owner password is given, output PDF encryption strength defaults to 128 bits.  This can be overrid‐
den by specifying encrypt_40bit.

[allow <permissions>]
Permissions are applied to the output PDF only if an encryption strength is specified or an owner or user password is given.
If permissions are not specified, they default to ’none,’ which means all of the following features are disabled.

The permissions section may include one or more of the following features:

Printing
Top Quality Printing

DegradedPrinting
Lower Quality Printing

ModifyContents
Also allows Assembly

Assembly

CopyContents
Also allows ScreenReaders

ScreenReaders

ModifyAnnotations
Also allows FillIn

FillIn

AllFeatures
Allows the user to perform all of the above, and top quality printing.

[owner_pw <owner password | PROMPT>]

[user_pw <user password | PROMPT>]
If  an  encryption  strength  is  given but no passwords are supplied, then the owner and user passwords remain empty, which
means that the resulting PDF may be opened and its security parameters altered by anybody.

[compress | uncompress]
These are only useful when you want to edit PDF code in a text editor like vim or emacs.  Remove PDF page stream compression
by applying the uncompress filter. Use the compress filter to restore compression.

[flatten]
Use  this  option  to merge an input PDF’s interactive form fields (and their data) with the PDF’s pages. Only one input PDF
may be given. Sometimes used with the fill_form operation.

[keep_first_id | keep_final_id]
When combining pages from multiple PDFs, use one of these options to copy the document ID from either  the  first  or  final
input  document  into the new output PDF. Otherwise pdftk creates a new document ID for the output PDF. When no operation is
given, pdftk always uses the ID from the (single) input PDF.

[drop_xfa]
If your input PDF is a form created using Acrobat 7 or Adobe Designer, then it probably has XFA data.  Filling such  a  form
using  pdftk  yields  a PDF with data that fails to display in Acrobat 7 (and 6?).  The workaround solution is to remove the
form’s XFA data, either before you fill the form using pdftk or at the time you fill the  form.  Using  this  option  causes
pdftk to omit the XFA data from the output PDF form.

This  option  is  only  useful  when  running pdftk on a single input PDF.  When assembling a PDF from multiple inputs using
pdftk, any XFA data in the input is automatically omitted.

[verbose]
By default, pdftk runs quietly. Append verbose to the end and it will speak up.

[dont_ask | do_ask]
Depending on the compile-time settings (see ASK_ABOUT_WARNINGS), pdftk might prompt you for further input when it encounters
a  problem, such as a bad password. Override this default behavior by adding dont_ask (so pdftk won’t ask you what to do) or
do_ask (so pdftk will ask you what to do).

When running in dont_ask mode, pdftk will over-write files with its output without notice.

EXAMPLES
Decrypt a PDF
pdftk secured.pdf input_pw foopass output unsecured.pdf

Encrypt a PDF using 128-bit strength (the default), withhold all permissions (the default)
pdftk 1.pdf output 1.128.pdf owner_pw foopass

Same as above, except password ’baz’ must also be used to open output PDF
pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz

Same as above, except printing is allowed (once the PDF is open)
pdftk 1.pdf output 1.128.pdf owner_pw foo user_pw baz allow printing

Join in1.pdf and in2.pdf into a new PDF, out1.pdf
pdftk in1.pdf in2.pdf cat output out1.pdf
or (using handles):
pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf
or (using wildcards):
pdftk *.pdf cat output combined.pdf

Remove ’page 13’ from in1.pdf to create out1.pdf
pdftk in.pdf cat 1-12 14-end output out1.pdf
or:
pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf

Apply 40-bit encryption to output, revoking all permissions (the default). Set the owner PW to ’foopass’.
pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopass

Join two files, one of which requires the password ’foopass’. The output is not encrypted.
pdftk A=secured.pdf 2.pdf input_pw A=foopass cat output 3.pdf

Uncompress PDF page streams for editing the PDF in a text editor (e.g., vim, emacs)
pdftk doc.pdf output doc.unc.pdf uncompress

Repair a PDF’s corrupted XREF table and stream lengths, if possible
pdftk broken.pdf output fixed.pdf

Burst a single PDF document into pages and dump its data to doc_data.txt
pdftk in.pdf burst

Burst a single PDF document into encrypted pages. Allow low-quality printing
pdftk in.pdf burst owner_pw foopass allow DegradedPrinting

Write a report on PDF document metadata and bookmarks to report.txt
pdftk in.pdf dump_data output report.txt

Rotate the first PDF page to 90 degrees clockwise
pdftk in.pdf cat 1E 2-end output out.pdf

Rotate an entire PDF document to 180 degrees
pdftk in.pdf cat 1-endS output out.pdf

NOTES
pdftk uses a slightly modified iText Java library (http://itextpdf.sourceforge.net/) to read and write  PDF.  The  author  compiled
this Java library using GCJ (http://gcc.gnu.org) so it could be linked with a front end written in C++.

The pdftk home page is http://www.accesspdf.com/pdftk/.

AUTHOR
Sid Steward (ssteward@accesspdf.com) maintains pdftk.

September 18, 2006                                                    PDFTK(1)

Comments, questions, and suggestions are always welcome as long as they’re calm and ruly :)

Further References

>>linux.com reference article

>>Main site for pdftk (including manual/documentation), a bit dated though

>> GUI for pdftk

Mothers

March 4, 2009 by f241vc15

Mother, you bid to bathe me with boon, and still you do

Try, for you feel it’s your responsibility to.

You’ve sacrificed, and supplied me with sustenance

There was a time, I remember, when our parlance

Were very much attuned to each other’s ideas and thoughts

But then I studied and grew, and I think you see it was not for nought.

*

Mother, you never really showered us such spirituality as

Father did; he would try to preach the Bible from start till last.

Yet still you required religious reverence, relished it if you will

You believed in heaven and hell, Adam and Eve, and of course good and evil

As a child, I believed those, and I still remember believing them too

I was a victim of it all, indoctrination, and I think so were you

*

Mother of my mother, I’ve no doubt you’ve assiduously applied all

Your talent and time to transform this future mother’s mind into a thrall

Do I then blame you for bequeathing this bane? This irrational virus of the mind?

Perhaps so, but you are just a victim as well, in a long chain left behind

By forebears who were perhaps too quick to believe and be converted

From a father and a mother to their sons and daughters, the passing of the virus repeated.

*

Mother of my mother, father of my mother, and many of our ancestors

They took pleasure, and so do you I believe, from knowing your errors

Your actions, your thoughts, somebody is watching; Pretty silly if you think about it for a moment

That you take as a rule, Bronze age ideology, instead of actual discernment

Of how things really work, science showing the systematic silk-road to awareness, to evidence

Which luckily, some of our ancestors started, instead of balking in gods and their supposed omniscience

*

Motherland, you’ve spuriously spawned spirit satiated sapiens since stone ages

People who cling to quick reaffirmations, even if evidence says the erroneous explanation engages

Not man’s faculty of reason, but his irrationality and will to believe

And if it be so, would it not be possible then, that any lesser man contrive and conceive

Any ludicrous and fanciful mythology, unto his own machinations and whims?

“Of course!” That’s the answer. As Dawkins puts it, those inventions pass on as memes.

*

Motherland, how long will ‘heathens’ like me, unto which science and skepticism prevails,

Be beset by bothersome brigands banding together, to remove me from freethinking land from where I hail?

The time of rationality, of science, of constructive skepticism, of evidence seeking, should fill the 21st century

Yet the century is still plagued by, unfortunately, blind and unyielding irrationality

If what religion means is to be awed by our fleeting lives in the vast cosmos, then I’m a religious man

But I would not immediately jump blindly by mere faith, and always reason out if I can.

Shakespeare and programming

December 10, 2008 by f241vc15

A great playwright and poet once wrote in his play Hamlet (and that great poet and playwright of course is none other than Shakespeare)  the following question from act three, scene one:

To be or not to be, that is the question;

Putting it into a more geeky format I have the following translation:

2B OR NOT 2B

Which sort of turns the question into a logical statement. Tidying it up a little further and noting the unary and binary operators in the statement, as well as the operator precedence, and further clarifying its (geeky) nature I have:

0×2B OR (NOT 0×2B)

And so I arrive at an answer to the question in Hamlet’s soliloquy:

0×2B OR (NOT 0×2B) = 0xFF

The answer turns out to be pretty simple and not so philosophical and deep! :D If you don’t know why my answer to the famous question is 0xFF, keep on guessing! :D

(I’m feeling geekier than usual tonight, so there you go)

There Is No God (And You Know It)

November 14, 2008 by f241vc15

This is an article written by Sam Harris some time ago. I just reposted it here with permission from machineslikeus.com (thanks Norm). I reposted it in my web blog because it’s just light reading (i.e. no deep and highfalutin words), but it still delivers a very intense and profound idea: There is no God and you know it. Read it and find out why, and then perhaps leave a message why you agree/disagree.

There is No God (And You Know It)

by Sam Harris


Somewhere in the world a man has abducted a little girl. Soon he will rape, torture, and kill her. If an atrocity of this kind not occurring at precisely this moment, it will happen in a few hours, or days at most. Such is the confidence we can draw from the statistical laws that govern the lives of six billion human beings. The same statistics also suggest that this girl’s parents believe – at this very moment – that an all-powerful and all-loving God is watching over them and their family. Are they right to believe this? Is it good that they believe this?

No.

The entirety of atheism is contained in this response. Atheism is not a philosophy; it is not even a view of the world; it is simply a refusal to deny the obvious. Unfortunately, we live in a world in which the obvious is overlooked as a matter of principle. The obvious must be observed and re-observed and argued for. This is a thankless job. It carries with it an aura of petulance and insensitivity. It is, moreover, a job that the atheist does not want.

It is worth noting that no one ever need identify himself as a non-astrologer or a non-alchemist. Consequently, we do not have words for people who deny the validity of these pseudo-disciplines. Likewise, “atheism” is a term that should not even exist. Atheism is nothing more than the noises reasonable people make when in the presence of religious dogma. The atheist is merely a person who believes that the 260 million Americans (eighty-seven percent of the population) who claim to “never doubt the existence of God” should be obliged to present evidence for his existence – and, indeed, for his benevolence, given the relentless destruction of innocent human beings we witness in the world each day. Only the atheist appreciates just how uncanny our situation is: most of us believe in a God that is every bit as specious as the gods of Mount Olympus; no person, whatever his or her qualifications, can seek public office in the United States without pretending to be certain that such a God exists; and much of what passes for public policy in our country conforms to religious taboos and superstitions appropriate to a medieval theocracy. Our circumstance is abject, indefensible, and terrifying. It would be hilarious if the stakes were not so high.

Consider: the city of New Orleans was recently destroyed by hurricane Katrina. At least a thousand people died, tens of thousands lost all their earthly possessions, and over a million have been displaced. It is safe to say that almost every person living in New Orleans at the moment Katrina struck believed in an omnipotent, omniscient, and compassionate God. But what was God doing while a hurricane laid waste to their city? Surely He heard the prayers of those elderly men and women who fled the rising waters for the safety of their attics, only to be slowly drowned there. These were people of faith. These were good men and women who had prayed throughout their lives. Only the atheist has the courage to admit the obvious: these poor people spent their lives in the company of an imaginary friend.

Of course, there had been ample warning that a storm “of biblical proportions” would strike New Orleans, and the human response to the ensuing disaster was tragically inept. But it was inept only by the light of science. Advance warning of Katrina’s path was wrested from mute Nature by meteorological calculations and satellite imagery. God told no one of his plans. Had the residents of New Orleans been content to rely on the beneficence of the Lord, they wouldn’t have known that a killer hurricane was bearing down upon them until they felt the first gusts of wind on their faces. And yet, a poll conducted by The Washington Post found that eighty percent of Katrina’s survivors claim that the event has only strengthened their faith in God.

As hurricane Katrina was devouring New Orleans, nearly a thousand Shiite pilgrims were trampled to death on a bridge in Iraq. There can be no doubt that these pilgrims believed mightily in the God of the Koran. Indeed, their lives were organized around the indisputable fact of his existence: their women walked veiled before him; their men regularly murdered one another over rival interpretations of his word. It would be remarkable if a single survivor of this tragedy lost his faith. More likely, the survivors imagine that they were spared through God’s grace.

Only the atheist recognizes the boundless narcissism and self-deceit of the saved. Only the atheist realizes how morally objectionable it is for survivors of a catastrophe to believe themselves spared by a loving God, while this same God drowned infants in their cribs. Because he refuses to cloak the reality of the world’s suffering in a cloying fantasy of eternal life, the atheist feels in his bones just how precious life is – and, indeed, how unfortunate it is that millions of human beings suffer the most harrowing abridgements of their happiness for no good reason at all.

Of course, people of faith regularly assure one another that God is not responsible for human suffering. But how else can we understand the claim that God is both omniscient and omnipotent? There is no other way, and it is time for sane human beings to own up to this. This is the age-old problem of theodicy, of course, and we should consider it solved. If God exists, either He can do nothing to stop the most egregious calamities, or He does not care to. God, therefore, is either impotent or evil. Pious readers will now execute the following pirouette: God cannot be judged by merely human standards of morality. But, of course, human standards of morality are precisely what the faithful use to establish God’s goodness in the first place. And any God who could concern himself with something as trivial as gay marriage, or the name by which he is addressed in prayer, is not as inscrutable as all that. If He exists, the God of Abraham is not merely unworthy of the immensity of creation; he is unworthy even of man.

There is another possibility, of course, and it is both the most reasonable and least odious: the biblical God is a fiction. As Richard Dawkins has observed, we are all atheists with respect to Zeus and Thor. Only the atheist has realized that the biblical god is no different. Consequently, only the atheist is compassionate enough to take the profundity of the world’s suffering at face value. It is terrible that we all die and lose everything we love; it is doubly terrible that so many human beings suffer needlessly while alive. That so much of this suffering can be directly attributed to religion – to religious hatreds, religious wars, religious delusions, and religious diversions of scarce resources – is what makes atheism a moral and intellectual necessity. It is a necessity, however, that places the atheist at the margins of society. The atheist, by merely being in touch with reality, appears shamefully out of touch with the fantasy life of his neighbors.

Originally posted here.

Also, click here for Sam Harris’ official website.