pdfMergeOddEven: merging PDF files with Odd and Even pagesSaturday, February 6. 2010
Often I have to digitize document printed on double-sided paper. Unfortunately the scanner / copier automatic feeder I have can only read single side document. So in this case, I have to scan the odd pages first as PDF, then scan the even pages as PDF. Then comes the problem on how to combine them. So here's the solution: pdfMergeOddEven.
pdfMergeOddEven is a simple python script takes two input: the odd pages file and the even pages file, and output a file which is the result of merging the two input files with the odd pages taken from the first input, and even pages taken from the second input. On command-line, it simply takes the three files as argument: pdfMergeOddEven.py oddFile.pdf evenFile.pdf output.pdf pdfMergeOddEven is actually just a simple python script that uses the wonderful python library PyPdf to do PDF manipulation. You can download pdfMergeOddEven here.
Posted by Reuben Budiardja
in hacking, linux, software, tech
at
09:23
| Comment (1)
| Trackbacks (0)
Bug: "Save As" Dialog Box Should Not Start with /tmp by DefaultWednesday, October 29. 2008
Here's a scenario that just happened to my wife that should not. This is on Fedora 8 with KDE.
I know all the arguments blaming the user. As a technical person, regrettably that was my first reaction also. On second thought, for regular user, who can tell what /tmp is ? Regular user does not know that /tmp are cleaned every reboot. Furthermore, in a hurry, if one just want to save quickly so that it can be used the next time computer boots up, it's understandable that user makes the mistake to save the document to whatever default directory is presented by the dialog box, thinking that she can always re-open it from "Recent Document" menu. This is not limited to Kmail or Openoffice, I just tried and it's the same with KPDF, Kghostview, etc. Firefox opening files in application also has similar problem. What should be the general solutions for this ? Should this be the responsibility of the desktop environment project (ie. KDE, GNOME) from their "Save As" dialog rather than each individual apps ? I'm thinking of filling a bug report but then I'm not sure whom I should file this with. I can think of some hacky band-aid solution to prevent document loss next time like a rotating backup of /tmp for the next two reboot or edit the boot up script to not delete /tmp, etc, but none of those is a good enough general solution. Maybe it should be sometime like:
Do you have any thoughts ? Update: A quick Google search yields that this is a general known problem that a lot of people has complained about. Unfortunately there is still no good once-for-all solution. Here are some references: http://www.murrayc.com/blog/permalink/2006/10/31/tmp-does-not-belong-in-file-save-dialogs/ https://bugs.launchpad.net/openoffice/+bug/39854 http://www.kieransenior.co.uk/journal/2008/04/16/openoffice-writer-error-writing-file/ https://lists.ubuntu.com/archives/ubuntu-mozillateam-bugs/2007-August/020413.html Using Private Proxy for Better Web-Browsing SecuritySunday, December 9. 2007
Sometimes we are using a publicly available Wifi hot spots and would like a better privacy when browsing the internet. Although our credit-card or bank account website are probably using secure connection, other websites are not and we simply would like to have more privacy. One way to do it is by setting up your own proxy server and using it as a private proxy.
However using our own proxy server still does not increase the privacy / security of our connection over the exposed wireless link, unless we use encryption. Encryption in this case is easily accomplished by using SSH tunneling. The benefits of this is two prongs. First, we have SSL level encryption, second, we keep our proxy server private by off-loading the authentication burden to the SSH server. In this entry I explain how to do it. I assume that we are using a fairly modern linux distribution for our web proxy and SSH server. I also assume that we have SSH access to our machine set up securely. Most major linux distribution include Apache 2 web server and its proxy module in the distribution. It's better to use that than compiling Apache yourself, unless you know what you are doing. Assuming all that, then it is really easy to set up our proxy server. First, we need to enable the web server to be a proxy server. The relevant configuration in httpd.conffile is as follow LoadModule proxy_module modules/mod_proxy.so 127.0.0.1, which is localhost. This is how we keep your proxy server private, i.e. not an open proxy. Now to use our proxy server from a different machine, -- let's call this is the laptop with wireless access --, we first have to connect to the server via SSH tunneling. This is both the encryption and authentication part. The simple proxy server cannot authenticate us, and hence only allows connection from 127.0.0.1. The authentication part comes from the fact that we have to connect via SSH first to the proxy machine before we can use the proxy forwarding. To have SSH tunnel, simply do $> ssh -L 3000:localhost:80 myproxyserver.myisp.net This means, port 3000 in my laptop actually listen to port 80 on the proxy server via SSH tunneling, i.e. it is an encrypted tunnel. The port 3000 is random. We can use any port number that is unused in the laptop. Port 80 is the port where the web server binds to in the proxy server machine (of course one can set up the Apache to binds to different port in httpd.conf). Now that we have tunneling set up to our proxy server, all we need to do is to configure web browser to use this. This differs slightly for different web browsers, but as an example, in Firefox 2, this is done via Preference --> General tab --> Connection Settings. Here we set Pick "Manual Proxy Configuration:" Now we can start browsing securely via this SSL encrypted tunnel to our proxy server. If we check the web server log in our proxy server machine, we should see that our request from the laptop's web browser is being forwarded by the proxy server. Also noticed that from the web server point of view, our request comes from 127.0.0.1.
Posted by Reuben Budiardja
in linux, sysadmin, tech, tips and tricks
at
17:49
| Comments (0)
| Trackbacks (0)
(Page 1 of 1, totaling 3 entries)
Competition entry by David Cummins powered by Serendipity v1.0 |
About Me![]() This is my personal blog, a subset of my personal website. I am a graduate student in Computational Astrophysics, currently working on my dissertation for my doctoral degree. I am a computer hobbyist, mainly with interest in Linux and open source software. I am also interested in the subject of science and religion, especially from Christianity / Mennonite point of view. On my leisure, I play music, read, or just enjoying time with my wife. CategoriesBookmark
Show tagged entriesQuicksearchSyndicate This BlogBlog Administration |