Skip to content

Instantly share code, notes, and snippets.

View AKSarav's full-sized avatar
🎯
Focusing

Sarav AKSarav

🎯
Focusing
View GitHub Profile
@AKSarav
AKSarav / get_wls_apps-XL.py
Last active December 6, 2017 21:51
Weblogic Application Deployment Parser
#!/usr/bin/python
import os
import sys
import subprocess
from sys import argv
from os.path import exists
import re
from collections import deque
from itertools import chain
import xlsxwriter
@AKSarav
AKSarav / get_wls_apps.py
Created December 6, 2017 22:22
Weblogic Application Deployment Parser - With No Excel Report
#!/usr/bin/python
import os
import sys
import subprocess
from sys import argv
from os.path import exists
import re
from collections import deque
from itertools import chain
@AKSarav
AKSarav / get_wls_serverstate.py
Created December 20, 2017 17:53
get_wls_serverstate.py
#connect([username],[password],[admin url])
connect('weblogic','weblogic1','t3://mwi-vm01:17001')
servers=cmo.getServers()
print "-------------------------------------------------------"
print "\t"+cmo.getName()+" domain status"
print "-------------------------------------------------------"
for server in servers:
state(server.getName(),server.getType())
print "-------------------------------------------------------"
@AKSarav
AKSarav / get_wls_appstate.py
Created December 21, 2017 21:18
get_wls_appstate.py
connect('weblogic','Bea@h0me','t3://ulweblogic04.wil.csc.local:33011')
myapps=cmo.getAppDeployments()
print " -------------------------------------------------- "
print " WLS APPLICATION STATUS REPORTER "
print " -------------------------------------------------- "
print " APPLICATION NAME\t\t\tSTATUS \t"
print " -------------------------------------------------- "
for app in myapps:
bean=getMBean('/AppDeployments/'+app.getName()+'/Targets/')
targetsbean=bean.getTargets()
@AKSarav
AKSarav / appstate.sh
Created December 21, 2017 21:19
appstate.sh
#!/bin/bash
# Date: 12-21-2017
# Author: Sarav
# Name: appstate.sh
#
#
BASEDIR=`dirname $0`
SCRIPT_FILE=$BASEDIR"/appstate.py"
java weblogic.WLST $SCRIPT_FILE > appstate.out
@AKSarav
AKSarav / SnoopFilter.java
Created December 28, 2017 16:43
SnoopFilter.java
package com.logger.app;
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
@AKSarav
AKSarav / web.xml
Created December 28, 2017 16:48
Logger-Filter-Application's web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>LoggerWebApp</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
@AKSarav
AKSarav / WebhookToAirtable.php
Last active April 27, 2018 20:50
Webhook program to receive data from some remote client and process it and send to Airtable and add a record in table
<?php
class Processor {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s \n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
);
foreach ($this->getHeaderList() as $name => $value) {
@AKSarav
AKSarav / f5-GetAllPartition-PersistenceProfile_VIP_Mapping.py
Created May 23, 2018 22:34
f5-GetAllPartition-PersistenceProfile_VIP_Mapping.py
#!/usr/bin/python
import subprocess
import re
import sys
from sys import argv
# Class Declaration
class VIPDICT(list):
def __init__(self, name):
@AKSarav
AKSarav / wls_domain_creator.py
Last active April 24, 2019 16:56
wls_domain_creator.py
import sys
import os
from os.path import exists
from sys import argv
def get_script_path():
return os.path.dirname(os.path.realpath(sys.argv[0]))
def parsefile():