Monday, August 29, 2016

Friday, August 26, 2016

Git Tutorials

1.Initialize git repository

git init-It will create a new empty directory /.git/.The directory is hidden by default

2.Current status of git

git status-all file changes in the repository

3.Add newly created file to repository

git add filename-added file in staging area.not a part of repository yet.To store the file in repository we need to commit changes

4.Store file repository

git commit -m "commit commands"

5.Add Multiple of same type
use wildcard
git add ".txt"-where .txt is file extension

6.Log of commit
git log

7.Remote Repository
Create an account in git to use git remotely,create a project

To use git in remote repository
use
git remote add origin https://github.com/try-git/try_git.git
name of our remote is origin .default local branch is master

7.save all data to remote using push commands
 git push -u origin master
-u will save parameter,so next time only use git push

8.get changes in repository by pull command
git pull origin master

9.Find difference between two commit using diff command

git diff HEAD-Where head refers to last commit

Staged file are files that are ready to commit

10.remove a staged file using git reset
git reset staged file name

11.Files can be changes to how they were in last commit using git checkout command

git checkout -- filename

-- refers that no arguments after --

14.create a branch

mostly all bug anf features are commited to branch and merge to master

git branch branch name

15.show branch name

git branch

16.To switch between branch use git checkout branch name
git checkout branch name

17.To remove files from git use rm

git rm






Wednesday, July 13, 2016

Steps to Learn Python Programming

  1. Download the Anaconda distribution of Python for your platform - Linux, Mac, or Windows.
  2. Work your way through Learn Python the Hard Way on the web. This will take you perhaps 6 weeks.
  3. At this point you are competent to code, but not yet design
  4. Read and work the problems in chapters 1–14 of “Introduction to Algorithms” by Cormen as if your career depends on it. Because it does. This may take you 6 months.
  5. Read either “Fluent Python” or “Python for Data Analysis” to learn idiomatic programming.
  6. Learn another language, perhaps Java or Go or Swift. Implement a project in this language.
  7. Read “Design Patterns” or “Head First Design Patterns” to learn reusable aspects of program design. Make flash cards and test yourself.

Friday, July 8, 2016

Fork Bomb-Dangerous

:(){ :|: & };: – Fork Bomb

The following line is a simple-looking, but dangerous, bash function:
:(){ :|: & };:
This short line defines a shell function that creates new copies of itself. The process continually replicates itself, and its copies continually replicate themselves, quickly taking up all your CPU time and memory. This can cause your computer to freeze. It’s basically a denial-of-service attack.
The Lesson: Bash functions are powerful, even very short ones.

Git Origin,Upstream

The wiki is talking from a forked repo point of view. You have access to pull and push from origin, which will be your fork of the main diaspora repo. To pull in changes from this main repo, you add a remote, "upstream" in your local repo, pointing to this original and pull from it.
So "origin" is a clone of your fork repo, from which you push and pull. "Upstream" is a name for the main repo, from where you pull and keep a clone of your fork updated, but you don't have push access to it.

Wednesday, July 6, 2016

Linux Commands

1.  rm Command-Remove File or Directory
                     rm -r folder_name-Delete Folder
              rm -rf folder_name-Recursive deletion,force delete

2SCP Command-Used to copy file between hosts
                     scp -i ~/.ssh/fpem.pem -r  source destination

3SSH Command-For login into a remote mechine
                    ssh -i ~/.ssh/pem_file.pem ubuntu@host_system_name

4.  lscpu Command-Get CPU/System Information
                     lscpu

5.  Get Memory Information
                     cat /proc/meminfo

6.  Get Memory/CPU Information
                     top

7.  Rename a File
                     mv old_file_name new_file_name

8.  Extract tar File
                     tar -xvf tar_file_name.tar



                




Tuesday, June 28, 2016

Git Cheatsheet

Git Cheatsheet

Git Cheatsheet 2

Differenece between upstream and origin

git remote -v



git clone git url-To copy the repository

git add .

 git commit -m "datavase changes in frappe"

 git push

 vim .git/config