Skip to content

Instantly share code, notes, and snippets.

View kapb14's full-sized avatar
😤

Aleksandr Karushin kapb14

😤
View GitHub Profile
@kapb14
kapb14 / Get-VMHostCDPPorts.ps1
Created December 18, 2021 20:31
Get information about vSphere host physical ports CDP
$cdpVar = ForEach ($dstHost in $(Get-VMHost))
{
$NetSystem = Get-View $dstHost.ExtensionData.ConfigManager.NetworkSystem
foreach ($Pnic in $dstHost.ExtensionData.Config.Network.Pnic)
{
if ($Pnic.Device -notlike "vusb*")
{
$PnicInfo = $NetSystem.QueryNetworkHint($Pnic.Device)
$cdp = $PnicInfo.ConnectedSwitchPort
@kapb14
kapb14 / Get-VmVlans.ps1
Last active December 18, 2021 20:03
Get vSphere VM VLANs
# для каждого VMHost-а
$var = ForEach ($dstHost in $(Get-VMHost))
{
# для каждой включенной виртуалки
ForEach ($vm in $($dstHost | Get-VM | Where-Object -Property PowerState -EQ "PoweredOn"))
{
# найдем портгруппу
$vmVlan = $vm | Get-VirtualPortGroup
# если у виртуалки больше одного порта, создаём объект на каждый
@kapb14
kapb14 / svg2png.md
Created August 28, 2019 10:11
convert SVG to PNG

convert SVG to PNG

inkscape -z -e user-ninja-solid.png -w 512 -h 512 user-ninja-solid.svg

Install Inkscape (on Windows)

## dotfiles
##
syntax "dotfile" "\.*$"
color cyan start="(^|[[:space:]])(#|;).*$" end="$"
color brightyellow start="=" end="$"
## Generic *.conf file syntax highlighting
##
syntax "conf" "\.(conf|cnf|cfg|config|cf)$"
@kapb14
kapb14 / get-rps.md
Created June 19, 2019 14:55
Count lines per second in access.log

get-rps

Counts "Lines per second" in access.log file.

Usage

whoami@hostname ~ $ get-rps --help
@kapb14
kapb14 / mklink.md
Last active June 18, 2019 21:29
How to use '/bin/ln' on windows
@kapb14
kapb14 / sudoers
Created May 15, 2019 17:26
Example sudoers config snippets
# Sample /etc/sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
##
# User alias specification
##
@kapb14
kapb14 / check-rabbitmq.sh
Created February 28, 2019 21:22
Пингуем RabbitMQ из командной строки
rabbitmqctl eval "net_adm:ping(rabbit@hostname)."
# если узел доступен получаем ответ pong

Keybase proof

I hereby claim:

  • I am kapb14 on github.
  • I am kapb14 (https://keybase.io/kapb14) on keybase.
  • I have a public key ASAOgiROXoy8OY-xn039gdwZ22BQ9HZ2q5hnTk6a46zLVAo

To claim this, I am signing this object:

@kapb14
kapb14 / Grab-Nearest-Target
Last active January 23, 2019 07:42
Some useful UOSteam Scripts and Snippets for UOOutlands shard
//Grab Nearest Target
//Created by Duck Face
//Enjoy
@createlist '1'
@clearlist '1'
@createlist '2'
@clearlist '2'
@createlist '3'
@clearlist '3'