Skip to content

Instantly share code, notes, and snippets.

@pkazi
pkazi / recipe: cherry-pick tags
Created December 9, 2019 08:46 — forked from nickfloyd/recipe: cherry-pick tags
To cherry pick from head and commit back into a tag
-from master in working branch
>> git branch [new branch] [tag]
>> git checkout [branch]
-pull commit out and add it to the commit at the top of the tag
>> git cherry-pick [commit] or git cherry-pick [firstcommit]^..[lastcommit] if you have a range
-resolve conflicts
-delete the local tag
>> git git tag -d [tag]
-add a new tag at the head of the old one
>> git tag [tag]
{
"id": "/infrastructure/redis-cluster-util",
"backoffFactor": 1.15,
"backoffSeconds": 1,
"constraints": [],
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/backup",
{
"id": "/#NODENAME#",
"backoffFactor": 1.15,
"backoffSeconds": 1,
"constraints": [
[
"hostname",
"CLUSTER",
"#NODEHOSTIP#"
]
{
"id": "/redis4.0-new-failover-test",
"instances": 1,
"cpus": 1.001,
"mem": 2,
"disk": 0,
"gpus": 0,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
core@ip-10-0-3-204 ~ $ /opt/mesosphere/bin/rexray volume list
- name: datavolume
volumeid: vol-00aacade602cf960c
availabilityzone: us-east-1a
status: in-use
volumetype: standard
iops: 0
size: "16"
networkname: ""
"volumes": [
{
"containerPath": "/data",
"mode": "RW",
"external": {
"name": "redis4volume",
"provider": "dvdi",
"options": {
"dvdi/driver": "rexray"
}
@pkazi
pkazi / getMesosZKData.py
Created October 22, 2018 09:20
DCOS Get znode data from Mesos zookeeper using zookeeper python client
from kazoo.client import KazooClient
zk = KazooClient(hosts='leader.mesos:2181', read_only=True)
zk.start()
clusterId = ""
# Here we can give znode path to retrieve its decoded data,
# for ex to get cluster-id, use
# data, stat = zk.get("/cluster-id")
# clusterId = data.decode("utf-8")
@pkazi
pkazi / dcosTasksByNode.sh
Created October 22, 2018 09:17
DCOS Get tasks by node IP using Rest api and cli
#!/bin/bash
function tasksByNodeAPI
{
echo "DC/OS Tasks By Node"
if [ "$#" -eq 0 ]; then
echo "Need node ip as input. Exiting."
exit 1
fi
nodeIp=$1
@pkazi
pkazi / dcosRunOnAllMasters.sh
Created October 22, 2018 09:15
DCOS Run any shell command on all master nodes
#!/bin/bash
# Run any shell command on all master nodes
# Usage : dcosRunOnAllSlaves.sh <CMD= any shell command to run, Ex: ulimit -a >
CMD=$1
for i in `dcos node | egrep -v "TYPE|agent" | awk '{print $2}'`
do
echo -e "\n###> Running command [ $CMD ] on $i"
dcos node ssh --option StrictHostKeyChecking=no --option LogLevel=quiet --master-proxy --private-ip=$i "$CMD"
@pkazi
pkazi / dcosRunOnAllSlaves.sh
Created October 22, 2018 09:14
DCOS Run any shell command on all slave nodes (private and public)
#!/bin/bash
# Run any shell command on all slave nodes (private and public)
# Usage : dcosRunOnAllSlaves.sh <CMD= any shell command to run, Ex: ulimit -a >
CMD=$1
for i in `dcos node | egrep -v "TYPE|master" | awk '{print $1}'`; do
echo -e "\n###> Running command [ $CMD ] on $i"
dcos node ssh --option StrictHostKeyChecking=no --option LogLevel=quiet --master-proxy --private-ip=$i "$CMD"
echo -e "======================================\n"