Skip to content

Instantly share code, notes, and snippets.

View iogbole's full-sized avatar

Israel Ogbole iogbole

View GitHub Profile
@iogbole
iogbole / simpleattach.sh
Created March 15, 2021 12:48
dynamic attach
#!/bin/bash
if [ "$#" -lt "1" ]
then echo "usage <uniqueString> [arg1,...]"
echo
echo "eg: ./simpleattach.sh wildfly appdynamics.controller.hostName=192.168.57.104,appdynamics.controller.port=8090,appdynamics.agent.applicationName=SimpleJBoss,appdynamics.agent.tierName=SimpleJBossOSX_T1,appdynamics.agent.nodeName=SimpleJBossOSX_T1_Server1"
exit
fi
echo $*
@iogbole
iogbole / ansible.yaml
Last active December 8, 2020 11:20
terminalizer_ansible.yaml
# The configurations that used for the recording, feel free to edit them
config:
# Specify a command to be executed
# like `/bin/bash -l`, `ls`, or any other commands
# the default is bash for Linux
# or powershell.exe for Windows
command: bash -l
# Specify the current working directory path
@iogbole
iogbole / ECS.json
Created September 15, 2020 13:42
AppDynamics ECS CloudFormation Template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"taskdefinition": {
"Type": "AWS::ECS::TaskDefinition",
"Properties": {
"RequiresCompatibilities": [
"EC2",
"FARGATE"
],
$ docker run --memory=500m --rm --env-file env.list.local iogbole/analytics-agent:20.6.0-win-nano
Basic conditions to enable analytics agent are met....
[2020-07-23T10:17:45,990-08:00] HV000001: Hibernate Validator 5.4.2.Final
[2020-07-23T10:17:46,555-08:00] Error occurred during initialization of VM
[2020-07-23T10:17:46,555-08:00] Could not reserve enough space for object heap
Analytics agent is not up yet, there might be an issue. Please note that it requires a minimum of 1GB heap space to start. Please contact support@appadynamics.com if the issue persists .
The analytics agent container will continue to run to prevent the entire pod from crashing - to ensure your main container continues to server its purpose
@iogbole
iogbole / mysql-initialization-with-init-container.yaml
Created July 21, 2020 21:45 — forked from hossainemruz/mysql-initialization-with-init-container.yaml
This sample show how to use init container to download init.sql file and initialize mysql database using this file
# this pvc will be used to store downloaded init.sql file
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: init-script
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
@iogbole
iogbole / Get-PerformanceCounter.ps1
Created July 3, 2020 21:45 — forked from dstreefkerk/Get-PerformanceCounter.ps1
A quick PowerShell function to extract Windows' list of performance counters and their corresponding IDs
function Get-PerformanceCounter
{
# Get the Performance Counters from the Registry
$counters = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009' -Name 'counter' | Select-Object -ExpandProperty Counter
# Remove the last line
$counters = $counters | Select-Object -SkipLast 1
# Split the string into an array
$counters = $counters.Split([Environment]::NewLine)
@iogbole
iogbole / ckad-learning.md
Created June 26, 2020 22:52 — forked from benc-uk/ckad-learning.md
Certified Kubernetes Application Developer (CKAD)
function JSONProccessor {
jq '
def myMathFunc:
if (.name | test("^sum")) then
{"\(.name)": (.values | add)}
elif (.name | test("^avg|^global-avg")) then
{"\(.name)": ((.values | add) / (.values | length)) }
elif (.name | test("^max")) then
{"\(.name)": (.values | max) }
elif (.name | test("^min")) then
@iogbole
iogbole / MySQL Replication Check
Created April 19, 2020 21:26 — forked from OliverBailey/MySQL Replication Check
Just a simple Mysql Replication Health Check script I wrote. You can put this in a cron.
#!/bin/bash
### VARIABLES ### \
EMAIL=""
SERVER=$(hostname)
MYSQL_CHECK=$(mysql --login-path=mysql_login -e "SHOW VARIABLES LIKE '%version%';" || echo 1)
STATUS_LINE=$(mysql --login-path=mysql_login -e "SHOW SLAVE STATUS\G")"1"
LAST_ERRNO=$(grep "Last_Errno" <<< "$STATUS_LINE" | awk '{ print $2 }')
SECONDS_BEHIND_MASTER=$( grep "Seconds_Behind_Master" <<< "$STATUS_LINE" | awk '{ print $2 }')
IO_IS_RUNNING=$(grep "Slave_IO_Running:" <<< "$STATUS_LINE" | awk '{ print $2 }')
@iogbole
iogbole / AppDEnv.ps1
Created March 16, 2020 16:34
AppD Environment Variable Automation
$envHashTable = @{
"APPDYNAMICS_AGENT_APPLICATION_NAME"="test-application"
"APPDYNAMICS.CONTROLLER.HOSTNAME"="customer-dev.saas.appdynamics.com"
"APDDYNAMICS.CONTROLLER.PORT"="443"
"APDDYNAMICS.CONTROLLER.SSL.ENABLED"="true"
"appdynamics.analytics.agent.url"="https://<analytics-agent-ip>:9090/v2/sinks/bt"
}
$envHashTable.Keys | ForEach-Object {
$Name = $_