Skip to content

Instantly share code, notes, and snippets.

View ficus's full-sized avatar

Tom ficus

  • Online Auction Solutions
  • Minneapolis, MN
View GitHub Profile
#!/bin/bash
# Simple script to test for network interruption blip we seem to experience for a moment btw. midnight and one. TNG 20170720
#
# * 0-1 * * * /home/tgodar/tmp_net_test/netcheck.sh | while IFS= read -r line; do echo "$(date) $line"; done >>/home/tgodar/tmp_net_test/netcheck.log
#
if ping -c1 -w10 google.acom | grep -q '1 packets transmitted\, 1 received\, \0\% packet loss'; then
echo "Ping OK."
else
echo "Ping Failed!"
@ficus
ficus / monit-base.conf
Created October 6, 2016 15:48
Monit configurations for common web server services.
set daemon 120 # check services at 2-minute intervals
with start delay 240 # optional: delay the first check by 4-minutes
set mailserver localhost
set alert user@email.com
# set alert manager@foo.bar only on { timeout } # receive just service-
# # timeout alert
@ficus
ficus / MySQL-DateDim.sql
Created October 6, 2016 15:43
Populate a Date Dimension Table - Code from Kimball?
drop table if exists dim_date;
CREATE TABLE dim_date(
date_key int NOT NULL,
full_date date NULL,
date_name char(11) NOT NULL,
date_name_us char(11) NOT NULL,
date_name_eu char(11) NOT NULL,
day_of_week tinyint NOT NULL,
day_name_of_week char(10) NOT NULL,
day_of_month tinyint NOT NULL,
@ficus
ficus / .screenrc
Created October 6, 2016 15:39
customizations to .screenrc
term xterm
defutf8 on
defflow off
vbell off
autodetach on
startup_message off
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@ficus
ficus / .bashrc
Created October 6, 2016 15:36
customizations to .barshrc
#For root user visual cue
export PS1="\[\e[31;1m\][\u@\[\e[37;1m\]\H \W]# \[\e[0m\]"