Skip to content

Instantly share code, notes, and snippets.

Avatar

Shane Duan wolfdancer

  • Workday
  • Bay Area
View GitHub Profile
@wolfdancer
wolfdancer / http.yaml
Last active Jul 15, 2016
Rackspace Montiornig HTTP Configuration
View http.yaml
type: remote.http
label: ZNC Bouncer Web
disabled: false
period: 60
timeout: 30
target_hostname: irc.duan.io
target_resolver: IPv4
details:
method: GET
url: https://irc.duan.io
@wolfdancer
wolfdancer / traceroute.py
Created Mar 31, 2016
Command line to use Monitoring to run traceroute
View traceroute.py
#!/usr/bin/env python3
"""
https://gist.github.com/wolfdancer/98e1234fff2bcd77a8a0
This script will hit the monitoring API, pull monitoring configuration on the specified entty and check,
then generate yaml config file
To use:
./export.py --user <username> --api-key <api key> --target <target> --target_resolver <target_resolver>
"""
@wolfdancer
wolfdancer / hostinfo.py
Created Nov 25, 2014
pull host info from agents under an acconut
View hostinfo.py
#!/usr/bin/env python2.7
"""
This plugin will hit the monitoring API, pull entities, agents and host info from the account, and push to another service.
To use:
./hostinfo.py --user <username> --api-key <api key>
Todo:
=============
# The entities response is paginated at 100. Need to handle the case where there are more entities
@wolfdancer
wolfdancer / import.py
Created Nov 25, 2014
import monitornig configuration
View import.py
#!/usr/bin/env python3
"""
This script will load the monitoring configuration yaml file for the server-side configuratino,
hit the monitoring API to create the checks and alarms
To use:
./import.py --user <username> --api-key <api key> --entity <entity-id> --file <yaml file>
"""
import argparse
@wolfdancer
wolfdancer / export.py
Created Nov 25, 2014
monitornig check export
View export.py
#!/usr/bin/env python3
"""
This script will hit the monitoring API, pull monitoring configuration on the specified entty and check,
then generate yaml config file
To use:
./export.py --user <username> --api-key <api key> --entity <entity-id> --check <check-id>
"""
import argparse
View grafana-mysql-dashboard-cloudmetrics.json
{
"title": "Grafana",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"rows": [
{
"title": "Welcome to Grafana",
"height": "210px",
@wolfdancer
wolfdancer / heat-grafana-cloudmetrics.yaml
Last active Aug 29, 2015
heat-grafana-cloudmetrics.yaml
View heat-grafana-cloudmetrics.yaml
heat_template_version: 2013-05-23
description: >
Puts together a server that will run Grafana using Cloud Metrics data.
parameter_groups:
- label: 'Server Settings'
parameters:
- flavor
- image
@wolfdancer
wolfdancer / ping_and_filesystem_check_server_side_monitoring_configuration.md
Last active Aug 29, 2015
Step-by-step Instruction to set up Ping and Filesystem check with Server-Side Monitoring Configuration
View ping_and_filesystem_check_server_side_monitoring_configuration.md

Summary

This is a step-by-step instruction to manually set up Cloud Monitoring through the server-side configuration feature to get familiar with the process. The target use case for this is for automation like Chef Cookbook, Ansible Playbook or scripts.

In this example, we are going to set up the filesystem check because it is always a good idea to get notified BEFORE you run out of space. We are going to use Ubuntu as the example OS to simplify the steps.

Steps

  • Upgrade agent
  • Create YAML file
View gist:3f9ea5c845907ee18311
Background informaiton: Using raxmon to configure Cloud Monitoring (http://developer.rackspace.com/blog/using-raxmon-to-configure-rackspace-cloud-monitoring.html)
sduan@Shanes-MacBook-Pro ~ $ raxmon-notifications-list [ruby-1.9.3-p484]
<Notification: id=ntDbF0gzzN, label=rackspace email, type=email ...>
<Notification: id=ntTechnicalContactsEmail, label=Email All Technical Contacts, type=technicalContactsEmail ...>
<Notification: id=ntjiCBpG61, label=pagerduty, type=pagerduty ...>
sduan@Shanes-MacBook-Pro ~ $ raxmon-notifications-create --label=sms --type=sms --details="phone_number=+15555555555" [ruby-1.9.3-p484]
Resource created. ID: ntByLFhHhM
View interviewitems.md

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go