Skip to content

Instantly share code, notes, and snippets.

View rajasgs's full-sized avatar

Raja CSP Raman rajasgs

  • Kwikee Labs
  • Toronto
View GitHub Profile
alias blah="/usr/bin/blah"
alias lh="ls -hal"
alias hiry="history"
alias clearme="history -c"
alias cls="clear"

Reset mysql root password in Mac OS:

First Stop MySQL:

  1. Go to: 'System Preferences' >> 'MySQL' and stop MySQL

OR,

  1. sudo /usr/local/mysql/support-files/mysql.server start
  2. sudo /usr/local/mysql/support-files/mysql.server stop
public class Oracle11GDebianTest {
private final static String DB_URL = "jdbc:oracle:thin:@//127.0.0.1:1522/XE";
private final static String USER = "SYSTEM";
private final static String PASS = "oracle";
public static void main(String[] args) {
Connection conn = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
@rajasgs
rajasgs / upc_check_digit.py
Created April 3, 2019 13:10 — forked from corpit/upc_check_digit.py
Calculate UPC-A check digit in Python
def add_check_digit(upc_str):
"""
Returns a 12 digit upc-a string from an 11-digit upc-a string by adding
a check digit
>>> add_check_digit('02345600007')
'023456000073'
>>> add_check_digit('21234567899')
'212345678992'
>>> add_check_digit('04210000526')
docker run -d --name or12cee \ --privileged -v $(pwd)/oradata:/u01/app/oracle \ -e ORACLE_ALLOW_REMOTE=true \ -p 8082:8080 -p 1521:1521 absolutapps/oracle-12c-ee
docker exec -it or12cee /bin/bash
docker logs -f or12cee
sqlplus system/oracle@//localhost:1521/orcl
SQL>desc v$instance;
package org.rj;
import java.sql.*;
public class Oracle12CEETest {
private final static String DB_URL = "jdbc:oracle:thin:@//127.0.0.1:1521/orcl";
private final static String USER = "system";
private final static String PASS = "oracle";
Postgres-Docker Installation:
docker pull postgres
mkdir -p $HOME/docker/volumes/postgres
docker run --name pgdocker -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres
docker exec -it pgdocker bash
#
get all commits
git rev-list --all --pretty=oneline
https://stackoverflow.com/questions/1314950/git-get-all-commits-and-blobs-they-created
#
how to cherry pick
git checkout p (target branch)
@rajasgs
rajasgs / install virtualenv ubuntu 16.04.md
Created August 1, 2019 14:33 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python