This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MySquareImages extends android.support.v7.widget.AppCompatImageView { | |
public MySquareImages(Context context) { | |
super(context); | |
} | |
public MySquareImages(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INVENTORY_FILE='/path/to/inventory_file' | |
SSH_USER='darshit' | |
server_ips=$(cat $INVENTORY_FILE | peco | awk '{print $1;}' ) | |
iterm_newtab(){ | |
osascript \ | |
-e 'tell application "iTerm2" to tell current window to set newWindow to (create tab with default profile)'\ | |
-e "tell application \"iTerm2\" to tell current session of newWindow to write text \"${@}\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(kubectl get deploy -n <namespace> -o name); do if [[ ${i} != (*"mongodb"*|*"mysql"*) ]];then kubectl scale -n <namespace> --replicas 0 $i; fi; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jenkins.instance.getItemByFullName("FULL_JOB_PATH").getBuildByNumber(BUILD_NUMBER).finish( | |
hudson.model.Result.ABORTED, | |
new java.io.IOException("Aborting build")); | |
/* | |
To run the above line, navigate to: | |
Jenkins homepage -> Manage Jenkins -> Script Console | |
OR | |
open https://<jenkins domain>/script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOST_IMAGE = "centos/8" | |
$master_provision = <<-SCRIPT | |
echo provisioning k3s cluster... | |
curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644 | |
echo done provisioning | |
SCRIPT | |
Vagrant.configure("2") do |config| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Setup | |
# pip3 install datadog-api-client | |
# | |
# Command to run | |
# DD_SITE="datadoghq.com" DD_API_KEY=$DATADOG_API_KEY DD_APP_KEY=$DATADOG_APP_KEY python3 delete_datadog_monitors.py | |
# Sample monitor_list.txt. All monitor IDs are stored in new line. | |
# | |
# cat monitor_list.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the necessary libraries | |
from google.cloud import pubsub_v1 | |
# Set the variables for your project, subscription, and maximum number of messages to pull | |
project_id = "proj-id" | |
subscription_name = "darshit-sub" | |
max_messages = 1 | |
# Create a subscriber client | |
subscriber = pubsub_v1.SubscriberClient() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Basic Testing | |
run-name: "Basic Testing" | |
on: | |
workflow_dispatch: | |
jobs: | |
demo-job-1: | |
runs-on: ubuntu-22.04 # NOTE: Hardcoding for stability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p /tmp/runner-build | |
cd /tmp/runner-build | |
git clone https://github.com/actions/runner.git | |
cd runner/src | |
# NOTE: Change based on platform | |
./dev.sh layout Release linux-arm64 | |
./dev.sh package Release |