Skip to content

Instantly share code, notes, and snippets.

View Yogendra0Sharma's full-sized avatar
🎯
Focusing

Yogendra Sharma Yogendra0Sharma

🎯
Focusing
View GitHub Profile
@Yogendra0Sharma
Yogendra0Sharma / angularjs.md
Created January 12, 2017 08:47 — forked from suhailvs/angularjs.md
Angularjs Task add/edit example

First create backend endpoints using Django Rest Framework:

task/models

from django.db import models
class Task(models.Model):
    completed = models.BooleanField(default=False)
    title = models.CharField(max_length=100)
    description = models.TextField()
@Yogendra0Sharma
Yogendra0Sharma / angularjs.py
Created January 12, 2017 08:48 — forked from atabary/angularjs.py
Django and angular.js are using a conflicting templating syntax, relying on double curly brackets, eg. `{{ something }}`. This template-tag mitigate the problem by allowing the use of {% ng something %} in a django template, which is then outputed as {{ something }} for angular.js to use.
"""
filename: angularjs.py
Usage:
{% ng Some.angular.scope.content %}
e.g.
{% load angularjs %}
<div ng-init="yourName = 'foobar'">
<p>{% ng yourName %}</p>
@Yogendra0Sharma
Yogendra0Sharma / PythonVirtualEnv.md
Created January 12, 2017 10:51
Howto Setup a Python Virtual Environment

Python Virtual Environment Howto

##SETUP VIRTUALENV on Ubuntu Server

console: ~ $ sudo apt-get install python-virtualenv
console: ~ $ virtualenv python #Careful where you call this command as it creates a folder in the current directory
console: ~ $ source ./python/bin/activate
console: ~ $ deactivate
  • IF YOU WANT TO DELETE A VIRTUALENV JUST DELETE THE FOLDER
@Yogendra0Sharma
Yogendra0Sharma / changeNameAndEmailOldGitCommits.md
Created January 12, 2017 10:52
Change the name and email address of old commits to a repository
$ git rebase -i HEAD~15 # change pick to edit of those you want to change
$ git commit --amend --author="tripattern <systems@tripattern.com>"
$ git rebase --continue
$ # Do the above several times until there are no items left to rebase
$ git push -f
@Yogendra0Sharma
Yogendra0Sharma / installJavaUbuntu.md
Created January 12, 2017 10:52
Install Java on Ubuntu

SDK

  • Download the appropriate tarball from oracle
  • Extract in a temporary location
  • Move extracted folder to /usr/lib/jvm : sudo mv /path/to/jdk1.8.0_20 /usr/lib/jvm/oracle_jdk8
  • Create File /etc/profile.d/oraclejdk.sh with following contents... ($ sudo vim /etc/profile.d/oraclejdk.sh)
export J2SDKDIR=/usr/lib/jvm/oracle_jdk8
export J2REDIR=/usr/lib/jvm/oracle_jdk8/jre
export PATH=$PATH:/usr/lib/jvm/oracle_jdk8/bin:/usr/lib/jvm/oracle_jdk8/db/bin:/usr/lib/jvm/oracle_jdk8/jre/bin
export JAVA_HOME=/usr/lib/jvm/oracle_jdk8
@Yogendra0Sharma
Yogendra0Sharma / Github.md
Created January 12, 2017 10:53
Github Tips and Tricks

#Setup Git in Ubuntu

OS:  Linux
Version: Ubuntu 14.04 LTS
```
##Setup git
* Download and Install
```
$ sudo apt-get install git
```
@Yogendra0Sharma
Yogendra0Sharma / SshKeys.md
Created January 12, 2017 10:53
Setting up SSH Private & Public Keys

#Setting up SSH Private & Public Keys

##SSH 2

  • On the machine you want to SSH from (local machine) type
$ ssh-keygen -t rsa #simply press enter several times..
$ ssh-keygen -t dsa #Note dsa is deprecated by default in openshh version 7!!!!

Copy the content of the file:

@Yogendra0Sharma
Yogendra0Sharma / LinuxUsers.md
Created January 12, 2017 10:53
Adding, Editng and Deleting Users in Linux

#Create Sudo User in Ubuntu Howto

##Add an User

$ useradd name_of_sudo_user -m # the extra options ensure the home directory is included
$ passwd name_of_sudo_user

##If you get a funny shell as User - No Tab completion etc...

  • User was created with sh shell. Change to bash
@Yogendra0Sharma
Yogendra0Sharma / NodeJs.md
Created January 12, 2017 10:53
Node JS Tips and Tricks

Installing, Deleting, Updating Components

$ npm install < Package Unique Name>
$ npm install –g < Package Unique Name>
$ npm uninstall < Package Unique Name>
$ npm uninstall –g < Package Unique Name>
$ npm update < Package Unique Name>
$ npm update –g < Package Unique Name>

@Yogendra0Sharma
Yogendra0Sharma / BootstrapInstallation.md
Last active January 12, 2017 10:53
Bootstrap Setup

#Installation

##Ubuntu 14.04 - Standard Package

$ sudo apt-get update
$ sudo apt-get install -y build-essential openssl libssl-dev pkg-config
$ sudo apt-get install nodejs # installs nodejs globally
$ sudo ln -s /usr/bin/nodejs /usr/bin/node # to avoid this error when using nodejs apps "/usr/bin/env: node: No such file or directory"
$ sudo apt-get install npm
$ sudo npm install -g bower # installs bower globally