Skip to content

Instantly share code, notes, and snippets.

View nmattam's full-sized avatar

Nibin Abraham Mattam nmattam

View GitHub Profile
class Solution(object):
def convert(self, s, numRows):
"""
:type s: str
:type numRows: int
:rtype: str
"""
rows, cols = (numRows, 14)
a = [[0]*cols]*rows
Apr 10 18:39:39 esbk208a kernel: [ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name
Apr 10 18:39:39 esbk208a kernel: [ 1349] 0 1349 8782 0 23 84 0 systemd-journal
Apr 10 18:39:39 esbk208a kernel: [ 1366] 0 1366 48222 0 30 394 0 lvmetad
Apr 10 18:39:39 esbk208a kernel: [ 1380] 0 1380 11925 1 26 549 -1000 systemd-udevd
Apr 10 18:39:39 esbk208a kernel: [ 2447] 0 2447 15511 0 28 163 -1000 auditd
Apr 10 18:39:39 esbk208a kernel: [ 2474] 81 2474 16615 69 35 112 -900 dbus-daemon
Apr 10 18:39:39 esbk208a kernel: [ 2484] 999 2484 153249 0 62 1061 0 polkitd
Apr 10 18:39:39 esbk208a kernel: [ 2485] 0 2485 6594 0 19 78 0 systemd-logind
Apr 10 18:39:39 esbk208a kernel: [ 2488] 0 2488 24899 0 36 172 0 gssproxy
Apr 10 18:39
==> f_default: * ruby_block[restart-splunk-for-ulimit] action run
==> f_default: [2019-04-10T18:22:04+00:00] INFO: ruby_block[restart-splunk-for-ulimit] called
==> f_default:
==> f_default: - execute the ruby block restart-splunk-for-ulimit
==> f_default:
==> f_default: [2019-04-10T18:22:04+00:00] INFO: ruby_block[restart-splunk-for-ulimit] sending touch action to file[splunk-marker] (immediate)
==> f_default: Recipe: cerner_splunk::_restart_marker
==> f_default: * file[splunk-marker] action touch
==> f_default: [2019-04-10T18:22:04+00:00] INFO: file[splunk-marker] updated atime and mtime to 2019-04-10 18:22:04 +0000
==> f_default:
==> chef: Running provisioner: shell...
chef: Running: inline script
==> chef: [2019-04-10 13:51:32] INFO WEBrick 1.3.1
==> chef: [2019-04-10 13:51:32] INFO ruby 2.4.3 (2017-12-14) [x86_64-linux]
==> chef: [2019-04-10 13:51:32] INFO WEBrick::HTTPServer#start: pid=4702 port=5000
==> s_standalone: Box 'bento/centos-7.6' could not be found. Attempting to find and install...
s_standalone: Box Provider: virtualbox
s_standalone: Box Version: >= 0
The box 'bento/centos-7.6' could not be found or
could not be accessed in the remote catalog. If this is a private
==> c1_master: Bundle complete! 2 Gemfile dependencies, 3 gems now installed.
==> c1_master: Use `bundle show [gemname]` to see where a bundled gem is installed.
==> c1_master: Compiling Cookbooks...
==> c1_master:
==> c1_master: ================================================================================
==> c1_master: Recipe Compile Error
==> c1_master: ================================================================================
==> c1_master:
==> c1_master:
==> c1_master: Chef::Exceptions::RecipeNotFound
@nmattam
nmattam / gist:bcfbc8a4ebd9a520c2ac50ab0137e58f
Last active April 4, 2022 12:09
[Splunk] Automate "Apply Changes" for Monitoring Console
# Create DMC groups
# This is basically updating the system/local/distsearch.conf
# I got all the IPs used below from /servicesNS/admin/-/search/distributed/peers. I used DNS names for search head (I had only one SH) and cluster master. So it was easy to separate the indexer IPs.
# 8089 is my API PORT
curl -k -u <user>:<password> <Monitoring Console>/services/search/distributed/groups -d name=dmc_group_search_head -d member=<search_head_member1:8089> -d member=<search_head_member2:8089> -d default=false
curl -k -u <user>:<password> <Monitoring Console>/services/search/distributed/groups -d name=dmc_group_cluster_master -d member=<cluster_master:8089> -d default=false
curl -k -u <user>:<password> <Monitoring Console>/services/search/distributed/groups -d name=dmc_group_indexer -d member=<indexer1:8089> -d member=<indexer2:8089> -d default=true # not idea why default=true for indexers
curl -k -u <user>:<password> <Monitoring Console>/services/search/distributed/groups -d name=dmc_indexerclustergroup_<CLUSTER_L
sudo killall -HUP mDNSResponder
M1617579:cerner_splunk na032313$ git diff
diff --git a/Vagrantfile b/Vagrantfile
index 6560d6a..75633c6 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -45,6 +45,7 @@ fail 'Non-unique ports' if @network.collect { |_, v| v[:ports].keys }.flat_map {
def default_omnibus(config)
config.omnibus.chef_version = '12'
+ config.omnibus.install_url = 'https://packages.chef.io/files/stable/chef/12.17.44/windows/2012r2/chef-client-12.17.44-1-x64.msi'
require 'aws-sdk'
require 'net/http'
require 'nokogiri'
require 'sendgrid-ruby'
notify = ENV['notify']
sendgrid_token = ENV['SENDGRID_API_TOKEN']
# set this hash to empty so that google doesn't index these URLs from github.
[vagrant@secondary-chef ~]$ sudo chef-server-ctl ha-status
[OK] keepalived HA services enabled.
[OK] cluster status = master
[OK] found VIP IP address and I am master
[OK] found VRRP communications interface eth1
[OK] bookshelf is running correctly, and I am master.
[OK] keepalived is running.
[OK] nginx is running correctly, and I am master.
[OK] oc_bifrost is running correctly, and I am master.
[OK] oc_id is running correctly, and I am master.