Enable web interface to manage printer settings in MacOS Sierra

I use a HP 915 All-in-One Inkjet printer. I like it because of the fact that buying a new cartridge costs almost same as the refilled cartridge. As a result, I always buy a new cartridge when the current ones run out of ink, minus the feeling of being taken for ride by the Printer companies (read: Why Is Printer Ink So Expensive? and All printer ink is more expensive than gold]

The printer settings dialog that can be opened via System Preferences -> Printers and Scanners -> Choose your printer in the list -> Options and Supplies is extremely simplified. This is good for a regular Mac user. But if you need to customize the print output, say, you would like to change the default presets, there is no way to achieve it via the Options and Supplies dialog. This is where enabling the web interface to manage printer settings comes into play.

Mac uses CUPS which is an acronym for Common Unix Printing System. In simpler terms, it’s the network printing service used by Mac. Ideally, it is utilized to setup and configure printers that are connected to the network. In our case, we will use it to configure the printer connected locally to our Mac.

Step 1: Open the terminal and enter the below command.

cupsctl WebInterface=yes

The above command may fail if you are not the root user. In that case, try executing:

sudo cupsctl WebInterface=yes

If you come across an error message that reads, cupsctl: Internal Server Error, you would have to follow the alternative method of enabling WebInterface as described in the Apple Support Forum, here: https://discussions.apple.com/thread/6485634?tstart=0. As listed on the support forum, the alternative is to edit cupsd.conf file located within the /private/../cups folder using a text editor and updating the line that starts with WebInterface no as WebInterface yes (if its not already yes).

Step 2: Open http://localhost:631/printers/ in your browser. You should be able to see the list of printers connected to your machine.

Step 3: After you have updated your printer settings, you can consider disabling the interface by executing:

cupsctl WebInterface=yes
# Or, sudo cupsctl WebInterface=yes

or, updating the cupsd.conf by replacing WebInterface yes as WebInterface no within it.


References:

Advertisements

Spotlight does not list newly installed applications on macOS Sierra

I decided to try the IntelliJ IDEA editor (https://www.jetbrains.com/idea/download/). After installing the editor, I realized that Spotlight did not list it even after several days.

While searching for a solution, it came to my notice that this is a common problem and can be fixed easily. There were several solutions listed on the Internet. The one that worked for me was to open System Preferences -> Spotlight -> Privacy  and add the volume Macintosh HD to the exclude list (volumes / directories that Spotlight will not index for search) and remove it immediately. This solution was listed in one of the threads related to Spotlight at the Apple Support Communities portal (https://discussions.apple.com/thread/2697313?tstart=0).

There were several other solutions that I did not try but found one of them worth mentioning:

Enable display of hidden files and folders in Mac

This article is note to myself. It lists the command to be executed to show hidden files and folder in Mac. As a practice, the names of the Hidden files and folders are prefixed with a period.

Step 1: Open the Terminal – type Cmd + Space followed by terminal in the search box and press return.

Step 2: Within the terminal window, enter the following command and press return.

defaults write com.apple.finder AppleShowAllFiles YES

If you would like to hide hiddens files and folders, type:

defaults write com.apple.finder AppleShowAllFiles NO

Step 3: Relaunch the Finder.

  • Hold the Option + Control keys and click on the Finder icon on the Dock.
  • Select Relaunch in the menu.

Find the version of the Linux distribution installed in your system

This post is a note to myself since I have come across the need of verifying the version of the Linux distribution installed on my system several times till date.

Method 1:

The standard technique I have been using till date to check the version of the Linux OS installed on my system was to execute: cat /etc/issue.

If you are using a customized version of the Linux based OS, the file, /etc/issue will probably display a custom message based on the OS distribution.

Method 2:

If you know that the Linux OS installed in your system is a variant of RHEL or Fedora, say CentOS, the command, cat /etc/redhat-release will provide the human readable release name of the installed OS followed by the version and the code name of the release.

If you are using other variants of the Linux OS, there is a high probability that the execution of the command, cat /etc/*-release may provide you with the necessary details.

Method 3:

If you are using a recent version of Linux distribution, the command: lsb_release -i -r will display the Distribution name (-i) and the Release number (-r).

On a side-note, if you are just looking for the version of the kernel and gcc that were used to build the release: cat /proc/version will provide the details.


References:
1. http://serverfault.com/questions/89654/what-version-of-rhel-am-i-using
2. http://serverfault.com/questions/188037/how-do-i-determine-what-version-of-red-hat-enterprise-linux-my-server-is-running
3. http://www.cyberciti.biz/faq/find-linux-distribution-name-version-number/
4. http://unix.stackexchange.com/questions/124667/how-to-know-which-linux-and-which-version-i-am-using

Private Internet Access client fails to connect in OS X Yosemite

I have been using PIA as a VPN provider for some time now and have no complaints about the access speed. Setting up the PIA client on Windows was a breeze. Configuring OpenVPN to connect to PIA in my Ubuntu box was easy.

Few months ago, I switched over to a Macbook Pro. I downloaded the Mac OS X VPN client from the Client Support area of the PIA website and installed it successfully. But, when attempting to connect to one of their US VPN Tunnel Gateway, the connection did not go through and seamed frozen in the ‘connecting’ phase.

Few weeks zipped by the time I came across a solution listed at the PIA Discussion Forum.

The PIA blog post by dvh listed three alternatives to fix the problem:

  1. Configuring PIA client to use TCP on behalf of UDP.
  2. Disabling the OS firewall.
  3. Whitelist PIA executable in the Firewall settings.

I do not prefer using a TCP connection with the VPN tunnel as the three way handshake would slow down my connectivity.

It did not make sense lowering system security so as to connect to the VPN tunnel. Therefore, disabling OS firewall was not an acceptable choice.

The last option of adding PIA OpenVPN executable to the whitelisted applications in the Firewall settings made sense. I could implement the fix by following the below steps:

  • Open: System Preferences (Cmd+Space and Type: System Preferences)
  • Choose: Security and Privacy followed by Firewall on the tab-bar.
  • Click: + icon within the Firewall dialog box to add the PIA OpenVPN program to the whitelist. This executable is listed in /private/tmp folder and named pia_openvn.

On completion of the above steps, the PIA Mac client was able to connect to their gateway successfully.


References:

How to fix the Tomcat 7 private instance and Eclipse integration error in Ubuntu

The first step as part of my journey in learning Spring MVC was to create a private instance of Tomcat 7. The procedure I had followed is documented as part of my earlier post: How to setup multiple instances of Tomcat 7 in Ubuntu.

The next step was to setup Eclipse to recognize the Tomcat 7 private instance.

A new server instance can be registered in Eclipse using Window -> preferences -> Server -> Runtime Environments menu.

But, when I try add the private Tomcat 7 instance, Eclipse reports that it could not identify the version of the Tomcat and refuses to register the instance.

Following the suggestions by David Edwards at askubuntu.com for a problem not directly linked to my problem, solved the Eclipse-Tomcat7-private-instance-integration issue.

The solution suggested by David Edwards was to create a link for the lib and bootstrap.jar library in the private instance folder.

Due to missing fix for the bug-297675 in the tomcat7-user package, the tomcat7-instance-create script fails to setup everything as required by Eclipse when executed.

The part of the solution that I followed can be divided into two steps.

Step 1: Create a link to the lib folder and the bootstrap.jar file located at /usr/share/tomcat7 in the tomcat7 private instance directory.

ln -s /usr/share/tomcat7/lib ~/Workspace/github/springapp/tomcat//lib
ln -s /usr/share/tomcat7/bin/bootstrap.jar ~/Workspace/github/springapp/tomcat/bin/bootstrap.jar

In addition, I also had to create a link to /usr/share/tomcat7/bin/tomcat-juli.jar.

ln -s /usr/share/tomcat7/bin/tomcat-juli.jar ~/Workspace/github/springapp/tomcat/bin/tomcat-juli.jar

Note: ~/Workspace/github/springapp/tomcat is my Tomcat 7 private instance folder created using tomcat7-intance-create script.

Step 2: Either download the catalina.policy file from code repository or from within the general Tomcat 7 instance configuration folder. For instance:

# If you opt for downloading the file - replace 'precise' with the right name of your Ubuntu release.
curl http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/tomcat7/precise/download/head:/catalina.policy-20110521092527-dk8tcyjy21h8eu9h-1652/catalina.policy > ~/Workspace/github/springapp/tomcat/conf/catalina.policy

Note: Make sure that you are downloading the latest version of http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/tomcat7/precise/view/head:/conf/catalina.policy file.

Eclipse should be able to recognize the version of Tomcat without issues.

Meanwhile, shutdown and restart the private instance using the commands:

settipalli@settipalli-ubuntu:~/Workspace/github/springapp/tomcat$ ./bin/shutdown.sh

# Followed by:
settipalli@settipalli-ubuntu:~/Workspace/github/springapp/tomcat$ ./bin/startup.sh

References:
1.How to setup multiple instances of Tomcat 7 in Ubuntu
2.Unknown version of Tomcat was specified with tomcat-7.0.42
3.Tomcat and Eclipse Integration Error : “Unknown version of Tomcat was specified.”
4.Cannot start tomcat after installing a private instance
5.Tomcat 7 and Eclipse integration getting error
6.Configure TOMCAT in Eclipse
7.Eclipse Community Forums – Can’t add a new Tomcat 7 Server
8.Eclipse 4.2 (Juno) ‘Cannot create a server using the selected type’ in Tomcat 7
9.Eclipse can’t find catalina.policy and bootstrap.jar where it expects them
10.Man page of tomcat7-instance-create

How to fix blank screen issue while attempting to edit WordPress blog posts in distraction free writing mode in Ubuntu?

I like writing, though I write occasionally. WordPress.com has been my platform of choice for several years now. I used to use the Windows Live Writer to create and edit my blog posts in Windows. It is excellent editor by all angles. When using Ubuntu, I stick with the web-based text editor on WordPress.com.

Since the launch of Markdown support for WordPress.com web based editor(http://en.support.wordpress.com/markdown/), my dependency on the web-based editor increased multifold.

Recently, I was plagued by the ‘blank screen’ problem whenever I used to switch to the ‘distraction free mode’ while editing text from within the Text Editor on the Chrome browser.

Meanwhile, I encountered the same problem when launching https://web.whatsapp.com to use the WhatsApp web client from within the Chrome browser. The symptoms of the problem seemed alike. And the solution also worked.

The solution was to launch the Chrome browser with hardware based rendering disabled using the command:

settipalli@settipalli-ubuntu:~$ google-chrome --disable-gpu

The other blog post also provides details on creating a desktop shortcut for Chrome browser with GPU disabled.


References:
1. How to fix the blank screen problem while launching WhatsApp web client from Google Chrome installed in Ubuntu
2. WordPress.com
3. Ubuntu 12.04.5 LTS (Precise Pangolin)
4. WordPress.com – Markdown
5. Write (More) Effortlessly With Markdown
6. WordPress.com – Writing and Editing – Editor
7. Markdown – Wikipedia
8. Download Windows Live Writer