arauzo is currently certified at Journeyer level.

Name: Antonio Arauzo Azofra
Member since: 2004-01-23 11:12:39
Last Login: 2011-05-29 17:31:33

FOAF RDF Share This

Homepage: http://ax5.com/antonio/

Recent blog entries by arauzo

Syndication: RSS 2.0
28 Jul 2006 (updated 28 Jul 2006 at 13:25 UTC) »
How to print a PDF user manual in an appropriate size

Usually the user manual of the tech gadgets we buy comes on a CD in PDF format. Sometimes there is also a printed copy included. This was my case, but it came in the wrong language. If I wanted the spanish manual, I would have needed to return the camera and wait longer to have it again. So that was not an acceptable option. I have tried to understand portuguese, but unsuccessfull. I have tried without the manual and it was ok for standard features, but... ok, let's print the manual.

The size of the manual is such that four pages fit well on an a4 paper. I have used:

pdf2ps Manual.pdf
psselect -p3-185 Manual.ps sel.ps 
psbook sel.ps | pstops 8:0,1,4,5,2,3,6,7 | psnup -4 -pa4 -b-5cm >out.ps

  1. First line converts it to postscript.

  2. Second line removes some problematic unusefull pages.

  3. Third line:
    • psbook arranges pages to be folded when printed two on each side of paper.

    • pstops arranges pages to have 4 on each side (cutted on the middle and folded each pair.

    • psnup effectively puts 4 pages on each final a4 page with '-b-5cm' used to remove the excesive individual margins of original pages.

More advanced info on making impositions with pstops.

Babel package makes latex indent first paragraph

Latex standard styles, like article or book, do not indent first paragraph, but babel package change this behaviour. For example, it indents all paragraphs when using spanish, even those after a heading.

If you want the first paragraph not being indented, you can comment out these two lines at your language file:

/usr/share/texmf/tex/generic/babel/spanish.ldf
...
%  \let\@afterindentfalse\@afterindenttrue
%  \@afterindenttrue

Of course, you can always manually remove indent starting any paragraph with '\noindent', or disable all paragraph indentation with '\parindent=0cm'.

24 Jul 2006 (updated 19 Jul 2008 at 23:37 UTC) »
Have you ever created thousands of files in /tmp?

We have created up to 2 million files:


arauzo@brain:/tmp $ ls | wc
2099630 2099630 43839565

It was by mistake. You know, that commented line that did not get uncommented, when it should have. I'm starting to think I do very strange things, and they are becomming very strong stress test for Linux.

Anyway, it is not so simple to delete a big bunch of files. The first you probably think of is:


arauzo@neuron2:/tmp$ rm *.net
-bash: /bin/rm: Argument list too long

Yes, I know it is long, but I NEED to remove those files. Let's try another thing:


arauzo@neuron2:/tmp$ for f in *.net; do rm -f $f; done
removed `mlp85_57_24-NI6MxY.net'
removed `mlp85_57_24-NbyBLS.net'
removed `mlp85_57_24-Nc7WVw.net'
...

Nice! This works for thousands of files. But now, what happends with our 2 million files?:


arauzo@brain:/tmp $ rm *.net
Connection to brain closed.
...
arauzo@brain:/tmp $ for f in *.net; do rm -f $f; done
Connection to brain closed.

It crashes! :-( Looks like a 'bug' on bash... :-?

Finally, we have managed to remove the 2 million files in groups by their prefix 32*.net 33*.net 34*.net ...

PD. A more intelligent solution (as it does not need to store the list of files anywhere), suggested by wtanaka and redi:


find /tmp -name "*.net" -print0 | xargs -0 rm -f

Can be 'simplyfied' to:


find -name "*.net" -exec rm -f \{\} \;

PD2. The simplification has an overhead of creating one process per file, while xargs creates a process for a group of files.

How to print short-edge duplex when short-edge duplex does not work in your printer

  1. Everything you print in Linux use to get the form of a postscript document. Just use "print to file" in your application, or pdf2ps and get your file.ps.

  2. Then you can convert your file.ps to another .ps with even pages turned upside-down with this command (using a4 paper, change size to fit your paper):

     pstops "2:0,1U(21cm,29.7cm)" file.ps >fileTurned.ps 

  3. You can see the results with ggv or print it with lp, xpp...
10 May 2006 (updated 10 May 2006 at 17:23 UTC) »

I do not have a blog in spanish, so I write this here though probably it is not interesting to those who do not read spanish.

On this Sunday, 14th of May there is an email convocated demostration on all mayor cities of Spain to ask for decent homes. Against the real estate bubble.

It is time to think, what we are asking for in these demos. I think we should ask for more fiscal help on taxes to those who buy a house to live in.

16 older entries...

 

arauzo certified others as follows:

  • arauzo certified arauzo as Apprentice
  • arauzo certified lgs as Master
  • arauzo certified arturogf as Journeyer
  • arauzo certified redi as Journeyer
  • arauzo certified wtanaka as Apprentice

Others have certified arauzo as follows:

  • arauzo certified arauzo as Apprentice
  • lgs certified arauzo as Apprentice
  • daverd certified arauzo as Apprentice
  • arturogf certified arauzo as Apprentice
  • Chicago certified arauzo as Journeyer
  • badvogato certified arauzo as Journeyer

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page