Thursday, October 3, 2013

Google drive for linux - Pros and Cons of Insync

Background:

I've been hopeful about Insync for years, but until about a 9 months ago it wasn't ready for everyday use.

I'd been a beta tester since at least 2011 as I really wanted to get my company off of our Dropbox subscription and move to Google cloud storage as there were always collisions between files that were being collaboratively worked on and shared in Dropbox, and SVN was too complicated for my CEO.

Beta experience:

Versions prior to 0.08 were really unstable, and Google's revision control would often make a mess out of things.  0.08 cleaned up most of this and by version 0.09 it was rock solid! and I was syncing 3 Google accounts (work, household, and personal).  When I got the warning that I'd have to pay, but that I'd actually have to re-download everything to up grade I knew I wanted to opt out until that wasn't the case (I was syncing over 7 GB of files across 3 computers).   I figured my next employer could pick up the tab of purchasing the version 1 client on the machine they'd assign me, and I'd try it then, and if it was way better or the 0.09 client messed up to the point where I needed to re-download everything anyway I'd upgrade.   Moreover they claimed the version 1.2 client was slated to allow an upgrade with out a full download.

Unfortunately, around this time Insync was added to the Ubuntu repositories, and during a routine software updates I was upgraded to the version 0.10 beta client that had a 15 day limit before a pro account was needed.  Worse yet, it was missing some core dependencies and was not functioning.  And when I tried to downgrade things just got so messed.  I posted in the insync forms and they, of course, recommended the new paid 1.0 client.  Moreover I couldn't even find the 0.09 beta client packages to try a reinstall on my own.  I was a bit upset about how I was forced into an upgrade, but as I was working on resumes couldn't afford to waist any more time trouble shooting and finally bought a license for one of my accounts.

That said, I've utilized support a few more times since the upgrade, so I can't help but feel like paying for a license was the right move.

Moreover, support is supper responsive, and other than getting screwed by the Ubuntu repo maintainer, I have no other complaints.

The new client:

Thew new client is rock solid and integrates well Ubuntu based distributions.  I like the mate client.  The arch client still needs some work.  In Openbox if you leave notifications on they tend to take over your screen (are way to large).  Also the documentation for installing Insync required aggregating a bit information first (I'm new to arch and don't fully grasp AUR yet).  Yes, there is still an occasional bug, but an upgrade to the latest client no longer requires a full re-download of your file system and usually fixes most problems.

See my post here for how to install insync in Arch.

For debian systems, just use apt-get or synaptic.



Wednesday, September 18, 2013

Touch pad deactivation while typing and palm detection


I was having the same issue with my ASUS K55A touch-pad has the same issue whether under Arch Linux, or Ubuntu, and I imagine this applies to a lot of other touch-pads out there.  I'm running Openbox in Arch and Semplice (Debian Sid)  Mate in Ubuntu, but this should work for enlightenment, Gnome or any other desktop you might use. 

Set up palm detection:

Turn on palm detection, in a terminal type:
$ synclient PalmDetect=1

Set the maximum width that should be interpreted as a finger instead of a palm.  I choose 4, most how-tos use 10, it's good to do a bit of guess and test here:
$ synclient PalmMinWidth=4
 
Then, set the minimum height of a palm vs a finger:
$ synclient PalmMinZ=50 

Finally, under Ubuntu, 3 finger middle click is not enabled by default, so if you want to enable it use:
$ synclient TapButton2=3 TapButton3=2

In theory, this should enable 2 finger tap for middle click, and 3 finger tap for right click, but in Ubuntu 13.04 the resulting behavior is exactly the opposite.  Therefore, if you prefer 2 finger tap for middle click use:
$ synclient TapButton2=2 TapButton3=3 

To make this permanent once you have found the correct settings, save them into 50-synaptics.conf which is located at /usr/share/X11/xorg.conf.d/50-synaptics.confin  Debian/Ubuntu (Semplice) and at /etc/X11/xorg.conf.d/50-synaptics.conf in Arch Linux based distros, (the first "InputClass" part is for the multi-touch middle click fix, which is already enabled in Arch so you shouldn't need to add it):

Section "InputClass"
    Identifier "touchpad catchall"
    Driver "synaptics"
    MatchIsTouchpad "on"
    MatchDevicePath "/dev/input/event*"
    Option "TapButton1" "1"
    Option "TapButton2" "2"
    Option "TapButton3" "3"
    Option "HorizTwoFingerScroll" "on"
    Option "VertTwoFingerScroll" "on"
EndSection


#synclient PalmDetect=1
Option "PalmDetect" "1"
#synclient PalmMinWidth=4
Option "PalmMinWidth" "4"
#synclient PalmMinZ=50
Option "PalmMinZ" "50"

Actually turning the touch-pad off:

While this solution is almost perfect.  It still really annoyed me that there wasn't a software delay of say a 0.5 second between when the last key-press was registered and when the touch-pad is active.  The Arch linux wiki on touch-pads gives some hints here as well, however, getting it to work was as straight forward as above.  Moreover, when I attempted to run the recommended script, multi-touch gestures were disabled for the remainder of my login session, or in other instances the touch-pad just stopped working all together.

As it turns out, if I run the script before executing the palm detection script then it actually seems to work.  However the script on the arch wiki it's not an ideal example.  A friend of a friend recommended the following instead, and after reading the syndaemon man file I'd have to agree:

$ syndaemon -K -i 0.5 -R -d 

The arch wiki claims that if you save this command to your  ~/.xinitrc file to have it executed automatically at your next log-in.  However when I did this I was unaware that the command must happen before the launch of the desktop (exec DESKTOP.session command).  After playing around with a ton of other config files and learning a ton about the SLiM display manager I finally realized that the command just needed to be moved further up the file as commands after the desktop launch wont be run until the desktop is quit.

I hate touchpads; jummpy zig-zaging pointer/cursor, and disabling the touch pad while typing

I hate touch-pads.  Yes, they have gotten better, especially with muti-touch functionality.  However I really love the GNU/linux middle click to paste highlighted text, and three finger middle click lacks the accuracy one really wants to place a line of text in a specific spot.  The dislike of touch-pads seems to be genetic, father once made his company replace his touch-pad with a trackball (it was modular so it could easily be swapped out), but I digress.

Currently I'm experience 2 different touchpad issues on my ASUS K55A under Ubuntu with Mate and Manjaro / Arch linux with Openbox that seem generic enough to not make a specific blog for my laptop.

Issue 1: Jerky mouse pointer behavior
The first is a really crazy issue where I when to visit the girlfriends family and suddenly my touch-pad was going haywire.  Turns out my the house I as in had lower quality power (probably due to their heavy use of CFL bulbs) and my power adapter was generating EM interference with the touch-pad because of it.  Many forums claim this is due to a faulty power supply, and Dell, Apple, and HP have replaced their afflicted user's adapters.

-- Follow-up: after much testing it's definitely due to power quality issues.  Non-OEM charges continuously replicate this experience.

Issue 2:  Touch pad active while typing, causing accidental clicks and focus changes
This section turned out to be longer than I expected, and I'm still updating it, so it has been moved to a separate post:
http://add4jhf.blogspot.com/2013/09/touch-pad-deactivation-while-typing-and.html

Thursday, January 21, 2010

Renaming parts of files in bulk.

So I had an issue where I needed to change a dash '-' to an underscore '_' in the middle 20,000 files, but keep the dash in another part of the file.  An average file name looked something like this: 24-A13-smm1.png where I wanted to change the second dash to an underscore to better separate plate-well info from the library type.  (Skip to the bottom for the quick answer.)

I came across several solutions, but most of them were unintuitive, and hard to follow.  However, without too much digging I finally came across a QnA form with a some more elegant solutions.  Here is my favorite for just changing all instances of a single character:

Review the offending files.
find /path/to/files -name '*-*' -print

Rename the offending files with an underscore.
find /path/to/files -name '*-*' -exec rename '-' '_' {} +

In my particular case I could leave out the /path/to/files because I was executing the script from the directory the files were stored in.  The script therefore is shortened to:

find -name '*-*' -exec rename '-' '_' {} + 

Because I want to remove the second dash, I need to use a bit of trickery.  Fortunately, all of my files end in "smm*.png"  so I can just search for the -smm to change that specific dash to an underscore.  The following worked perfectly for me:


find -name '*-smm*' -exec rename '-smm' '_smm' {} + 


Now that I have my solution, let's break down the script:
find -name '*-*' -exec rename '-' '_' {} + 



The find -name '*-*' obviously finds any file with an dash.

From what I've read -exec is a quite powerful, theoretically being able to execute any Unix command.  Therefore you should always test your query first.

The rename '-' '_' part is again more trivial as the first argument following rename is the text you want to change and the second argument is what you want to change it to.
The {} argument represents what would normally be the name of the file in your executed command. 

What the + does at the end, I'm not really certain, I think the writer of the script used it in place of a ; because in a shell script you would need to escape ( \; or '\' ).

Now that it's been broken down, and I know that rename is just a common UNIX command, I see that my script could be further simplified.  Since I want to rename every file with a - in my directory, I don't actually need to used the find command just rename!!  And sure enough

rename '-smm' '_smm' *
 

works just fine!

Monday, January 4, 2010

The focus of this blog will be cross-platform hacks

Originally the point of this cleverly titled blog was going to be a personal journal, but I found that it was hard to manage permissions and found Google wave to be a better alternative for that sort of thing. Further, since I already have a blog about OpenSUSE under this account, it just makes sense to use this blog as a trouble shooting log.