Skip to content

Instantly share code, notes, and snippets.

View FilBot3's full-sized avatar
😀
Working hard

FilBot3 FilBot3

😀
Working hard
View GitHub Profile
@FilBot3
FilBot3 / get_heap_used.sh
Last active December 5, 2015 08:01
jmx4r example.
CMD="get -b java.lang:type=Memory HeapMemoryUsage"
echo $CMD | java -jar jmxterm-1.0-alpha-4-uber.jar -l localhost:1099 -n
@FilBot3
FilBot3 / ruby_threading_example_1.rb
Last active December 21, 2015 03:48
Ruby Threading Example
#!/usr/bin/env ruby
#
#
#
@threads = []
6.times do |i|
@threads[i] = Thread.new do
sum = 1 + rand(100)
@FilBot3
FilBot3 / ruby_check_yaml_example_1.rb
Last active February 10, 2016 15:20
Writing and Reading YAML from both Ruby code, and YAML Markup
#!/usr/bin/env ruby
#
#
#
require 'yaml'
require 'fileutils'
def create_config_file
default_options = {
"ruby_dir" => "#{ENV['HOME']}/rubies",
@FilBot3
FilBot3 / zabbix_sender_example.sh
Created February 8, 2016 21:18
Zabbix Sender Examples
zabbix_sender -vv --config /etc/zabbix/zabbix_agentd.conf --host "Zabbix server" --key chatops.test.value --value 0
zabbix_sender -vv --config /etc/zabbix/zabbix_agentd.conf --host "Zabbix server" --key chatops.test.value --value 1
@FilBot3
FilBot3 / ps_delete_older_than_x_days.ps1
Created February 15, 2016 21:53
PowerShell Delete files older than x days
$limit = (Get-Date).AddDays(-2)
$path = "E:\SSP\AttachContent"
# Delete files older than the $limit.
Get-ChildItem -Path $path -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force
# Delete any empty directories left behind after deleting the old files.
Get-ChildItem -Path $path -Recurse -Force | Where-Object { $_.PSIsContainer -and (Get-ChildItem -Path $_.FullName -Recurse -Force | Where-Object { !$_.PSIsContainer }) -eq $null } | Remove-Item -Force -Recurse
@FilBot3
FilBot3 / nested_json.go
Created April 25, 2016 19:17
Nested JSON in GOLang
/**
*
*/
package main
import (
"encoding/json"
"fmt"
)
@FilBot3
FilBot3 / errors_choke_on_ampersand.sh
Last active June 3, 2016 21:55
cem_sender cli errors
C:\Users\PD028300\Desktop\cem_sender (master)
λ bundle exec ruby exe\cem_sender send "http://10.160.5.117/NextGenEMWeb/json/*/sendevent" "Farts and stuff" "{\"type\":\"ns0:ListOfEventAttributes\",\"EventAttribute\":[{\"attrname\":\"cer_impacted_asset\",\"attrvalue\":\"cesservername00.northamerica.cerner.net\"},{\"attrname\":\"mc_object\",\"attrvalue\":\"Test-Param-Instance\"},{\"attrname\":\"mc_parameter\",\"attrvalue\":\"TEST-PARAM\"},{\"attrname\":\"mc_parameter_value\",\"attrvalue\":\"5\"},{\"attrname\":\"severity\",\"attrvalue\":\"Average\"},{\"attrname\":\"cer_contact\",\"attrvalue\":\"csmzabbix\"},{\"attrname\":\"message\",\"attrvalue\":\"The JVM is being checked once a minute, and if the CPU is at 200% five times, then this trigger fires. \\\\nThe JVM is using a lot of CPU power, and could possibly be starving the server. \\\\n\\\\nView this screen for historical trends. \\\\n\\\\nhttp://corporatezabbix/zabbix/screens.php?ddreset=1\\&sid=448fd0a5c0d94068\\\\n\\\\nCEM_PARAM[TEST-PARAM]\"},{\"attrname\":
@FilBot3
FilBot3 / wsadmin_Restart_Application.py
Created June 30, 2016 02:58
Restart an IBM WAS ND Application
#
#
#
import sys
# Gets the Cell Name for the environment
cell_name = AdminControl.getCell()
# Node Name
node_name = sys.argv[0]
@FilBot3
FilBot3 / go-yaml_practice.go
Last active July 7, 2016 03:07
GO go-yaml read, parse, and write. The indentations are a bit off on the write.
/**
*
*
*/
package main
import (
"fmt"
"gopkg.in/yaml.v2"
@FilBot3
FilBot3 / go_slice_with_nested_maps.go
Last active September 23, 2016 02:09
Nested Maps in Slices with GO.
package main
import "fmt"
func main() {
// Initalize a Slice that holds Maps of strings
slice_1 := make([]map[string]string, 0)
// Initialize a Map of string keys and string values
map_1 := make(map[string]string)
// Assign a Key, key, and a value, farts