Mirroring a Git repository

Cloning a repository locally and changing git remote didn’t work for me. Here is a clean way to achieve the same.

  1. git clone –bare https://bitbucket……/your-repo.git
  2. cd your-repo.git
  3. git push –mirror https://bitbucket……/mirror-repo.git
  4. cd ../
  5. rm -rf  your-repo.git

 

Posted in Uncategorized | Leave a comment

Mongo Aggregate query using date part of ISODate.

Most of the time we only need date part of  iso date in any document during an aggregation. Here is how to get the date part for aggregation,

  1. Project ( $project ) as a new filed, say “considered_date”
  2. Group with the field

Example

db.collection.aggregate([
{$match : {  any filtering with $match }}
,{$project : { _id :1 , any project fileds
, “considered_date” :      {“$concat” : [
{“$substr” : [{“$dayOfMonth” : “$date_1”}, 0, 2]}, “-“,
{“$substr” : [{“$month” : “$date_1”}, 0, 2]}, “-“,
{“$substr” : [{“$year” : “$date_1”}, 0, 4]}
]} } }
,{$lookup : { any lookups}}
//,any other filtering
,{$group : { _id : { “filed 1″:”$field1”, “date”:”$considered_date” }, “count”:{$sum:1} }}
])

Posted in Uncategorized | Leave a comment

Remount without reboot

  1. Mount with follwoign command :

    mount -t cifs //server/foldertomount  /mnt/mount_location -o username=xxx,password=yyyy,domain=yourdomain

  2. nano /etc/ftab
  3. add //server/foldertomount /mnt/mount_location cifs gid=users,file_mode=0777,dir_mode=0777,auto,username=xxx,password=yyy,domain=yourdomain 0 0
  4. run mount -a

Reference : Click to view

Posted in Uncategorized | Leave a comment

First Omega2+ project ( Hello World -blinking LED )

Refer below link for the complete tutorial ,

http://www.cnx-software.com/2017/01/16/getting-started-with-onion-omega2-lede-wifi-iot-board-and-expansion-dock/

img_1119

Script File

==========

  1. Make sure Omega2+ firmware is updated.
  2. chmod +x  scriptfile.sh

#!/bin/ash

## Simple script to blink a LED on the Onion Omega using gpioctl

## the variable that will hold the pin number, where the LED lamp is connected

LED_PIN=1

## declare the LED_PIN as output

gpioctl dirout-low $LED_PIN

while true

do

## set LED_PIN to HIGH (turn LED on)

gpioctl dirout-high $LED_PIN

## sleep for 1 second (equivalent to Arduino’s delay(1000)

sleep 1

## set LED_PIN to LOW (turn LED off)

gpioctl dirout-low $LED_PIN

## sleep for 1 second (equivalent to Arduino’s delay(1000)

sleep 1

done

Posted in Uncategorized | Leave a comment

Integrate Angular 2 Front End with Spring-boot

Click here to view

Posted in AngularJS, Spring-Boot | Leave a comment

Pointing a domain to the Heroku app with Namecheap

Click this link to view

Posted in Uncategorized | Leave a comment

Customising Bootstrap Gutter

Simple way to customise gutters.

http://arnique.net/web-design/58/a-quick-guide-to-changing-bootstraps-gutter-width/

 

Posted in Uncategorized | Leave a comment