Friday, September 9, 2016

Posting my experience with Logitech K480


How did I get it?
I was like always checking out deals on different sites, just when this lightning deal(amazon) caught my attention which said K480 for 1899INR and I knew I had never seen this any less 2500 on different occasions so I had to book it :P
Unexpectedly delivery charges were free and it said will be delivered in two days but got delivered the next day!
Initial impressions (day 1: more like working day 1)
First of all its heavy but I guess it gives it sturdy ness.
Setup with android devices was pretty easy just for new buyers if asked for pin type it using keyboard and press enter it works that way.
The main problem I faced was with windows. Initially it connected like a charm and I did some shortcuts and it worked but once I changed device using keyboard; windows 7 setup was dead! No matter what I do it was dead. I tried remove device and that caused me to hit a dead end - now keyboard is not even shown in search new device.
PS: I have done driver uninstall/ install, couple of reboots, service log on changes, registry key changes for that sake; its still a dead end for K480 with win7.
Hoping to find a solution soon.
Impressions continued day 2
Keyboard gave me hard time today connecting to my phone, actually my phone was the only device which accepted it how it was in no time. I turned on my phones bluetooth and then turned on keyboard, it didn't connect on itself. I thought it might be some sequence issue so I switched between devices still same. I had to search and add this keyboard to phone again.
I wonder what went wrong between these two :P
Note for readers: This post is posted from my Lenovo K3 Note and my brand new Logitech keyboard K480 (which i haven't paid for it yet :P)

Friday, September 2, 2016

Quick shell based network setup [linux]

By default most linux OS have their network config set to DHCP. How to change it and get going with custom settings.

This is what DHCP setting looks like
auto eth0
iface eth0 inet dhcp

For same we need to edit interfaces file as following:

sudo vi /etc/network/interfaces
Contents of file considering we are editing for eth0 card
auto eth0
iface eth0 inet static
address 192.168.2.1
netmask 255.255.255.0
gateway 192.168.X.X
dns-nameservers X.X.X.X Y.Y.Y.Y Z.Z.Z.Z

After saving above configuration we need to restart networking service to apply changes
 sudo /etc/init.d/networking restart

Checking of new configuration can be done as follows
$ ifconfig eth0
$ ifconfig

Thursday, September 1, 2016

Navigation / Menu (Dynamic) using bootstrap

Point to be noted is that bootstrap has already taken care of different screens so when you are coding the bootstrap page its dynamic to screen size. This post covers one  of such amazing example where you design a navigation for large screen and it automatically becomes collapsible for mobile screens.

Here is the code,

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Navigation Example</title>
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
  <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>

<body>
  <nav class="navbar navbar-default">
    <!-- inverse to have black -->
    <div class="container-fluid">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
        <a class="navbar-brand" href="#">
          <!-- <img alt="Brand" src="..."> -->
          Brandname
        </a>
      </div>
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <ul class="nav navbar-nav">
          <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
          <li><a href="#">Link</a></li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
            <ul class="dropdown-menu">
              <li><a href="#">Action</a></li>
              <li><a href="#">Another action</a></li>
              <li><a href="#">Something else here</a></li>
              <li role="separator" class="divider"></li>
              <li><a href="#">Separated link</a></li>
              <li role="separator" class="divider"></li>
              <li><a href="#">One more separated link</a></li>
            </ul>
          </li>
        </ul>
        <form class="navbar-form navbar-left" role="search">
          <div class="form-group">
            <input type="text" class="form-control" placeholder="Search">
          </div>
          <button type="submit" class="btn btn-default">Submit</button>
        </form>
        <ul class="nav navbar-nav navbar-right">
          <li><a href="#">Link</a></li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
            <ul class="dropdown-menu">
              <li><a href="#">Action</a></li>
              <li><a href="#">Another action</a></li>
              <li><a href="#">Something else here</a></li>
              <li role="separator" class="divider"></li>
              <li><a href="#">Separated link</a></li>
            </ul>
          </li>
        </ul>
      </div>
    </div>
  </nav>
  <h1>Hello, world!</h1>
</body>Example

</html>

Output:
DESKTOP/ LARGE SCREEN 
Desktops/ Large screen devices
MOBILE/ SMALL SCREENS 

Explanation:

Note that I have intentionally included jquery before bootstrap js inclusion becoz if not done so dynamic navigation fails to expand and collapse 

Line 15: If you change navbar-default to navbar-inverse you shall have dark theme
Line 25: href value defines what is to be done when clicked on Logo or brand name
Line 26: uncomment it and set company logo here if you want

Layout / Grid system in Bootstrap

Bootstrap divides page as mainly usable and not used part by mentioning class name as container for div tag.All the content we need to show is inside this div tag


This container is then divided into 12 equal parts indicating a block of layout. Basic concept of layout is a tabular structure. But tables have drawbacks in layout as we cannot overlap table on each other and it is very strict with columnar and row-wise structure.


Here bootstrap we use this 12 parts scheme to layout our visual components in a div with class name row
and each unit we show has class name starting with col-[+]-[*]
Note:
[+] here indicates values as lg(large screen), md(lappy/desktop), sm(tablet), xs(mobile)
[*] here indicates value from 1 to 12


One thing to understand here is that the value you set for one component should be either 12 or components in row(div) should addup to 12


Lets say layout we wish is two column for desktop display the code will look like


1
2
3
4
<div class="row">
  <div class="col-md-8"></div>
  <div class="col-md-4"></div>
</div>


This will divide page to give output somewhat like in image below:


Getting started with bootstrap [setting up]

CDN URL
CSS: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
JS   : https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js

index.html source code


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hello World Example</title>
    <link href="[css cdn url/relative path]" rel="stylesheet">
    <script src="[js cdn url/relative path]"></script>
</head>
    <body>
        <h1>Hello, world!</h1>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    </body>Example
</html>

Ńote:
On line no. 8 and 9 you can replace the CDN url mentioned above or download files and set relative path to source code.

Git go to any moment (commit) in time

Get this straight you are accessing repo thats already setup and has commits branches etc in it


Here's how you go to any period of commit in a repo status
Git repo url :  https://github.com/thatsmekaustubh/appengine.git
You start by cloning it in your working directory

git clone https://github.com/thatsmekaustubh/appengine.git 004appengine


To know all commits you can find it using this command

git log


To know all branches you can find it using this command

git show-branch -a


This shall give a picture of all flows of development
this in present moment of time is

start__masterBranch
      |__experimentsBranch

Commits were

  • false commit (hello world example)
  • Hello world example with commmand to run
  • Users API example 
The command shows
git log
all commit id's
You can switch between branches as
git checkout <branchname>

And go to particular commit by saying 

git checkout <commitid>

Github getting started

Account Part:
Signup to github and then login
once logged in you will see my repo in which you should click on Create New Repository
    Fill in details and say create
On the machine you wish to code and submit changes to github you need a SSH key setup on both peers (mentioned in another tutorial)


Coding Part:
Say,
git init 
on your code whereever it is

Code your files (Note: that you are on master right now) [detailed post on branching and merging]

To add all changes say
git add --all
(this stages all non-committed files)

To commit say,
git commit -m 'Your message for the commit'


Syncing part:
You might want to sync this changes to github website so,
Type this 
git remote add origin https://github.com/<username>/<reponame>.git


To send commit to server type
git push --all


This shall get your code on git hub open repository to be shared with all

Thursday, August 25, 2016

Hello world | Google App Engine | Python | Cloud9IDE (EDIT REQ)



Create following files in a directory by name helloWorld
           this setup is public on c9.io; to see click here
main.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
import webapp2


class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write('Hello, World!')

app = webapp2.WSGIApplication([
    ('/', MainPage),
], debug=True)


main_test.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import webtest

import main


def test_get():
    app = webtest.TestApp(main.app)

    response = app.get('/')

    assert response.status_int == 200
    assert response.body == 'Hello, World!'


app.yaml
1
2
3
4
5
6
7
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: main.app


Run your project as follows :
python googleAppEngineSDK/google_appengine/dev_appserver.py --host $IP --port 8081 --admin_host $IP --admin_port 8082 projects/helloWorld

Setting up c9.io (ubuntu) with Google App Engine SDK - PYTHON

I try to cover as much of steps required as possible in my posts but dont include them all in one post so that one doesnt get bombarded with information. Please refere to pre-requisite section with reference sufficient for you; if it doesnt exist please mention so in comment.


Pre-requisite :
c9.io account
Create a workspace with Python Config

STEPS:
Go to shell copy paste one at a time
STEP(1) Get SDK from Google to you c9.io workspace
wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.40.zip
STEP(2) Unzip the sdk package
unzip google_appengine_1.9.40.zip
STEP(3) Set path variable for future reference
export PATH=$PATH:/home/ubuntu/workspace/googleAppEngineSDK/google_appengine/


Reference : Google Docs

Creating Sheet using Google Drive Excel (Shared Manner)

Step 1 Go to drive.google.com
You need to login using your google account (xyz@gmail.com/ xyz@company.com)
Step 2 Click on new and select sheets
Step 3 Set any name at top where it says Untitled sheet and press save
Step 4 Next click on share to share it with any email id.
Note: In case you are using company email id you can only share the document with other emails within company domain ex. xyz@company.com can share it with someone like abc@company.com and not abc@gmail.com (mostly.. exceptions can be added by company google account admin)
Share can be done in one of three manner :
  1. readonly : where in other user can only read the document contents
  2. comment : where in other user can read and comment on the document contents
  3. edit : where in other user can read, commment edit the document contents
There can be one more option for sharing sheet publicly with one of the above three manner. Which means any one with link can perform that specified operations. To do so you simply need to copy and message URL to your contact

Monday, August 17, 2015

Review Lenovo Note K3

Hey there folks, its been a week now for me using my new mobile Lenovo Note K3 and here is my feedback about it as a regular IT guy.

This phablet pretty much sums it all, you get a descent screen size and great computing power to do your daily tasks. Especially for guies like me there is a gud news you can comfortably code, read, watch videos and play games. Lenovo has taken a gud effort designing this phone keeping it sleek and yet functional not to forget at a reasonable price.

Heating problem? You must be a die hard gamer to face this issue. So far I barely experienced any heating issue, but when I did it was in top center on back of device (when I was not using any case)

Full HD is a real delight! I am enjoying watching my favorite videos on this device. Sound quality is pretty gud and obviously if you need to rock your house with sound you need a speaker it isn't the fault of device manufacturers that they haven't housed a home entertainment system in your mobile. I have enjoyed songs in room full of 15 people partying, on local station, on the road and other crowded places full of noise and quality is satisfactorily audible in adverse situations.

Camera on both front and rear are delight, we took a selfie in theatre which explains it all.

Functionalities
As a developer: Yes I am coding with this device, not just coding I am building  websites, and apps with this device. So you get the idea college students and lite coders.
As a commuter: Except for Virar Locals from Mumbai I can call this phablet as a handy device, to check schedules, read feeds, books, papers play games. Your hands wont get tired that easily.
As a reader: I haven't finished any book yet but have read a couple of journal papers on this device and it was comfortable.
As a Mobile User: I know its crazy but I am getting better cell reception at all places, this was unexpected from any smartphone as I always had to search and re search and choose network 4 times a day!

Bottom line: If you are any one else then a die hard gamer or a graphic designer (who draw - which needs stylus) or a person spending most of the time on voice calls this is a phablet/ smartphone for you; and trust me it cant go any better at this pricing.

Quick setup Phonegap Development Environment using Docker

INTRO NOTE : Pre-requisite is to have ubuntu 16.04 Following DIGITAL OCEAN tutorial for same...