Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Xiangjun Zhang xdays

🏠
Working from home
View GitHub Profile
View consumer.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import boto3
import json
from datetime import datetime
import time
my_stream_name = 'test'
View AddJsonFormGormTag.go
func AddJsonFormGormTag(in string) (string) {
var result string
scanner := bufio.NewScanner(strings.NewReader(in))
var oldLineTmp = ""
var lineTmp = ""
var propertyTmp = ""
var seperateArr []string
for scanner.Scan() {
oldLineTmp = scanner.Text()
View gfwlist.txt
||fireworktv.com
||v2ex.com
||wikipedia.org
||golang.org
||googlesource.com
||wireguard.com
||github.com
||gitlab.com
||gitlab-static.net
||tunsafe.com
View press.one
{"sig":"12921da835011b96beef12fba4fac39254b96cbf76f3ce0fdb6d66d9a81d0091dbfb85d57fa79f8aa192f334a943584afb2090055cd5f51fb535b6d8d93fdf170","msghash":"986fb795b265c324c8d9357c55ef6ada2d4ce05f2f69e4bbd49371d159512bce"}
@xdays
xdays / tomcat-initscript.sh
Created Aug 20, 2015
tomcat init script for ansible
View tomcat-initscript.sh
#!/bin/bash
#
# chkconfig: 345 99 28
# description: Starts/Stops Apache Tomcat
#
# Tomcat 7 start/stop/status script
# Forked from: https://gist.github.com/valotas/1000094
# @author: Miglen Evlogiev <bash@miglen.com>
#
# Release updates:
@xdays
xdays / ops_robot.py
Created May 20, 2014
a robot powered by jabberbot
View ops_robot.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from jabberbot import JabberBot, botcmd
import datetime
class robot(JabberBot):
@botcmd
def serverinfo( self, mess, args):
"""Displays information about the server"""
@xdays
xdays / ldap_auth.py
Created May 14, 2014
python script for ldap authentication
View ldap_auth.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ldap
if __name__ == '__main__':
ldap_server='example.com'
base_dn = 'ou=user,dc=example,dc=com'
username = 'foo'
password = 'bar'
View php_fpm_check.py
#!/usr/bin/env python
# pylint: disable=W0622
# Copyright (c) 2006 Allan Saddi <allan@saddi.com>
# Copyright (c) 2011 Vladimir Rusinov <vladimir@greenmice.info>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@xdays
xdays / zabbix_snmp_linux_templates.xml
Last active Dec 29, 2015
Zabbix DiskIO template based on SNMP
View zabbix_snmp_linux_templates.xml
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-11-28T09:40:30Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@xdays
xdays / zabbix_agent_linux_templates.xml
Last active Dec 29, 2015
Zabbix DiskIO template based on Template OS Linux
View zabbix_agent_linux_templates.xml
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-11-28T09:41:16Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>