Skip to content

Instantly share code, notes, and snippets.

Sandeep Srinivasa sandys

Block or report user

Report or block sandys

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sandys /
Created Aug 18, 2019
Gridsearchcv with k-fold cross validation and early stopping
... import xgboost.sklearn as xgb
... from sklearn.model_selection import GridSearchCV
... from sklearn.model_selection import TimeSeriesSplit
... cv = 2
... trainX= [[1], [2], [3], [4], [5]]
... trainY = [1, 2, 1, 2, 1]
sandys /
Last active May 7, 2018
pythonhosted issues

user@instance-mumbai:~/docker-setup-v2/flask$ dig A

; <<>> DiG 9.10.3-P4-Ubuntu <<>> A ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3624 ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512

sandys / datadog.service
Last active Mar 22, 2018
Getting Datadog logs to work with Docker Swarm or journald
View datadog.service
Description=Datadog Docker Swarm
ExecStart=/bin/zsh -c "coproc while true; do ncat --ssl 10516; done ;journalctl -o json -f | jq -r --unbuffered '\"c441ade4f5f4d04c \" + ({ message:.MESSAGE, service_name:.COM_DOCKER_SWARM_SERVICE_NAME, container:.CONTAINER_NAME, containerid:.CONTAINER_ID_FULL, host:._HOSTNAME,pid:(._PID // \"-\"), timestamp:(.__REALTIME_TIMESTAMP|tonumber/1000000|todate),\"syslog.severity\":((.PRIORITY|tonumber)) }|tostring)' >&p 2>&p"
sandys /
Created Mar 3, 2018
getting nvidia-docker2 with CUDA running on Ubuntu-16.04
sudo add-apt-repository ppa:graphics-drivers
curl -fsSL | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] \
$(lsb_release -cs) \
curl -s -L | sudo apt-key add -
sandys /
Created Feb 27, 2018
Converting set of images into PDF using Pillow
from PIL import Image
import requests
from io import BytesIO
from io import StringIO
url1 = ",q_95,e_sharpen:50,w_480/e_saturation:05/"
url2 = ""
url3 = ""
sandys / vscode-gatsby.conf
Created Jan 26, 2018
visual studio setup to debug gatsbyjs
View vscode-gatsby.conf
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
"version": "0.2.0",
"configurations": [
"name": "Launch (Production)",
"type": "node",
"request": "launch",
sandys /
Last active Jun 8, 2019
Registering a hardware token


Fedora - sudo dnf install pcsc-tools opensc ccid

ubuntu - sudo dnf install pcsc-tools opensc libccid

Find out where OpenSC has installed the pkcs11 module.

For OS X with binary installation this is typically in /Library/OpenSC/lib/. Homebrew users can use export OPENSC_LIBS=$(brew --prefix opensc)/lib

sandys /
Created Feb 17, 2017
how to write a supervisord compatible shell script for pgbouncer (which can restart gracefully)
# inspired by
if [ -z "$DBNAME" ]; then
echo "Environment variable DBNAME is not set!!!"
exit 1
sed -i 's|DBNAME|'"$DBNAME"'|' /etc/pgbouncer/pgbouncer.ini
sandys /
Last active Jan 3, 2017
working with public key and CSR

##SHA256 hash of the public key openssl req -in namecheap-1549141.csr -noout -pubkey | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 ##will match openssl s_client -connect | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64

##modulus to check in browser openssl req -in namecheap-1549141.csr -noout -modulus ##will match openssl s_client -connect | openssl x509 -pubkey -noout | openssl rsa -pubin -noout -modulus

sandys /
Last active Dec 19, 2016
magento requirements

The project is a reverse auction ecommerce store for clothes - with search and facebook login.

You can’t perform that action at this time.