Skip to content

Instantly share code, notes, and snippets.

View scr34m's full-sized avatar
🏠
Working from home

Győrvári Gábor scr34m

🏠
Working from home
View GitHub Profile
@scr34m
scr34m / vmware-vsphere-list-vm.php
Created August 27, 2012 16:46
VMWare vSphere List VM's with PHP using webservices
<?php
class soapclientd extends soapclient
{
public $action = false;
public function __construct($wsdl, $options = array())
{
parent::__construct($wsdl, $options);
}
@scr34m
scr34m / mysql.sh
Last active June 20, 2021 17:14
MySQL backup script per day directory
#!/bin/sh
export PATH=${PATH}:/usr/local/bin:/usr/bin
mysqldir="/data/backup/mysql"
date=`date +%Y-%m-%d`
dbdir="/var/lib/mysql"
if [ ! -d "${mysqldir}/${date}" ]; then
mkdir -p ${mysqldir}/${date}
fi
@scr34m
scr34m / udp.rb
Created March 22, 2013 15:18
logstash udp output plugin based on tcp output plugin
require "logstash/outputs/base"
require "logstash/namespace"
require "thread"
# Write events over a UDP socket.
#
# Each event json is separated by a newline.
class LogStash::Outputs::Udp < LogStash::Outputs::Base
@scr34m
scr34m / subversion
Created August 10, 2013 15:50
debian svnserve init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: svnserve
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Should-Start: $all
# Should-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@scr34m
scr34m / varnish_
Created March 13, 2014 18:37
Varnish munin plugin
#!/usr/bin/perl
# -*- perl -*-
#
# varnish_ - Munin plugin to for Varnish
# Copyright (C) 2009 Redpill Linpro AS
#
# Author: Kristian Lyngstøl <kristian@redpill-linpro.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@scr34m
scr34m / mongo_conn
Created March 14, 2014 10:25
MongoDB munin plugin for operations, memory and connections
#!/usr/bin/env python
## GENERATED FILE - DO NOT EDIT
import urllib2
import sys
import os
try:
import json
@scr34m
scr34m / check_supervisor.py
Created April 16, 2014 08:27
Supervisord nagios monitor script, modified to check every process state
#!/usr/bin/env python
import xmlrpclib
import sys
# Simple Nagios/Icinga check for a process under Supervisord.
# Requires XML-RPC interface (inet) enabled
__author__ = 'Jan-Piet Mens <jpmens()gmail.com>'
#!/usr/bin/env python2
import base64
import json
import logging
import requests
import sys
from swiftclient import client
class AuthenticationHubic:
@scr34m
scr34m / keybase.md
Created February 25, 2015 06:18
keybase.md

Keybase proof

I hereby claim:

  • I am scr34m on github.
  • I am scr34m (https://keybase.io/scr34m) on keybase.
  • I have a public key whose fingerprint is C18E 6363 58DE EF8A 5DEE 909F 86B8 A589 3469 E5B4

To claim this, I am signing this object:

@scr34m
scr34m / zeromq_wire_protocol.php
Last active July 6, 2019 20:57
raw zeromq wire protocol in php
<?php
// ZMTP/2.0 http://rfc.zeromq.org/spec:15
// ZMTP/1.0 http://rfc.zeromq.org/spec:13
$fp = fsockopen("127.0.0.1", 5559, $errno, $errstr, 1);
if (!$fp) {
return;
}
stream_set_timeout($fp, 0, 500);