Skip to content

Instantly share code, notes, and snippets.

View ssbunyk's full-sized avatar

Bunyk Taras ssbunyk

View GitHub Profile
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2015, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
import logging
#! /usr/bin/env python
import os
def make_symlink():
try:
l = os.readlink('ns')
except OSError:
l = None
if l:
@ssbunyk
ssbunyk / install.md
Last active August 29, 2015 14:07
git on CentOS 6, 64

Using https://gist.github.com/eddarmitage/2001099

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
sudo su
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
rpm -i rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
yum install libcurl libcurl-devel
yum install git-gui
@ssbunyk
ssbunyk / 0_main.sh
Last active August 29, 2015 14:07
zendev-setup
# To load this use: wget https://gist.githubusercontent.com/ssbunyk/ef06c6c59a9fa861c49f/raw/da901b432efb19ef2f26767feded79e5ac0c5de9/0_main.sh
wget https://gist.githubusercontent.com/ssbunyk/ef06c6c59a9fa861c49f/raw/454dade155e5b3190b2b770fa4460875b8f2345b/1_install_docker.sh
wget https://gist.githubusercontent.com/ssbunyk/ef06c6c59a9fa861c49f/raw/6274d811b098ad23e71bdf3015c155e9996dc85e/2_docker_config.sh
wget https://gist.githubusercontent.com/ssbunyk/ef06c6c59a9fa861c49f/raw/6a6d195e55e25d5b69150f6e970af5f6b540eeef/3_install_go_and_dependencies.sh
wget https://gist.githubusercontent.com/ssbunyk/ef06c6c59a9fa861c49f/raw/ab1566c55a3fe393f25cd74d3dc1289ed8d50fe1/4_install_zendev.sh
@ssbunyk
ssbunyk / clear_events.sh
Created June 2, 2014 16:48
event_clear.sh
#!/bin/bash
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2007, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
def main():
host = '...'
passowrd = '...'
print run_cmd('http://%s:5985/wsman' % host, 'Administrator', password, 'powershell', ['-Command', '"(Get-WmiObject -class Win32_OperatingSystem).Caption"'])
def run_cmd(url, username, password, command, args=()):
protocol = Protocol(url, username=username, password=password)
shell_id = protocol.open_shell()
command_id = protocol.run_command(shell_id, command, args)
rs = protocol.get_command_output(shell_id, command_id)[0]
@ssbunyk
ssbunyk / lpu.ps1
Last active January 17, 2016 05:52
########################################################
# Functions to add permissions to user
########################################################
function add_user([String]$username, [String]$pass='Install_new!') {
$cmd = "NET USER $($username) $($pass) /ADD"
cmd $cmd
}
#! /opt/zenoss/bin/zendmd --script=
# coding=utf-8
from pprint import pprint
from twisted.internet import defer, reactor
from txwinrm.collect import ConnectionInfo, WinrmCollectClient, create_enum_info
from txwinrm.shell import create_single_shot_command
import DocumentTemplate, Common, Persistence, MethodObject, Globals, os, sys
File "/opt/zenoss/lib/python/HelpSys/HelpSys.py", line 22, in <module>
from App.special_dtml import DTMLFile
ImportError: cannot import name DTMLFile