Pages

Thursday, September 5, 2019

Darktable for Sony A6400

The latest APSC camera from Sony, the A6400 (ILCE-6400) has a new raw file format which is not supported by Darktable versions currently* in the Ubuntu repos or in the stable PPAs.

The only way to get darktable to open the RAW files from the A6400is to build the latest (unstable) darktable from source. Steps to do this on a vanilla install of Ubuntu are given in a text file below, also available through a Github Gist.

* as of this writing, Sep 5. 2019




Tuesday, May 2, 2017

Notes on Communication and Knowledge

For centuries we have attempted communication "downward." This, however,
cannot work, no matter how hard and how intelligently we try. It cannot
work, first, because it focuses on what we want to say. It assumes, in
other words, that the emitter communicates.

...unless the recipient "hears," communication has not taken place.
Information and communication are different. Communication has not taken
place unless the emitter is sure that the receiver understands what action
is to be taken as a result of, say, a conversation or a memo.

- Peter Drucker

Sadly, there is a villain in our story. The villain is a natural
psychological tendency that consistently confounds our ability to create
ideas using these principles. It's called the Curse of Knowledge. (We will
capitalize the phrase throughout the book to give it the drama we think it
deserves.)

Tappers and Listeners

In 1990, Elizabeth Newton earned a Ph.D. in psychology at Stanford by
studying a simple game in which she assigned people to one of two roles:
"tappers" or "listeners." Tappers received a list of twenty-five
well-known songs, such as "Happy Birthday to You" and "The Star-Spangled
Banner." Each tapper was asked to pick a song and tap out the rhythm to a
listener (by knocking on a table). The listener's job was to guess the
song, based on the rhythm being tapped. (By the way, this experiment is
fun to try at home if there's a good "listener" candidate nearby.)

The listener's job in this game is quite difficult. Over the course of
Newton's experiment, 120 songs were tapped out. Listeners guessed only 2.5
percent of the songs: 3 out of 120.

But here's what made the result worthy of a dissertation in psychology.
Before the listeners guessed the name of the song, Newton asked the
tappers to predict the odds that the listeners would guess correctly. They
predicted that the odds were 50 percent.

The tappers got their message across 1 time in 40, but they thought they
were getting their message across 1 time in 2. Why?

When a tapper taps, she is hearing the song in her head. Go ahead and try
it for yourself - tap out "The Star-Spangled Banner." It's impossible to
avoid hearing the tune in your head. Meanwhile, the listeners can't hear
that tune - all they can hear is a bunch of disconnected taps, like a kind
of bizarre Morse Code.

In the experiment, tappers are flabbergasted at how hard the listeners
seem to be working to pick up the tune. Isn't the song obvious? The
tappers' expressions, when a listener guesses "Happy Birthday to You" for
"The Star-Spangled Banner," are priceless: How could you be so stupid?

It's hard to be a tapper. The problem is that tappers have been given
knowledge (the song title) that makes it impossible for them to imagine
what it's like to lack that knowledge. When they're tapping, they can't
imagine what it's like for the listeners to hear isolated taps rather than
a song. This is the Curse of Knowledge. Once we know something, we find it
hard to imagine what it was like not to know it. Our knowledge has
"cursed" us. And it becomes difficult for us to share our knowledge with
others, because we can't readily re-create our listeners' state of mind.

The tapper/listener experiment is reenacted every day across the world.
The tappers and listeners are CEOs and frontline employees, teachers and
students, politicians and voters, marketers and customers, writers and
readers. All of these groups rely on ongoing communication, but, like the
tappers and listeners, they suffer from enormous information imbalances.
When a CEO discusses "unlocking shareholder value," there is a tune
playing in her head that the employees can't hear.

It's a hard problem to avoid - a CEO might have thirty years of daily
immersion in the logic and conventions of business. Reversing the process
is as impossible as un-ringing a bell. You can't unlearn what you already
know. There are, in fact, only two ways to beat the Curse of Knowledge
reliably. The first is not to learn anything. The second is to take your
ideas and transform them.

This book will teach you how to transform your ideas to beat the Curse of
Knowledge. The six principles presented earlier are your best weapons.
They can be used as a kind of checklist. Let's take the CEO who announces
to her staff that they must strive to "maximize shareholder value."

Is this idea simple? Yes, in the sense that it's short, but it lacks the
useful simplicity of a proverb. Is it unexpected? No. Concrete? Not at
all. Credible? Only in the sense that it's coming from the mouth of the
CEO. Emotional? Urn, no. A story? No.

Contrast the "maximize shareholder value" idea with John F. Kennedy's
famous 1961 call to "put a man on the moon and return him safely by the
end of the decade." Simple? Yes. Unexpected? Yes. Concrete? Amazingly so.
Credible? The goal seemed like science fiction, but the source was
credible. Emotional? Yes. Story? In miniature.

Had John F. Kennedy been a CEO, he would have said, "Our mission is to
become the international leader in the space industry through maximum
team-centered innovation and strategically targeted aerospace
initiatives." Fortunately, JFK was more intuitive than a modern-day CEO;
he knew that opaque, abstract missions don't captivate and inspire people.
The moon mission was a classic case of a communicator's dodging the Curse
of Knowledge. It was a brilliant and beautiful idea - a single idea that
motivated the actions of millions of people for a decade.

- Chip & Dan Heath, Made to Stick

Working with Windows

Over the last few months I have been "forced" (?) to work on(?) with (?) (perhaps despite?) windows. Overall Windows 10 isn't the clunky nightmare that Vista was, and is way better than Windows 7 too. Heck it even has workspaces finally!

Here are a few hacks I had to use to work out some common issues.

1. Machine does not respond to ping
Firewall rule is too strict. To change, go to:
Control Panel> Firewall
Advanced Setting
Inbound Rules:
Enable File and Printer Sharing Rules
2. Remote file access is not possible:
You need to be admin or otherwise have access to C:\ of the machine; then use smb://192.168.X.Y/C$ to access from Nautilus on another machine.

More hacks later. 

Friday, February 5, 2016

HPLIP Binary Plugin Installation

Recently ran into this exact bug with my junk laserjet printer P1108.


From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605589#40 

Package: hplip
Version: 3.13.4-1
Followup-For: Bug #605589

since the update to 3.13.4 I cannot seem to print with my P1005.
When sending a job to the printer, a window pops up asking to install the
plugin. When following the dialogs, they end saying that the plugin is
installed, followed by another window saying it failes.
Manually launching hp-plugin completes the plugin installation successfully,
the printer comes alive, but sending a print job goes back to requesting the
plugin.

The solution is here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605589#50

Briefly:
Create the directory /var/lib/hp
Update hplip-gui
Install/update cups-pk-helper if required
Unplug, then re-plug in printer
HPLip will ask to download and install the plugin, which is a run file.

If you are behind a firewall or your internet connection is dodgy, this automatic download will fail, and you will need to manually download and install the plugin.

In a terminal run hp-plugin
Watch the terminal for URL of the plugin file.

Download *.run file from hplip website.

Tex Studio Keyboard Shortcuts

TexStudio had an annoying habit of jumping to the the previous brace when I wanted to go one word (CTRL + left / right). This is because this key combination is assigned by default to "Next (or prev) word / placeholder".

Fix:
Assign nothing to "Next word / placeholder".
Assign CTRL+Right to "Move cursor right (1 word)"
Assign a different combination, e.g. Meta+Shift+Right to "Next placeholder".
Repeat for left.

PS
Meta = Usu key with the windows logo.
On GNOME the "windows" / meta key is used in lots of shortcuts, so assign carefully.

Wednesday, December 9, 2015

Colored output from Bash

Problem:
I've got colored output from bash (mostly git diffs) which I need to save *with* the coloring intact.

Solution:
- Pipe the output (*with coloring enabled - use --color switch or equivalent*) to a file.
- Get ansifilter
Download source , compile and install.
- Convert input to latex, compile the tex, save the PDF

Friday, August 21, 2015

Inkscape Latex render improvement

This little fix by KaKiLa allows passing of packahe options to the latex renderer (TexText) in inkscape.
To use, back up and then patch your source file eqtexsvg.py (usu. located in /usr/share/inkscape/extensions). Backup and delete the compiled bytecode (eqtexsvg.pyc), then restart Inkscape!

Tip: Remember that python is "indentation space" sensitive. So when you patch the script pay attention to the leading whitespaces.

Saturday, February 14, 2015

Nexus Un-Lollipop-ping

So Android Lollipop 5.0 was a fairly disappointing experience, as reported by many other Nexus 7 users. 5.0.1 and 5.0.2 were better, but significantly worse than KK 4.4.4, so I'm back to on KitKat using the instructions provided on the Android Developers' site. In brief the steps are:

  1. Download image for your device from the link above and extract the . Enable developer options on your device
  2. Go to Settings > Developer options > Enable USB debugging
  3. Connect USB Cable to a computer where adb is installed (On Ubuntu 14.04 you can install android-tools-adb package from synaptic)
  4. Click "allow" on device to always allow connections from that computer (useful incase you ever get locked out of the device)
  5. Reboot the device into bootloader. Use the device specific instructions or, in a terminal, run: adb reboot bootloader
  6. Unlock the bootloader (CAUTION:this wipes the device)
    fastboot oem unlock
  7. Flash the new image by executing flash-al script in the image directory
  8. Reboot into Bootloader as in step 5, then lock the bootloader using  fastboot oem lock

Wednesday, October 22, 2014

Guest Login

Recently there was a need to have a "volatile" guest account on my debian box. The solution it to create a user account with the $HOME in /tmp so it will get wiped out. (This is on Debian Wheezy / stable)

The relevant command is in this answer on SuperUser

> # Create account called guest with $HOME in /tmp
> # and default shell as 'none' so ssh access is not possible
> sudo useradd -mb /tmp -s /bin/false -c "Welcome Guest" guest;
> #Disable the password - Click on "Guest" in login screen
> #Make sure you have users displayed on the login screen!
> sudo passwd -d guest

Now I need to figure out how to display a nice welcome message for the Guest user *after* login (Ubuntu 14.04 does this out of the box)

Sunday, October 19, 2014

Recording Stereo Mix using avconv

Based on instructions here:
http://askubuntu.com/questions/233060/recording-speaker-audio-using-avconv

Identify your device first:

$ pactl list sources | grep output



Get the string under "Name:", it will be something like: alsa_output.pci-[some number].analog-stereo.monitor

Record audio and Video:
avconv -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -f x11grab -r 30 -s 1920*1080 -i :0.0 -vcodec libx264 -preset ultrafast -ab 320k -t 10 -threads 8 screen.mkv

Record only audio:
 avconv -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -t 1620 -threads 8 screen.mp3

Thursday, September 12, 2013

QGit Segfaults on opening the settings dialog

Seem to be running into a few corner cases today. Qgit is a really nice viewer for git repositories, but it would crash each time I attempted to open the settings dialog. After some hours of debugging I traced the problem to the presence of newlines in the branch description. Full details can be seen in the bug report on launchpad.net

Octave PDF print error

Spent a while debugging a mysterious error with exporting PDF plots from Octave. To test if you have the same bug run the following commands on an octave prompt:

clear
close all
sombrero
print -deps temp.eps
print -dpdf temp.pdf

Now check for the following errors/warnings:

1. Did you get an error saying epstool binary not found?
Solution:
Install epstool from your package manager (synaptic or equivalent)

2. Did you get an error from Ghostscript?
e.g. GPL Ghostscript X.XX: Unrecoverable error, exit code 1

and/or

Is the EPS file unreadable?
Try to convert the EPS to pdf using ps2pdf temp.eps. If you get an error like "Error: /limitcheck in /fontfont" then there is a problem with the installed fonts. Try the diagnostic test described here [3]:
octave:1> set (0, "defaultaxesfontname", "Helvetica")
Solution: remove the package font-pagul. [1,2]

Links:
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662892
[2] http://octave.1599824.n4.nabble.com/3-6-1-produces-eps-files-that-are-unusable-on-Debian-wheezy-td4438420.html
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=710272#17


Friday, January 11, 2013

Syntax highlighting for SPICE in gedit

Ever viewed a SPICE netlist in gedit, and struggled to make sense of it? One thing that makes life easier is Syntax highlighting.

We first need the .lang file for spice, which has been  which can be downloaded here. Then copy this file (as root) to the relevant directory, which is : /usr/share/gtksourceview-3.0/language-specs/
(You may have 1.0 or 2.0 etc. instead of 3.0)
Restart gedit,open a netlist file, and click on highlighting scheme (probably "plain text" by default, and select SPICE)


Ref: Ubuntu Forums

Sunday, November 4, 2012

Mobile posting

Setting up mobile posting for the phone!

Monday, September 17, 2012

Custom Launchers in GNOME 3

Install 'alacarte', and then use!
Self explanatory.

Tuesday, September 11, 2012

Dual boot clock problems

Symptom:

You have a dual boot machine with Windows and Linux. The Linux OS thinks the BIOS time is UTC, whereas windows thinks it is local time. So depending on what your BIOS clock is set to, one of the OSes will show a wrong clock.

Solution:
  1. Decide what you want your BIOS clock to be. There are arguments for both sides.
  2. If you want you BIOS to be set to UTC, then:
    1. Linux will be fine, because this is what is expects. 
    2. For Windows add a registry entry as follows.
    3. Create a file called time.reg with the following content
    4. Windows Registry Editor Version 5.00
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
      "RealTimeIsUniversal"=dword:00000001
    5. Then double click it - and accept the warnings that follow.
    6. Done!
  3. If you want the BIOS to be set to Local time, then
    1. Leave Windows as it is
    2. In Linux, add a line in the file /etc/default/rcS with the content UTC=no

Monday, July 16, 2012

Automounting Network partitions

If you have network drives that you would like to be auto-mounted on startup on your Linux box, then the obvious way to do this seems to be to put the appropriate line in /etc/fstab. (Note that for Windows shares, the appropriate packages have to be installed - samba and smbfs).

However, if the fstab is executed before the network comes up, you have a problem - the mount will fail. The workaround is to either
  1. not do auto-mount, OR
  2. delay the mount till the network is up OR
  3. to use a program written specifically for this situation - Autofs. 

Friday, July 13, 2012

From J. N. Tata to Swami Vivekananda


Dear Swami Vivekanand,

I trust you remember me as a fellow-traveller in your voyage from Japan to Chicago [in 1893]. I very much recall at this moment your views on the growth of the ascetic spirit in India and the duty, not of destroying, but of diverting it into useful channels. I recall these ideas in connection with my scheme of a Research Institute for India, of which you have doubtless heard or read.

Compiling ngSPICE on Ubuntu 12.04

Wanting to install the latest version of ngSPICE on the new Ubuntu 12.04 box, i ran into a little trouble. The first is that ngSPICE is a very powerful interactive software, but the plain vanilla command line is really painful to use because it does not support backspace and arrow keys. The fix for this is to use the GNU readline library. Unfortunately, without the correct X packages installed, you will end up with a functioning installation of ngSPICE that cannot plot data, complaining that it "Cannot open viewport". The fix for this is to install the following packages:

Install autoconf and libtool  if you are running autogen.sh


Install bison, else configure will not run.

For GNU Readline support, install libreadline6, libreadline6-dev
For Plotting, install: libxaw7, libxaw7-dev, libx11-6, libx11-dev

Then run ./configure --with-readline

Then make and then [sudo] make install...

Thursday, July 12, 2012

Backing Up with Rsync

There's always a moment of butterflies when your machine hangs, or doesn't  boot up, or shows some cryptic message and dies. In the few minutes following my last such catastrophe, I berated myself for not taking regular backups on an external drive. Then I started to look at trying to recover the data using a live CD. When I finally got the new OS going I decided the first thing to do was to set up a system to silently backup the system every once in a while, either to a USB hard drive or to a network drive. So I wrote a script to do this using rsync. The script is as follows, with explanations for each line...