Skip to content

Instantly share code, notes, and snippets.

View vkushnir's full-sized avatar

Vladimir Kushnir vkushnir

  • Specavtomatica
  • Kazakhstan, Aqtau
View GitHub Profile
@vkushnir
vkushnir / Functs.pas
Created April 3, 2013 16:20
Graphics functions
unit Functs;
interface
uses
WinTypes, Classes, Graphics, SysUtils;
type
TPoint2D = record
@vkushnir
vkushnir / md5.pas
Created April 3, 2013 16:24
MD5 Message-Digest for Delphi 4 Delphi 4 Unit implementing the RSA Data Security, Inc. MD5 Message-Digest Algorithm Implementation of Ronald L. Rivest's RFC 1321 Copyright © 1997-1999 Medienagentur Fichtner & Meyer Written by Matthias Fichtner
// tabs = 2
// -----------------------------------------------------------------------------------------------
//
// MD5 Message-Digest for Delphi 4
//
// Delphi 4 Unit implementing the
// RSA Data Security, Inc. MD5 Message-Digest Algorithm
//
// Implementation of Ronald L. Rivest's RFC 1321
//
@vkushnir
vkushnir / snmp-printf.sh
Last active December 20, 2015 13:29
Zabbix External Scripts Get values from device and format output Usage: snmp-printf.sh [PARAMS] <OID1> <OID2> <OID3> ... PARAMS: -i <IP> -v <SNMP Ver> -c <Community> -f <Format> -o <Base OID>
#!/bin/bash
# Get values from device and format output
# Usage:
# snmp-printf.sh [PARAMS] <OID1> <OID2> <OID3> ...
# PARAMS:
# -i <IP>
# -v <SNMP Ver>
# -c <Community>
# -f <Format>
# -o <Base OID>
@vkushnir
vkushnir / concat.sh
Created August 2, 2013 10:08
Zabbix External Scripts Concatenate all commanline params and print result
#!/bin/bash
# Concatenate all commanline params and print result
result=""
for var in "$@"
do
result=${result}${var}
done
@vkushnir
vkushnir / snmp-zyxel-shver.sh
Last active December 20, 2015 13:29
Zabbix External Scripts Get ZyXEL Software ID
#!/bin/bash
# Get ZyXEL software ID
# Usage:
# snmp-zyxel-getVer.sh [PARAMS]
# PARAMS:
# -i <IP>
# -v <SNMP Ver>
# -c <Community>
# -o <Base OID>
@vkushnir
vkushnir / snmp-cisco-getVer.sh
Created August 12, 2013 10:09
Zabbix External Scripts Get CISCO Software ID
#!/bin/bash
# Get CISCO Version Parts
# Usage:
# cisco-getVer.sh [-t|-v] [PARAMS]
# OPTIONS:
# -t Get software type
# -s Get software version
# PARAMS:
# -i <IP>
# -v <SNMP Ver>
@vkushnir
vkushnir / getSwZyXEL.sh
Last active December 22, 2015 20:09
Zabbix External Scripts Get ZyXEL Software ID from Zabbix DATABASE
#!/bin/bash
# Get ZyXEL Software ID from Zabbix DATABASE
#
# Usage:
#
# getSwZyXEL.sh -h <host> [PARAMS]
#
# PARAMS:
# -d <Database>
# -u <User>
@vkushnir
vkushnir / getSwCISCO.sh
Created September 11, 2013 15:45
Zabbix External Scripts Get CISCO Software ID from Zabbix DATABASE
#!/bin/bash
# Get CISCO Software ID from Zabbix DATABASE
#
# Usage:
#
# getSwCISCO.sh -h <host> [-t|-v] [PARAMS]
#
# OPTIONS:
# -t Get software type
# -s Get software version
@vkushnir
vkushnir / Labwork.pas
Last active August 29, 2015 13:59
Pascal ABC.net
uses graphABC;
// объявление переменных
var X1,X2,X3,X4: integer;
var Y1,Y2,Y3,Y4: integer;
begin
// Ввод данных
write ('Введите координаты X1; Y1');
read (X1); read (Y1);
writeln (': ', X1, ', ', Y1);
@vkushnir
vkushnir / geteth.sh
Last active August 29, 2015 14:19
Getting data from P interface
get_ether() {
# 0-<interface>, 1-<mac address>, 2-<broadcast>
local net[0]=$1
net[1]=`ip -0 -o addr show dev ${net[0]} | grep -oiP '(?<=link\/ether)\s+([0-9a-f]{2}\:?){6}' | tr -d '[[:space:]]'`
net[2]=`ip -0 -o addr show dev ${net[0]} | grep -oiP '(?<=brd)\s+([0-9a-f]{2}\:?){6}' | tr -d '[[:space:]]'`
echo "${net[@]}"
}
get_ipv4() {
# 0-<interface>, 1-<full network>, 2-<interface ip>, 3-<network bits>, 4-<broadcast>