Monday, December 18, 2017

How to remove untracked/ignored files and directories from git local repository


There is always be a need to remove the unwanted files and directories from the git to clean the git local repo, but sometimes it's a tedious job to do if we are not aware of some simple cool features that are offered by git, such as git clean, there is a wonderful and informative article available in git docs.

Here I wanted to give you some useful commands that do the required job of cleaning the untracked or ignored files and directories from the git repo.

This is written according to the git documentation provided here. This should not be considered as a complete guide to git clean.


  • Run this command to see what are the files or dirs going be removed: git clean -n  or   git clean --dry-run 

    So it doesn't actually remove anything, just show what would be done.
  • Run this command to delete the files or directories actually: git cleanBeware that it removes the files and directories permanently!!

    If you want to remove directories, run git clean -f -d or git clean -fd
    If you want to remove ignored files, run git clean -f -X or git clean -fX
    If you want to remove ignored and non-ignored files, run git clean -f -x or git clean -fx

  
It is always advisable to have a glance at the complete documentation at git! Have a look at git clean documentation for a clear understanding.

Monday, December 4, 2017

How to add line numbers attributes to java class files

Add this info to your javac command to add line number attributes to the generated class files: 

javac debug="true" debuglevel="lines,vars,source" includeantruntime="true"

Tuesday, November 7, 2017

[Solved] ORA-01034: ORACLE not available

Have you got stuck up with this error in Oracle DB startup?? Here is the solution:


D:\oracle\code>sqlplus system/Admin123@xe

SQL*Plus: Release 11.2.0.2.0 Production on Tue Nov 7 14:44:36 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Process ID: 0
Session ID: 0 Serial number: 0


Enter user-name: system
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Process ID: 0
Session ID: 0 Serial number: 0

Enter user-name:

D:\oracle\code>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Tue Nov 7 14:45:00 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL>
SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2260048 bytes
Variable Size             637535152 bytes
Database Buffers          423624704 bytes
Redo Buffers                5517312 bytes
Database mounted.
SQL> exit

Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production


D:\oracle\code>sqlplus system/Admin123@xe

SQL*Plus: Release 11.2.0.2.0 Production on Tue Nov 7 14:47:02 2017

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> exit
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

D:\oracle\code>




Thursday, August 3, 2017

How can we add colors and format the text in console in python 3

class color:     PURPLE = '\033[95m'     CYAN = '\033[96m'     DARKCYAN = '\033[36m'     BLUE = '\033[94m'     GREEN = '\033[92m'     YELLOW = '\033[93m'     RED = '\033[91m'     BOLD = '\033[1m'     UNDERLINE = '\033[4m'     END = '\033[0m'    print color.BOLD + 'Hello World !' + color.END

Tuesday, February 14, 2017

How to push NuGet package to NuGet server with ApiKey

These are the simple 3 steps that you can run to achieve this: 


  1. v:\krishna\nuget.exe sources Add -Name TPaaS-Snapshot-nuget  -Source https://artifactory.trimble.tools/artifactory/TPaaS-Snapshot-nuget/ -username {{username}} -password {{ApiKey}}
  2. v:\krishna\nuget.exe setapikey {{username}}:{{ApiKey}} -source https://artifactory.trimble.tools/artifactory/TPaaS-Snapshot-nuget/
  3.  v:\krishna\nuget.exe push {{package-path}}.nupkg -Source TPaaS-Snapshot-nuget