Skip to content

Instantly share code, notes, and snippets.

Avatar

Neeraj nsabharwal

View GitHub Profile
@randerzander
randerzander / tickets.py
Last active Aug 18, 2020
SalesForce open cases list
View tickets.py
# See https://pip.pypa.io/en/latest/installing.html for how to install pip, then:
# pip install simple-salesforce
from simple_salesforce import Salesforce
import string
# To get your SFDC token, see https://help.salesforce.com/apex/HTViewHelpDoc?id=user_security_token.htm
# salesforce_login.txt should contain the following, one per line:
# Your Name
# your_email@sfdc_account.com
# your_password
@randerzander
randerzander / portbind.py
Last active Aug 29, 2015
python script for binding boot2docker-vm ports to localhost
View portbind.py
#!/usr/bin/python
import sys
from subprocess import Popen, PIPE
from subprocess import call
container_id = sys.argv[1]
p = Popen(['docker', 'port', container_id], stdin=PIPE, stdout=PIPE, stderr=PIPE)
output, err = p.communicate()
rc = p.returncode
@nsabharwal
nsabharwal / control.sh
Last active Jan 19, 2016 — forked from randerzander/control.sh
Ambari Service Start/Stop script
View control.sh
USER='admin'
PASS='admin'
CLUSTER='dev'
HOST=$(hostname -f):8080
function start(){
curl -u $USER:$PASS -i -H 'X-Requested-By: ambari' -X PUT -d \
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \
http://$HOST/api/v1/clusters/$CLUSTER/services/$1
}
You can’t perform that action at this time.