Skip to content

Instantly share code, notes, and snippets.

@rahimigit
rahimigit / setup-users.groovy
Created May 16, 2023 19:21 — forked from johnbuhay/setup-users.groovy
jenkins init.groovy.d script for configuring users
import jenkins.*
import hudson.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import hudson.plugins.sshslaves.*;
import hudson.model.*
import jenkins.model.*
import hudson.security.*
@rahimigit
rahimigit / baseURL.groovy
Created January 23, 2023 04:09 — forked from fishi0x01/baseURL.groovy
This is a collection of groovy scripts I gathered and use for bootstrapping Jenkins. Most of this can also be achieved with the CasC Plugin https://github.com/jenkinsci/configuration-as-code-plugin
#!groovy
/*
* This script configures the Jenkins base URL.
*/
import jenkins.model.JenkinsLocationConfiguration
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
location.url = 'https://jenkins-as-code-poc.devtail.io/'
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
@rahimigit
rahimigit / eks-addon-irsa.sh
Created November 8, 2022 21:06 — forked from inductor/eks-addon-irsa.sh
eks-addon-irsa.sh
#!/bin/sh -eu
export CLUSTER_NAME=dreamkast-cluster
export CLUSTER_REGION=ap-northeast-1
export PROFILE=default
curl -o /tmp/iam_policy.json "https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.4.1/docs/install/iam_policy.json"
aws iam create-policy \
--policy-name "AWSLoadBalancerControllerIAMPolicy" \
--policy-document "file:///tmp/iam_policy.json" \
@rahimigit
rahimigit / cleanup-gitlab-pipelines.sh
Created November 8, 2022 21:00 — forked from chrishoerl/cleanup-gitlab-pipelines.sh
Bulk delete gitlab pipelines older than a given date
#!/bin/bash
# Purpose: Bulk-delete GitLab pipelines older than a given date
# Author: github.com/chrishoerl
# GitLab API: v4
# Requirements: jq must be instaled ($ sudo apt install jq)
# API example: https://gitlab.example.com/api/v4/projects
# API example: https://gitlab.example.com/api/v4/projects/<projectid>/pipelines
#
# NOTE: Script is just a dryrun. To really delete pipelines, simply uncomment line 49 to activate
#
@rahimigit
rahimigit / cleanup-gitlab-pipelines.sh
Created November 8, 2022 21:00 — forked from anutator/cleanup-gitlab-pipelines.sh
Bulk delete gitlab pipelines older than a given date
#!/bin/bash
# Purpose: Bulk-delete GitLab pipelines older than a given date
# Author: github.com/chrishoerl
# New features: Anna Toropova https://github.com/anutator
# GitLab API: v4
# Requirements: jq must be instaled ($ sudo apt install jq)
# API example: https://gitlab.example.com/api/v4/projects
# API example: https://gitlab.example.com/api/v4/projects/<projectid>/pipelines
#
# NOTE: To dryrun script comment line 59.
@rahimigit
rahimigit / Tableau-housekeeping-script
Created July 4, 2022 01:14 — forked from karthikholla/untitled
tableau-server-housekeeping-linux.bash
#!/bin/bash
# Grab the current date in YYYY-MM-DD format
DATE=`date +%Y-%m-%d`
# Grab the current datetime for timestamping the log entries
TIMESTAMP=`date '+%Y-%m-%d %H:%M:%S'`
# Do you want to copy your backups to another location after completion?
copy_backup="yes"
# If yes to above, where do you want to copy them?
external_backup_path="s3://gale-tableau-backup/"
@rahimigit
rahimigit / cloudflare-dns.yaml
Created February 4, 2022 17:27 — forked from reginaldosousa/cloudflare-dns.yaml
Cert Manager Wildcard Certificates Cloudflare
apiVersion: v1
kind: Secret
metadata:
name: cloudflare-api-key
namespace: gitlab-managed-apps
type: Opaque
data:
apikey: [your_api_key]
apiVersion: certmanager.k8s.io/v1alpha2
kind: ClusterIssuer
@rahimigit
rahimigit / script.sh
Created December 28, 2021 20:56 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux