Skip to content

Instantly share code, notes, and snippets.

@omniproc
omniproc / pylintmsg.rst
Last active August 16, 2022 16:23
A list of all message names, codes and descriptions from PyLint 1.9.2
blacklisted-name (C0102)

Black listed name "%s" Used when the name is listed in the black list (unauthorized names).

invalid-name (C0103)

%s name "%s" doesn't conform to %s Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

missing-docstring (C0111)

Missing %s docstring Used when a module, function, class or method has no docstring.Some special methods like __init__ doesn't necessary require a docstring.

empty-docstring (C0112)

Empty %s docstring Used when a module, function, class or method has an empty docstring (it would

@omniproc
omniproc / example-plugin-schema.json
Created July 13, 2018 17:10
JSON-Schema As Language Agnostic Interface Definition Format
{
"$schema": "./plugin-metaschema.json",
"title": "A Plug-In",
"description": "An example Plug-In for our core-application",
"type": "object",
"properties": {
"id": {
"type": "number",
"title": "ID",
"description": "Unique task number",
#Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
$vcenterServer = YOUR_VCENTER_SERVER_FQDN
$cluster = YOUR_VCENTER_CLUSTER
$esxiUser = "root"
$esxiPass = "YourMama"
$newUserName = "NameOfTheUserYouWantToAdd"
$newUserDomain = "DomainNameOfTheUserYouWantToAdd"
Try
#The cluster you want to enable SSH on
$cluster = YOU_CLUSTER;
$hosts = Get-Cluster $cluster | Get-VMHost
#Start SSH service
$hosts | ForEach {Start-VMHostService -HostService ($_ | Get-VMHostService | Where {$_.key -eq "TSM-SSH"})}
#Enable SSH service (start when ESXi boots)
$hosts | ForEach {Set-VMHostService -Policy On -HostService ($_ | Get-VMHostService | Where {$_.key -eq "TSM-SSH"})}
#Supress nasty SSH warning, we know what we're doing yade yade yade...
$hosts | ForEach {Get-AdvancedSetting UserVars.SuppressShellWarning | Set-AdvancedSetting -Value 1}
$vms = Get-Cluster CLUSTER_NAME_YOU_WANT_TO_ANALYZE | Get-VM
foreach ($vm in $vms)
{
$conf = $vm | Get-VMResourceConfiguration;
if( ($conf.CpuReservationMhz -ne 0) -or ($conf.CpuLimitMhz -ne -1) -or ($conf.CpuSharesLevel -ne "Normal") -or
($conf.MemReservationMB -ne 0) -or ($conf.MemLimitMB -ne -1) -or ($conf.MemsharesLevel -ne "Normal"))
{
$vm | Get-VMResourceConfiguration | select-object VM,CpuReservationMhz,CpuLimitMhz,CpuSharesLevel,MemReservationMB,MemLimitMB,MemsharesLevel | ft
}
$vms = Get-Cluster CLUSTER_NAME_YOU_WANT_TO_NORMALIZE | Get-VM
Write-Host "Old configuration:"
$vms | Get-VMResourceConfiguration
foreach ($vm in $vms)
{
#Normalize CPU shares
# vSphere 5.5 defaults:
# High: 2000 shares per configured vCPU
@omniproc
omniproc / pushverify.java
Last active August 29, 2015 14:04
iOS push notification test-service
// Here comes our service implementation
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.notnoop.apns.*;
// This is a basic implementation of notnoop/apns for enhanced push notifications
// It's purpose is to let you know if your push certificates are working correctly
// We're using enhanced push notifications here - this means you'll get a detailed explanation
@omniproc
omniproc / dockerlog.java
Last active August 29, 2015 14:03
Basic docker container log stream reader
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.HttpURLConnection;
// This is a very basic implementation of the Docker API v. 1.12 for attaching to a containers StdOut and StdErr stream using HTTP
// It is not perfect (see official Docker API documentation for details and how to handle the bytestream) but up to this date its
// the most compleate, working example for this to get an idea what's going on there. Happy about any improvement ideas.
public class Readin