Search This Blog

Sunday, December 07, 2014

first birth day of Hamsini

Today, my daughter, Hamsini, successfully completed her first trip around the Sun. Many many happy returns of the day, Kushi!

It has been an awesome year with great memories. She is growing up so fast, ever curious and all smiles, busy learning new tricks, playing with her friends and toys, watching ads in the TV, listening to rhymes, helping mom in the kitchen (:-))

I can never forget how she lights up when I come back from work, how excited she is to go out, how she wants to play pick-a-boo with her mom while I am holding her in my arms. Just the other day she started walking, decided that crawling is not really her game and is now running merrily around.

Raising an infant is hard, especially in the US, because it is just the two of us who have to take care of everything. But thanks to the dear wife, I had all the fun while she did all the hard work. So, thanks and congratulations, Prasanthi!

Sunday, June 08, 2014

Setting up Canon Pixma MX870 printer on Debian Jessie

Here are the steps I followed to set up my printer (Canon Pixma MX870) on a machine running Debian Jessie.

Setup details:
My printer is connected wirelessly to the router which in turn is connected to the internet. The desktop machine running Debian Jessie is connected to the same router via ethernet cable.

1) Find out the IP address of the printer.

root@hogwarts:~# arp-scan --interface=eth1 --localnet
Interface: eth1, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.0.1    20:e5:64:57:f1:12    (Unknown)
192.168.0.4    e8:99:c4:4c:d0:26    (Unknown)
192.168.0.8    00:1e:8f:97:25:3d    CANON INC.

3 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 256 hosts scanned in 1.380 seconds (185.51 hosts/sec). 3 responded


This shows that the printer's IP address is 192.168.0.8

2)  Install and start the cups service
apt-get update
apt-get install cups
/etc/init.d/cups start
I have the following packages installed but it is possible that not all of them are necessary.
root@hogwarts:~# dpkg -l cups\* | grep ^ii
ii  cups                      1.7.1-12     amd64        Common UNIX Printing System(tm) - PPD/driver support, web interface
ii  cups-bsd                  1.7.1-12     amd64        Common UNIX Printing System(tm) - BSD commands
ii  cups-client               1.7.1-12     amd64        Common UNIX Printing System(tm) - client programs (SysV)
ii  cups-common               1.7.1-12     all          Common UNIX Printing System(tm) - common files
ii  cups-core-drivers         1.7.1-12     amd64        Common UNIX Printing System(tm) - PPD-less printing
ii  cups-daemon               1.7.1-12     amd64        Common UNIX Printing System(tm) - daemon
ii  cups-filters              1.0.50-1     amd64        OpenPrinting CUPS Filters - Main Package
ii  cups-filters-core-drivers 1.0.50-1     amd64        OpenPrinting CUPS Filters - PPD-less printing
ii  cups-pdf                  2.6.1-9      amd64        PDF writer backend for CUPS
ii  cups-pk-helper            0.2.5-2      amd64        PolicyKit helper to configure cups with fine-grained privileges
ii  cups-ppdc                 1.7.1-12     amd64        Common UNIX Printing System(tm) - PPD manipulation utilities
ii  cups-server-common        1.7.1-12     all          Common UNIX Printing System(tm) - server common files
3) Add the printer
Add a user to the lpadmin group. For example, this is what I have
rajulocal@hogwarts:~$ id
uid=1000(rajulocal) gid=1000(rajulocal) groups=1000(rajulocal),24(cdrom),25(floppy),
29(audio),30(dip),44(video),46(plugdev),104(scanner),107(bluetooth),
109(netdev),122(lpadmin)
Go to http://localhost:631/ in your local browser.
Click on "Adding Printers and Classes"
Click on "Add Printer"
For some reason, "Find New Printers" did not detect the printer. 
So I used "Add Printer" to add the printer manually.
If prompted, provide the user login and password details of 
the account which you added to the lpadmin group.
In "Other Network Printers" section, select "LPD/LPR Host or Printer" and click continue
In the connection field, enter
lpd://192.168.0.8/queue
and hit continue. Replace 192.168.0.8 with your printer's IP address.
In the next screen, provide a Name, Description and Location for the printer and hit continue. I have
Name: CanonPixmaMX870
Description: Canon Pixma MX870 Color Printer with Duplexer, scanner, fax
Location: Home
In the next screen, choose
Make = Canon
hit continue
Model = Canon PIXMA MX870 - Cups+Gutenprint v5.2.9 (en)
click "Add Printer"
In the next screen, I have set 2-Sided Printing = Long Edge (Standard) and left all other options as-is. Click "Set Default Options" when finished.

4) Test the printer setup
Print a test file using lpr.
rajulocal@hogwarts:~/x$ lpr -P CanonPixmaMX870 santhi.txt
Useful links:
  • https://wiki.debian.org/SystemPrinting
  • http://www.usa.canon.com/cusa/support/consumer/printers_multifunction/pixma_mx_series/pixma_mx870#DriversAndSoftware
  • https://lists.debian.org/debian-user/2014/06/msg00318.html

Friday, April 25, 2014

digital copy for passport size photos in New York City

You can get passport size photos (in both print and digital form) for US and Canadian visas at
 
Duane Reade
1251 Avenue Of The Americas
New York, NY 10020

Ph: (212) 391-1105
 
between 49th St & 50th St + 6th ave
located underground near the subway train station

They give both paper copies and digital copy. Service is great.

I was charged $29.91 (including tax) to get 2 prints of US passport photos + 2 prints of Canada passport photos + digital copy of the images written on a CD.

Monday, March 17, 2014

book read by Anton Roth in NBC crisis show

Yesterday (2014-03-16), I watched this show called crisis on NBC ( http://en.wikipedia.org/wiki/Crisis_(TV_series) ) . In that the kid who played Anton Roth reads a book titled "Passage to Perseid". Has anyone ever heard of this book? I searched in google, amazon but could not find it anywhere. Here is a screenshot of what I am talking about


Tuesday, January 14, 2014

perl one liner to print quotes around each line

Consider the sample input file
rajulocal@hogwarts:~/x$ cat input.txt 
1.1,k
2.2,ka
3.3,kam
4.4,kama
5.5,kamar
6.6,kamara
7.7,kamaraj
8.8,kamaraju
To put quotes around each line, use the following Perl one liner
rajulocal@hogwarts:~/x$ perl -lane '$sq="\047"; print "$sq$_$sq";' input.txt 
'1.1,k'
'2.2,ka'
'3.3,kam'
'4.4,kama'
'5.5,kamar'
'6.6,kamara'
'7.7,kamaraj'
'8.8,kamaraju'
Here we are using octal code of single quote. To put quotes around just one column, use
rajulocal@hogwarts:~/x$ perl -F',' -lane '$sq="\047"; print "$F[0],$sq$F[1]$sq";' input.txt 
1.1,'k'
2.2,'ka'
3.3,'kam'
4.4,'kama'
5.5,'kamar'
6.6,'kamara'
7.7,'kamaraj'
8.8,'kamaraju'

Related posts: awk remove quotes in a column

Followers