Skip to content

Instantly share code, notes, and snippets.

View AKSarav's full-sized avatar
🎯
Focusing

AK Sarav AKSarav

🎯
Focusing
View GitHub Profile
@AKSarav
AKSarav / Kubectl Diff Env variables
Created November 7, 2022 09:02
Kubectl Diff Env variables
diff <(kubectl get deployments deployment1 -n ns1 -o jsonpath='{range .spec.template.spec.containers[*].env[*]}{@.name}{"\n"}{end}'|sort) <(kubectl get deployments deployment2 -n ns2 -o jsonpath='{range .spec.template.spec.containers[*].env[*]}{@.name}{"\n"}{end}'|sort)
@AKSarav
AKSarav / logstash-tomcat.conf
Created November 20, 2019 22:50 — forked from chanjarster/logstash-tomcat.conf
Tomcat Access Log Logstash configration
input {
file {
path => "/path/to/tomcat/logs/localhost_access_log*.txt"
}
}
filter {
grok {
match => {
"message" => "%{COMBINEDAPACHELOG} %{IPORHOST:serverip} %{NUMBER:serverport} %{NUMBER:elapsed_millis} %{NOTSPACE:sessionid} %{QS:proxiedip} %{QS:loginame}"
@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 / 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 / AppStatus.py
Created March 29, 2018 06:54
AppStatus.py
connect('weblogic','weblogic1','t3://localhost:17001')
myapps=cmo.getAppDeployments()
outputbuffer=[]
outputbuffer.append("--"*40)
outputbuffer.append(" \t\t\tAPPLICATION STATUS WEBLOGIC\t\t")
outputbuffer.append("--"*40)
outputbuffer.append (" %-50s%20s" %("APPLICATION NAME","STATUS"))
outputbuffer.append("--"*40)
for app in myapps:
bean=getMBean('/AppDeployments/'+app.getName()+'/Targets/')
@AKSarav
AKSarav / AppStatus.py
Created March 28, 2018 16:04
WLST-AppStatus.py
connect('weblogic','weblogic1','t3://web.mwinventory.in:33011')
myapps=cmo.getAppDeployments()
print "--"*40
print " \t\t\tAPPLICATION STATUS WEBLOGIC\t\t"
print "--"*40
print " %-50s%20s" %("APPLICATION NAME","STATUS")
print "--"*40
for app in myapps:
bean=getMBean('/AppDeployments/'+app.getName()+'/Targets/')
targetsbean=bean.getTargets()
@AKSarav
AKSarav / SecureCLI-Curl.py
Last active July 20, 2022 13:06
SecureCLI-Curl.py
#!/usr/bin/python
#
#
# Author: aksarav@mwinventory.in
# Name: SecureCLI-Curl.py
# Date: 27-March-2018
#
#
import os
import sys
@AKSarav
AKSarav / Nodemanager
Last active July 20, 2022 13:10
NodeManager Startup Script
#!/bin/sh
#
# NodeManager Start/Stop NM
#
#
# chkconfig: 35 99 01
# description: Script for Starting/Stopping Admin Server
# source function library
. /etc/rc.d/init.d/functions
@AKSarav
AKSarav / WLS-TMPCACHELOGS-PURGE.sh
Last active July 20, 2022 13:12
WLS-TMPCACHELOGS-PURGE.sh
#!/bin/bash
# Name : WLS-TMPCACHELOGS-PURGE.sh
# Author : SaravAK
# Date : 4-21-2017
## DECLARATION SECTION
if [ "$(whoami)" != "weblogic" ]; then
echo "Script must be run as user: weblogic"
@AKSarav
AKSarav / wlsrestcli.py
Created March 18, 2018 05:50
weblogic REST ful CLI interface
#!/usr/bin/python
#
#
import os
import sys
import getpass
import time
import base64
import subprocess
import re