Skip to content

Instantly share code, notes, and snippets.

View mmaha's full-sized avatar

M Maha mmaha

  • Canada
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mmaha on github.
  • I am mmaha (https://keybase.io/mmaha) on keybase.
  • I have a public key whose fingerprint is CBD1 DEB9 D772 F906 FF2D 457F 9A95 E70D 7334 2690

To claim this, I am signing this object:

@mmaha
mmaha / Decode-Base64.md
Last active December 12, 2020 13:15
Decode SAML Assertion in Base64

Perl

perl -MMIME::Base64 -ne 'print decode_base64($_)' ./saml_input.txt | xmllint --format - | source-highlight  -s xml -f esc

Ruby

cat ./saml_input.txt | ruby -r Base64 -ne 'puts Base64.decode64($_)' | xmllint --format - | source-highlight  -s xml -f esc
@mmaha
mmaha / gist:4544164
Created January 16, 2013 02:35
Stop iptables on RHEL 6
# sudo service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
@mmaha
mmaha / dbstatus.sh
Last active September 30, 2015 03:27
Oracle Database Status script
#!/bin/sh
# Reference: http://docs.oracle.com/cd/B28359_01/server.111/b32009/strt_stp.htm
#
if [[ $EUID -ne 0 ]]; then
echo "This script needs to be run as root (or oracle)"
exit 1
fi
export ORACLE_HOME=`cat /etc/oratab | grep -v "^#" | grep -v "^$" | cut -d':' -f 2`
export ORACLE_SID=`cat /etc/oratab | grep -v "^#" | grep -v "^$" | cut -d':' -f 1`
@mmaha
mmaha / findWLSServers.sh
Created January 11, 2012 15:14
Find what weblogic servers are running
#!/bin/sh
ps -ef | grep "weblogic\.Name" | sed 's/.*weblogic\.Name=//g' | cut -d ' ' -f 1
connect('weblogic', 'Abcd1234', 't3://localhost:7001')
listLoggers(pattern="oracle.oam.*", target="oam_server1")
exit()
@mmaha
mmaha / gist:1472598
Created December 13, 2011 15:45
xargs with multiple commands
ls *.wlst | xargs -I{} -n 1 sh -c "echo '--- {} ---'; cat {}"
@mmaha
mmaha / gist:1402398
Created November 28, 2011 22:34
Oracle Identity and Access Management API Documentation
@mmaha
mmaha / gist:1296236
Created October 18, 2011 18:26
sqlplus startup & shutdown commands (ORACLE_HOME and ORACLE_SID needs to be set.)
Enter the following commands to shut down the instance:
$ sqlplus /nolog
SQL> CONNECT SYS/sys_password as SYSDBA
SQL> SHUTDOWN NORMAL
Enter the following commands to start the instance:
$ sqlplus /nolog
@mmaha
mmaha / glogin.sql
Created October 18, 2011 18:09
$ORACLE_HOME/sqlplus/admin/glogin.sql
SET sqlprompt '&_user:&_connect_identifier > '
define _editor=vi