The following snippet contains an example for GoLang Generics for Structs:
package main
import "fmt"
// Structs definition
type ObjectOne struct {
Name string `json:"name"`
import binascii | |
# Define nodes with precise slot ranges based on Redis cluster configuration | |
nodes = [ | |
{"name": "node-0001", "ranges": [range(2730, 8192)]}, | |
{"name": "node-0002", "ranges": [range(8192, 9767), range(12498, 16384)]}, | |
{"name": "node-0003", "ranges": [range(0, 2730), range(9767, 12498)]} | |
] | |
# Define the keys to calculate hash slots |
services: | |
cache-node-1: | |
image: docker.io/bitnami/redis-cluster:7.4 | |
container_name: cache-node-1 | |
hostname: cache-node-1 | |
ports: | |
- 6379:6379 | |
environment: | |
- ALLOW_EMPTY_PASSWORD=yes | |
- REDIS_NODES=cache-node-1 cache-node-2 cache-node-3 cache-node-4 cache-node-5 cache-node-6 |
// Source: https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-masters/how-to-generate-change-an-apitoken | |
import hudson.model.* | |
import jenkins.model.* | |
import jenkins.security.* | |
import jenkins.security.apitoken.* | |
// script parameters | |
def userName = 'admin' | |
def tokenName = 'token' |
The following snippet contains an example for GoLang Generics for Structs:
package main
import "fmt"
// Structs definition
type ObjectOne struct {
Name string `json:"name"`
format.txt
file with the following content:time_namelookup: %{time_namelookup}s\n
time_connect: %{time_connect}s\n
time_appconnect: %{time_appconnect}s\n
time_pretransfer: %{time_pretransfer}s\n
time_redirect: %{time_redirect}s\n
time_starttransfer: %{time_starttransfer}s\n
----------\n
#!/usr/bin/python | |
import os | |
import stashy | |
projects = [ | |
"PROJ-1", | |
"PROJ-2", | |
"PROJ-3", | |
] |
from requests import get | |
from sys import argv, exit | |
from os import environ | |
from requests.models import HTTPBasicAuth | |
def main(): | |
if len(argv) < 3: | |
print('invalid input, expected arguments: `python3.9 script.py <account-name> <search-string>`') | |
exit(1) |
import jenkins.* | |
import jenkins.model.* | |
import hudson.* | |
import hudson.model.* | |
def jenkinsCredentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.Credentials.class, | |
Jenkins.instance, | |
null, | |
null |
This script will list all active repositories in an organization with GitHub Actions workflows.
repo
scope and replace <TOKEN>
<ORGANIZATION>
with your organizaiton name#!/bin/sh
token="<TOKEN>"