Skip to content

Instantly share code, notes, and snippets.

package main
import (
"database/sql"
"github.com/yosida95/orm"
"github.com/yosida95/orm/cond"
"log"
)
type Model struct {
language: python
env:
matrix:
- TOXENV="py33"
- TOXENV="py34"
- TOXENV="coverage"
install:
- pip install tox
- if test "$TOXENV" = "coverage"; then pip install coveralls; fi
script:
# -*- coding: utf-8 -*-
import json
from gntp.notifier import GrowlNotifier
from ws4py.client.threadedclient import WebSocketClient
IMAGE_NORMAL = 'http://yosida95-ubuntu1/jenkins.png'
IMAGE_ONSUCCESS = 'http://yosida95-ubuntu1/success.png'
IMAGE_ONFAIL = 'http://yosida95-ubuntu1/error.png'
>>> from jsonschema import validate
>>> # A sample schema, like what we'd get from json.load()
>>> schema = {
... "type" : "object",
... "properties" : {
... "price" : {"type" : "number"},
... "name" : {"type" : "string"},
... },
... }
# -*- coding: utf-8 -*-
from jsmapper import (
JSONSchema,
Object,
Number,
String,
)
# -*- coding: utf-8 -*-
from jsmapper import (
JSONSchema,
Mapping,
Number,
Object,
String,
)
# -*- coding: utf-8 -*-
from jsmapper import (
JSONSchema,
Array,
Mapping,
Number,
Object,
String,
)
cd $HOME
# Stop Zabbix Server (1.8)
sudo service zabbix-server stop
# Create a backup
mkdir ./zabbix-backup
mysqldump -uroot -p zabbix > ./zabbix-backup/dump.db
sudo cp /etc/zabbix/{apache.conf,zabbix_server.conf} ./zabbix-backup
sudo cp -r /etc/zabbix/alert.d ./zabbix-backup
@yosida95
yosida95 / pushover_zabbix.py
Last active August 29, 2015 14:05
Notify you your zabbix events to your mobile devices via pushover.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import urllib2
from urllib import urlencode
APPTOKEN = YOUR_APPLICATION_TOKEN
~ ✘╹◡╹✘ dig @m.gtld-servers.net value-domain.com
; <<>> DiG 9.8.3-P1 <<>> @m.gtld-servers.net value-domain.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39649
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 5, ADDITIONAL: 5
;; WARNING: recursion requested but not available