Skip to content

Instantly share code, notes, and snippets.

View atulsingh0's full-sized avatar
🎯
Focusing

Atul S atulsingh0

🎯
Focusing
View GitHub Profile
@atulsingh0
atulsingh0 / array_reference.perl
Created April 24, 2013 13:22
Perl code for Array referencing
#!/usr/bin/perl
@a = (1, 2, 3); # original array
$aRef = \@a; # reference to the array
print "a: @a\n"; # prints "a: 1 2 3"
print "a: @$aRef\n"; # exactly the same
@atulsingh0
atulsingh0 / read_file.perl
Created April 24, 2013 13:23
Perl code To Read and print the file
#!/usr/bin/perl
open (FILEHANDLE, "file.txt");
while(<FILEHANDLE>)
{
print "$_\n";
}
@atulsingh0
atulsingh0 / 1st_char.perl
Created April 24, 2013 13:24
Perl Code To Print the 1st character of a file
#!/usr/bin/perl
open (FILEHANDLE, "< new.pl") or die "oops: $!";
@each = FILEHANDLE;
my $char = getc $each[0];
print $char;
close(FILEHANDLE);
@atulsingh0
atulsingh0 / teraJDBCcon.java
Created May 2, 2013 02:46
JDBC connection with TeraData
Class.forName("com.teradata.jdbc.TeraDriver");
String connectionString = "jdbc:teradata://MyDatabaseServer/database=MyDatabaseName,tmode=ANSI,charset=UTF8";
String user = "username";
String passwd = "password";
Connection conn = DriverManager.getConnection(connectionString, user, password);
@atulsingh0
atulsingh0 / DSjobMasterControl.sh
Created May 14, 2013 04:42
UNIX Script to execute DataStage job by Kenneth Bland
#!/bin/ksh
#######
################################################################################
#######
####### FILE: DSjobMasterControl.ksh
#######
####### DESCRIPTION: Starts a DataStage MasterControl type job passing
####### all runtime parameter values
#######
#######
@atulsingh0
atulsingh0 / get_dbsize_oracle.sql
Created June 14, 2013 17:42
Oracle DB Size :- Normally the size of the database is denoted by total size of the physical data files. This query will help you to manage the space occupied by your database.
clear breaks
clear computes
clear columns
set pagesize 50
set linesize 120
set heading on
column tablespace_name heading 'Tablespace' justify left format a20 truncated
column tbsize heading 'Size|(Mb) ' justify left format 9,999,999.99
column tbused heading 'Used|(Mb) ' justify right format 9,999,999.99
column tbfree heading 'Free|(Mb) ' justify right format 9,999,999.99
@atulsingh0
atulsingh0 / search_pattern.sh
Last active June 26, 2021 04:32
This script will ask the file name and the pattern which need to be searched in file and give the formatted output with the line no with line. You can select the no of lines which display before and after the string.
#!/bin/ksh
echo "enter the file name"
read V_file_name
echo "enter the string to be searched"
read V_string
line_num=`grep -n "$V_string" $V_file_name|awk -F":" '{print $1}'`
@atulsingh0
atulsingh0 / cleanup_abandoned_locks.sh
Created December 13, 2013 14:05
For users of DataStage 8.x, a script has been provided to assist with cleanup of locks. Login to the DataStage server with the DataStage administrator id and run the following script: cleanup_abandoned_locks.sh This script resides in the ASBServer/bin directory, for example: /opt/IBM/InformationServer/ASBServer/bin
#!/bin/sh
# This file was generated by the xmeta commons-launcher maven plugin.
# Do not edit this file directly.
myPath=`dirname $0`
case `uname` in
CYGWIN*) # cygwin-specific stuff here
myPath=`cygpath -w "$myPath"`
;;
esac
@atulsingh0
atulsingh0 / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa