Saturday, April 16, 2016

iPhone to LG G5 - Car mode and how to diable it

Let me start by saying I am not a fan boy of a particular technology or company. I enjoy all technologies. I believe there is no one solution to all. Some time's you side with one for something and with other for something else. Life seems to be more of a pleasure this way and you enjoy the solution/action rather than anything else. In short you are objective. One thing I do make sure of is not to get bound by proprietary s/w. Reasons are obvious. You are bound by them and in more occasions than not, you dance to their tunes, in no time you are married to more proprietary s/w

Recently I switched over from iPhone to Android. Fancied my chances on LG G5, just for a change. I have for long wanted to do Android apps, in addition to what I do on iOS. Although I have been building applications for Android, never had the stomach to leave behind my dear iPhone. Call it a fascination for APPLE or the resale value I enjoy on iOS devices. But then with my love for LINUX growing more and more, I started to spend more of my time on Ubuntu. Ubuntu/Linux-iOS have a sort of love hate relationship. It was making life difficult for me to share files and access things from my device, etc. I decided to give Android a run. Not that I have not tried in the past. All my experiences were soar. I blame it on my choice for devices more than the s/w. Your past experience haunt you and are a major trigger for your present decisions, be it a phone or life.

Back to the contemporary world. I feasted myself with LG G5, as it was taunted to be the finest of Android phones. The reason I liked LG G5 (over Nexus 6/6P) was its size. I came from iPhone 6P world. In the early 6P days, I enjoyed its gorgeous size and view, but with time, I realized its a pain handling huge devices. Believe me, device was great, my mind set changed. With that in mind, Nexus 6p in its 5.7" screen was a no go. More over, I prefer a Android device that has support for SD Card. These 2 conditions narrowed my choices and from the limited choices I had, found LG G5 to be my best bet

Boy, what a device. Great display, wonderful dock and navigation system, feels great in your hand. I did not try the sport features, but overall it was a pleasant experience. One of the great feature that was talked about in Android was "Car mode". I reckon this is an addition from Verizon more than from Android OS itself. This feature detects if you are driving and will turn the phone's car mode on. This in turn will help do some wonderful things behind the scene for you, if you are driving. Like doing an auto-reply for your messages, answering the phone etc. It's great right. It is indeed, if you do not have control on yourself. Although great, I found it buggy. What if you are not driving, but you are a rider. Sometimes it will show up even while I am not in the car. If my phone is not disturbed for more than 20 mins or lying flat up, car mode will turn on. Now that's a problem, because people who message me will now see an auto-reply.

Only choice I had was to disable it. How do I do it? Given my background in Android I was not sure. Google was of little help. I saw a lot of people talk about similar issues but no good solutions. After some exploration found that, it's pretty easy to turn it off. If you ask me "Why would you turn off such a great feature?" My answer is simple. When I drive, I don't answer my phone. Its my vow. Driving takes priority. If there's an important call, I'll let my pillion driver take it or if no one is around, it goes to my VM and I'll call back. I don't peek into my messages, play music from phone while I drive. Its my driving and dashboard in the car that gets all my attention. If you are like me than "Car mode" is useless and/or rather a hassle.

Now to the interesting part on how to turn it off
Head on to messages

  1. Open settings, by tapping the Hamburger menu in settings
  2. Turn off "Driving Mode" and "Auto-Reply"
  3. You should see "Settings" in the list, tap it
  4. This will open up more settings. Locate "Driving mode" and tap it open
  5. Ensure all connected blue tooth devices are checked-off here
  6. Also, turn off Auto-Glympse settings


That's it!!! Now enjoy more for less with your new LG-G5.

Here are a couple more things I did for my phone to keep it run long enough

  1. Bought myself a screen-protector from Verizon
  2. Got this great case - http://www.amazon.com/Absorption-Protection-Bumper-Scratch-Protective/dp/B01BOBL8SQ?ie=UTF8&psc=1&redirect=true&ref_=oh_aui_detailpage_o00_s00

Saturday, March 12, 2016

What should go into your .profile?

What's your profile like?

I have always had this issue after a fresh installation of Ubuntu. Bring back all my alias from my previous installations, my custom commands, then my terminal setup, etc. You can always say, why not have a better backup strategy. Sure, it does work that way too. But sometimes I go crazy and try different LINUX flavors too. So just a backup strategy won't help.

What I did was to put in some of those common environment setup into a file so that I can always bring it back wherever needed. Many a occasion my colleagues at office and my friends were curious to know what my profile setup looks like. I will be honest, I have not done all of this myself. Over time, I looked out for solutions for my pain points and to horn my lethargy. 7 years of work, did help me collect a lot of dust. Time to share. Feel free to take a look and use what makes sense to you


 
#  ---------------------------------------------------------------------------
#
#  Description:  This file holds all my BASH configurations and aliases
#
#  Sections:
#  1.   Environment Configuration
#  2.   Make Terminal Better (remapping defaults and adding functionality)
#  3.   File and Folder Management
#
#  ---------------------------------------------------------------------------

#   -------------------------------
#   1.  ENVIRONMENT CONFIGURATION
#   -------------------------------

#   Change Prompt
#   ------------------------------------------------------------
    export PS1="________________________________________________________________________________\n| \w @ \h (\u) \n| => "
    export PS2="| => "

#   Set Paths
#   ------------------------------------------------------------
    export PATH="$PATH:/usr/local/bin/"
    export PATH="/usr/local/git/bin:/sw/bin/:/usr/local/bin:/usr/local/:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

#   Set Default Editor (change 'Nano' to the editor of your choice)
#   ------------------------------------------------------------
    export EDITOR=/usr/bin/nano

#   Set default blocksize for ls, df, du
#   from this: http://hints.macworld.com/comment.php?mode=view&cid=24491
#   ------------------------------------------------------------
    export BLOCKSIZE=1k

#   Add color to terminal
#   (this is all commented out as I use Mac Terminal Profiles)
#   from http://osxdaily.com/2012/02/21/add-color-to-the-terminal-in-mac-os-x/
#   ------------------------------------------------------------
#   export CLICOLOR=1
#   export LSCOLORS=ExFxBxDxCxegedabagacad


#   -----------------------------
#   2.  MAKE TERMINAL BETTER
#   -----------------------------

alias cp='cp -iv'                           # Preferred 'cp' implementation
alias mv='mv -iv'                           # Preferred 'mv' implementation
alias mkdir='mkdir -pv'                     # Preferred 'mkdir' implementation
alias ll='ls -FGlAhp'                       # Preferred 'ls' implementation
alias less='less -FSRXc'                    # Preferred 'less' implementation
cd() { builtin cd "$@"; ll; }               # Always list directory contents upon 'cd'
alias cd..='cd ../'                         # Go back 1 directory level (for fast typers)
alias ..='cd ../'                           # Go back 1 directory level
alias ...='cd ../../'                       # Go back 2 directory levels
alias .3='cd ../../../'                     # Go back 3 directory levels
alias .4='cd ../../../../'                  # Go back 4 directory levels
alias .5='cd ../../../../../'               # Go back 5 directory levels
alias .6='cd ../../../../../../'            # Go back 6 directory levels
alias edit='subl'                           # edit:         Opens any file in sublime editor
#alias f='open -a Finder ./'                 # f:            Opens current directory in MacOS Finder
alias ~="cd ~"                              # ~:            Go Home
alias c='clear'                             # c:            Clear terminal display
alias which='type -all'                     # which:        Find executables
alias path='echo -e ${PATH//:/\\n}'         # path:         Echo all executable Paths
alias show_options='shopt'                  # Show_options: display bash options settings
alias fix_stty='stty sane'                  # fix_stty:     Restore terminal settings when screwed up
alias cic='set completion-ignore-case On'   # cic:          Make tab-completion case-insensitive
mcd () { mkdir -p "$1" && cd "$1"; }        # mcd:          Makes new Dir and jumps inside

#   lr:  Full Recursive Directory Listing
#   ------------------------------------------
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/   /'\'' -e '\''s/-/|/'\'' | less'

#   mans:   Search manpage given in agument '1' for term given in argument '2' (case insensitive)
#           displays paginated result with colored search terms and two lines surrounding each hit.             Example: mans mplayer codec
#   --------------------------------------------------------------------
    mans () {
        man $1 | grep -iC2 --color=always $2 | less
    }

#   showa: to remind yourself of an alias (given some part of it)
#   ------------------------------------------------------------
    showa () { /usr/bin/grep --color=always -i -a1 $@ ~/Library/init/bash/aliases.bash | grep -v '^\s*$' | less -FSRXc ; }


#   -------------------------------
#   3.  FILE AND FOLDER MANAGEMENT
#   -------------------------------

zipf () { zip -r "$1".zip "$1" ; }          # zipf:         To create a ZIP archive of a folder
alias numFiles='echo $(ls -1 | wc -l)'      # numFiles:     Count of non-hidden files in current dir
alias make1mb='mkfile 1m ./1MB.dat'         # make1mb:      Creates a file of 1mb size (all zeros)
alias make5mb='mkfile 5m ./5MB.dat'         # make5mb:      Creates a file of 5mb size (all zeros)
alias make10mb='mkfile 10m ./10MB.dat'      # make10mb:     Creates a file of 10mb size (all zeros)

#   cdf:  'Cd's to frontmost window of MacOS Finder
#   ------------------------------------------------------
    cdf () {
        currFolderPath=$( /usr/bin/osascript <

Feel free to share your thoughts and additions to these.

Now comes one of the more difficult questions. There are so many places where you can have these. Should I add these in .bashrc, .profile, .bash_profile. Of course, if you have other shells, there can be variations of the same too. To answer this question, we may have to go to the fundamentals and roots of how LINUX works

The main difference with shell config files is that some are only read by "login" shells (eg. when you login from another host, or login at the text console of a local unix machine). These are the ones called, say, .login or .profile or .zlogin (depending on which shell you're using)

Then you have config files that are read by "interactive" shells (as in, ones connected to a terminal (or pseudo-terminal in the case of, say, a terminal emulator running under a windowing system). these are the ones with names like .bashrc, .tcshrc, .zshrc, etc.

.bashrc is only read by a shell that's both interactive and non-login.

.profile is simply the login script filename originally used by /bin/sh. bash, being generally backwards-compatible with /bin/sh, will read .profile if one exists.

If you do man bash, here's what you are going to see, which explains a lot more

 
/bin/bash
       The bash executable
/etc/profile
       The systemwide initialization file, executed for login shells
~/.bash_profile
       The personal initialization file, executed for login shells
~/.bashrc
       The individual per-interactive-shell startup file
~/.bash_logout
       The individual login shell cleanup file, executed when a login shell exits
~/.inputrc
       Individual readline initialization file


What you need to do after you install Ubuntu


What you need to do on a fresh installation of Ubuntu

First and foremost, here's what you want to do if you install any version of debian OS
sudo apt-get update && sudo apt-get upgrade

Most of what I have is common to all of the debian system. I am not sure if arc-theme is available for Mint. I guess, its more specific for Ubuntu. I can check on the same and get back to you folks, if the behavior is any different

I have gone through a lot of websites to collect this information, some of which are my own. Every time I do a fresh installation of LINUX, I have to go over this laborious process of installing these one after the other. Being the programmer I am (and you are), I am sure you agree with the fact, we all hate mundane repetitive activities. Hence I came up with a easier manual that will help me set things up in 3 or 4 steps. May be soon enough, I'll create this as an application and have it as a single step installation.. For the moment, though these following applications will be installed


  1. Oracle Java 
  2. eclipse 
  3. vlc 
  4. node 
  5. npm 
  6. git 
  7. git-flow 
  8. git-cola 
  9. vim 
  10. ssh 
  11. clementine 
  12. unity-tweak-tool 
  13. gnome-tweak-tool 
  14. ubuntu-make 
  15. virtualbox 
  16. arc-theme 
  17. gcolor2
  18. SWIFT 2.2
  19. MongoDB


Add the following PPA, if you want to install Oracle JAVA

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

Install NodeJS

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -

Install Brackets from Adobe

sudo add-apt-repository ppa:webupd8team/brackets
sudo apt-get update

To install umake that will help you install AndroidStudio, Webstorm through umake command

sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt-get update

To install arc-theme, please add this repository(Check the version number before you install)

wget http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_15.10/Release.key
sudo apt-key add - < Release.key

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_15.10/ /' >> /etc/apt/sources.list.d/arc-theme.list"
sudo apt-get update

sudo apt-get install -y sublime-text-installer nodejs oracle-java9-installer eclipse vlc git git-flow git-cola vim ssh clementine unity-tweak-tool gnome-tweak-tool ubuntu-make virtualbox arc-theme gcolor2 lib32z1 lib32ncurses5 lib32stdc++6 clang libicu-dev mongodb brackets

Installing Wireshark

sudo apt-get install -y wireshark nmap
sudo usermod -a -G wireshark YOUR_USER_NAME
sudo chgrp wireshark /usr/bin/dumpcap
sudo chmod 750 /usr/bin/dumpcap
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
sudo getcap /usr/bin/dumpcap

Why arc-theme?

Arc-Theme is the best theme out there for Ubuntu. It provides a great lot of theme collections that you can choose from in addition to what Ubuntu does. From the time I tried it, I have never looked back. I am sure, the experience will be the same for you too.

How to remove a PPA you added

sudo add-apt-repository --remove ppa:webupd8team/brackets

How to remove applications you installed

sudo apt-get remove brackets

Why Ubuntu make?

umake, makes it easy for you to install some of other developer applications for your day time job like Androidstudio, webstorm, pycharm.....with a single command.



umake android
umake swift
umake go
umake ide webstorm
umake ide pycharm
umake ide visual-studio-code
umake ide sublime-text
umake ide atom

Refer to https://wiki.ubuntu.com/ubuntu-make for more information

Why Oracle Java ?

With Android 6 getting a lot of support on Java8, I think it makes sense for us to adopt Oracle's Java8. It's less buggy, more secure and if there are vulnearabilities Oracle has been fast enough to respond on them. I have nothing against Open JDK. feel free to use that, if you have a strong opinion on it.

Check to see if MongoDB is installed fine


sudo service mongodb start

You should hear back that the service is started and running correctly on port (usually) 15251. In some cases you don't get to hear back. You are still fine.


 
krishnan@ubuntukrishnan:~$ sudo service mongodb start
krishnan@ubuntukrishnan:~$ mongo
MongoDB shell version: 2.6.10
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
    http://docs.mongodb.org/
Questions? Try the support group
    http://groups.google.com/group/mongodb-user
> show dbs
admin  (empty)
local  0.078GB
> exit
bye

In addition to developers requirements, there's plenty of essentials to turn your Ubuntu into a full-fledged system fo all practical purposes - From email system to video editing

Peek - Video Editor
sudo add-apt-repository ppa:peek-developers/stable
sudo apt-get update
sudo apt-get install -y peek

Nylas mail client
ThunderBird and evolution has long been the best mail client. Here's a new entrant that will make other mail clinet myopic

Few more


  • A simple weather indicator 
  • Hiri a simple client for MS products
  • GitBook Editor Perfect to get started with writing a book in Git
  • Google desktop Music player - A common music player between your android device and desktop. Share your audio, video, purchases all from one app
  • OpenPics - Building a web application or a photo collection album needs perfection. You need professional tools to shape your picture the way it needs to be before you publish it to the market. OpenPics is a great open source tool that can help you in the ride


Stacer

wget https://github.com/oguzhaninan/Stacer/releases/download/v1.0.4/Stacer_1.0.4_amd64.deb
sudo dpkg --install Stacer_1.0.4_amd64.deb


Gdebi package installer - Alternative to software center

sudo apt-get install gdebi

Install Snapd

There are not that many video editors that can be as good as Snapd.
sudo apt install snapd


Adobe flash-plugin is not something you want in your laptop. They are power hungry and cause lot of crashes. But if you still need them, here you go

  1. Open Software & Updates
  2. Switch to ‘Other Software‘ tab
  3. Click/check the ‘Canonical Partners’  repository
  4. Refresh your software sources when prompted.

sudo apt install adobe-flashplugin