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 / promptconvert.py
Created July 29, 2023 05:16 — forked from watzon/promptconvert.py
Stable Diffusion WebUI to InvokeAI prompt conversion script
import re
import argparse
re_attention = re.compile(r"""
\\\(|
\\\)|
\\\[|
\\]|
\\\\|
\\|
@vkushnir
vkushnir / ldapsearch.sh
Created April 3, 2023 13:00 — forked from tsuchm/ldapsearch.sh
ldapsearch with Base64 decode
#!/bin/sh
/usr/bin/ldapsearch -o ldif-wrap=no "$@" | perl -MMIME::Base64 -Mutf8 -pe 's/^([-a-zA-Z0-9;]+):(:\s+)(\S+)$/$1.$2.&decode_base64($3)/e'
@vkushnir
vkushnir / README.md
Last active October 7, 2022 06:38
Zabbix JavaScript Preprocessing

Zabbix JavaScript Preprocessing

json_trim1.js

Trim all values for key "{#LLD}"

json_trim2.js

Trim all values

json_uniq1.js

Remove all dublicates form json with same values for key "{#SERIAL}"

@vkushnir
vkushnir / Filetimes.py
Created April 28, 2022 11:05 — forked from Mostafa-Hamdy-Elgiar/Filetimes.py
Python Script to convert Microsoft widows file time to python date and also date to windows file time
#!/usr/bin/env python
# Copyright (c) 2009, David Buxton <[email protected]>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@vkushnir
vkushnir / gs_huptime.ts
Last active September 13, 2021 10:11
GeineACS Uptime Human Readble
// Unified across Device and InternetGatewayDevice
let v1 = declare("Device.DeviceInfo.UpTime", {value: Date.now()});
let v2 = declare("InternetGatewayDevice.DeviceInfo.UpTime", {value: Date.now()});
let totalSecs = 0
if (typeof v1.value !== "undefined") {
totalSecs = v1.value[0];
} else {
totalSecs = v2.value[0];
}
@vkushnir
vkushnir / NPS-Config-Sync.ps1
Created May 26, 2021 04:08 — forked from Jamesits/NPS-Config-Sync.ps1
Sync 2 Network Policy Servers' configuration
###Network Policy Server Synchronization Script
#This script copies the configuration from the NPS Master Server and imports it on the secondary server.
#The Account that this script runs under must have Local Administrator rights to the NPS Master.
#This was designed to be run as a scheduled task on the NPS Secondary Servers on an hourly,daily, or as-needed basis.
# Modified from https://deployhappiness.com/two-network-policy-server-tricks-subnets-and-syncing/
###Variables
#NPSMaster - Your Primary Network Policy Server you want to copy the config from.
$NPSMaster = "adds0.corp.contoso.com"
$NPSSecondary = "adds1.corp.contoso.com"
@vkushnir
vkushnir / ip-up
Last active January 25, 2021 04:34
A script for PPTP custom routing on VPNs
#!/bin/sh
# When the ppp link comes up, this script is called with the following
# parameters
# $1 the interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
# $5 the remote IP address
# $6 the parameter specified by the 'ipparam' option to pppd
@vkushnir
vkushnir / backup.sh
Last active June 23, 2020 06:48
MySQLDump with progress bar
#!/bin/sh
#
# Usage: backup.sh -d <database name> [-d <database name>] [-l <login path>] [-f <backup file name>]
TEMP=`mktemp -d`
db_login="backup"
db_list=""
fn="backup"
dt=`date '+%Y%m%d'`
@vkushnir
vkushnir / .gitignore
Last active January 22, 2024 10:17
Get ONU list from ONT by SNMP and generate EXCEL table
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
@vkushnir
vkushnir / .gitignore
Last active May 12, 2020 04:46
Download running-config form network device over ssh
__pycache__
*.cfg
.idea