Skip to content

Instantly share code, notes, and snippets.

View skihero's full-sized avatar

Kish skihero

  • Amazon Mechanical Turk
  • Ooty
View GitHub Profile
@skihero
skihero / gist:86b829ec37d88e63b0c6afe647953f09
Created June 17, 2022 12:55
Movie Agora text translation
Late 4th century AD The Roman Empire began to collapse
Alexandria in the province of Egypt, still preserved part of its splendor. It owned one of the 7 wonders of the ancient world. the legendary lighthouse, and the largest known library.
The library was not only a cultural symbol. But religious a place where the pagans worshiped their ancestral gods.
The traditional pagan cult now coexisted in the city with the Jewish. And with an unstoppable religion, until recently Christianity was prohibited
****
After taking the library, many pagans converted to Christianity and Alexandria experienced a period of peace.
@skihero
skihero / AutoHotkey.ahk
Last active July 4, 2020 08:34
Bind Winkey and u to press Shift and up key x number of times
*#c::Run Calc.exe
#n::
Run Notepad
return
#u::Send +{Up 10}
#j::Send +{Down 10}
#a::
Send {Home 20}
CoordMode, Mouse, Screen
@skihero
skihero / buff_tessy
Created December 16, 2014 12:33
buff
from Tkinter import *
from PIL import Image, ImageTk, ImageDraw
import urllib2
IMG_URI = "https://raw.githubusercontent.com/skihero/cor3/master/image_sample.jpg"
IMG_NAME = "image_sample.jpg"
bbox = [ (16, 17, 118, 152),
@skihero
skihero / action_info_pg.pl
Created November 5, 2014 12:34
action_info
Quick hash to put normal action information in one place:
our $action_info = {
# Name # clusterwide? # helpstring
archive_ready => [1, 'Check the number of WAL files ready in the pg_xlog/archive_status'],
autovac_freeze => [1, 'Checks how close databases are to autovacuum_freeze_max_age.'],
backends => [1, 'Number of connections, compared to max_connections.'],
bloat => [0, 'Check for table and index bloat.'],
checkpoint => [1, 'Checks how long since the last checkpoint'],
cluster_id => [1, 'Checks the Database System Identifier'],
commitratio => [0, 'Report if the commit ratio of a database is too low.'],
@skihero
skihero / mem_info.pl
Created November 5, 2014 09:44
mem_info extraction in perl
my @meminfo = `/bin/cat /proc/meminfo`;
foreach (@meminfo) {
chomp;
if (/^Mem(Total|Free):\s+(\d+) kB/) {
my $counter_name = $1;
@skihero
skihero / attributes_default.rb
Created October 27, 2014 16:17
attributes/default.rb
cat attributes/default.rb
# nrpe packge options
default['nrpe']['package']['options'] = nil
# nrpe daemon user/group
default['nrpe']['user'] = 'nagios'
default['nrpe']['group'] = 'nagios'
# config file options
default['nrpe']['allow_bash_command_substitution'] = nil
@skihero
skihero / nrpe.cfg.erb
Created October 27, 2014 16:16
templates/default/nrpe.cfg.erb
cat templates/default/nrpe.cfg.erb
# Autogenerated by Chef.
<%= "log_facility=#{node['nrpe']['log_facility']}" unless node['nrpe']['log_facility'].nil? %>
<%= "allow_bash_command_substitution=#{node['nrpe']['allow_bash_command_substitution']}" unless node['nrpe']['allow_bash_command_substitution'].nil? %>
<%= "command_prefix=#{node['nrpe']['command_prefix']}" unless node['nrpe']['command_prefix'].nil? %>
pid_file=<%= node['nrpe']['pid_file'] %>
server_port=<%= node['nrpe']['server_port'] %>
<%= "server_address=#{node['nrpe']['server_address']}" unless node['nrpe']['server_address'].nil? %>
nrpe_user=<%= node['nrpe']['user'] %>
@skihero
skihero / nagios_nrpecheck
Created October 27, 2014 16:16
add or remove an nrpecheck
examples $ cat base_monitoring.rb
#
# Cookbook Name:: monitoring
# Recipe:: base_monitoring
#
# Copyright 2013, Example Company, Inc.
#
# This recipe defines the necessary NRPE commands for base system monitoring
# in Example Company Inc's Chef environment.
@skihero
skihero / include_dir_file
Created October 27, 2014 16:14
Include a conf directory and a file from the template, chef
include_dir = "#{node['nrpe']['conf_dir']}/nrpe.d"
directory include_dir do
owner node['nrpe']['user']
group node['nrpe']['group']
mode '0755'
end
template "#{node['nrpe']['conf_dir']}/nrpe.cfg" do
source 'nrpe.cfg.erb'
@skihero
skihero / gen_nagios_command_of_filesd
Created October 1, 2014 07:02
command conf construction helper nagios
# get a list of files
for f in `ls`
do
echo "command[${f}]=/usr/lib/nagios/plugins/${f} -H localhost -db apigee -u nagios --dbpass random_password # -w -c "
done