Skip to content

Instantly share code, notes, and snippets.

View sandys's full-sized avatar

Sandeep Srinivasa sandys

View GitHub Profile
@sandys
sandys / pubkey_csr.md
Last active January 3, 2017 08:41
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 api.redcarpetup.com:443 | 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 api.redcarpetup.com:443 | openssl x509 -pubkey -noout | openssl rsa -pubin -noout -modulus

@sandys
sandys / magento.md
Last active December 19, 2016 08:25
magento requirements

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

@sandys
sandys / bootable_usb_win10_from_linux.sh
Created June 11, 2016 17:09
create bootable Windows 10 USB drive from Ubuntu./Fedora
msdos partition table, fat32, boot flag.
Laptop set to UEFI only
mount iso - rsync -aP iso_path/* usb_drive/
reboot
@sandys
sandys / mailr_send.R
Last active October 10, 2018 21:08
R code to send email using Amazon SES
# first install mailR. It is a bit funky to install this because of the dependency on rJava
#First install java
### sudo add-apt-repository ppa:webupd8team/java
### sudo apt-get update
### sudo apt-get install oracle-java8-installer
#now you can install mailR. The assumption is that java is in /usr/lib/jvm/jdk1.8.0_66/. Check if a newer version has changed the directory
sudo JAVA_HOME=/usr/lib/jvm/jdk1.8.0_66/ R CMD javareconf
sudo JAVA_HOME=/usr/lib/jvm/jdk1.8.0_66/ Rscript -e 'install.packages(c("mailR"), .Library.site[1], repos="http://cran.us.r-project.org", dependencies=TRUE)'
@sandys
sandys / aws_config
Last active February 17, 2017 07:06
[default]
region = ap-southeast-1
s3 =
max_concurrent_requests = 20
max_queue_size = 10000
multipart_threshold = 64MB
multipart_chunksize = 16MB
use_accelerate_endpoint = true
@sandys
sandys / server.R
Created November 30, 2015 20:01 — forked from MattSandy/server.R
Creates a websocket based JSON server
#Connect to this using websockets on port 9454
#Send in the format of {"data":[1,2,3]}
#The ppp returns the standard deviation of the sent array
library(jsonlite)
library(httpuv)
#server
app <- list(
onWSOpen = function(ws) {
ws$onMessage(function(binary, message) {
write(message, file = "log.txt",append = TRUE, sep = "\n")
sudo dnf install cairo-devel
install.packages("Rserve")
install.packages("Cairo")
install.packages("MASS")
install.packages("stringr")
install.packages("ggplot2")
@sandys
sandys / memory_check.py
Last active November 17, 2015 10:40
installing scikit on Linux (Fedora 23)
>>> import os, psutil
>>> psutil.Process(os.getpid()).get_memory_info().rss / 1e6
20.324352
>>> %time import numpy
CPU times: user 1.95 s, sys: 1.3 s, total: 3.25 s
Wall time: 530 ms
>>> psutil.Process(os.getpid()).get_memory_info().rss / 1e6
349.507584
@sandys
sandys / fastcgi_params
Created September 16, 2015 12:57
fastcgi params for wordpress on debian 8 with php5-fpm
#These two lines were missing from my /etc/nginx/fastcgi_params, make sure they are there!
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
@sandys
sandys / innobackupex.sh
Last active September 16, 2015 14:43
innobackup working
#source
innobackupex --user=root --password=root /www/DB-BACKUP
#destination
scp root@server:/www/DB-BACKUP /tmp
innobackupex --apply-log --ibbackup=xtrabackup /tmp/DB-BACKUP/2015-09-16_12-05-39/
innobackupex --copy-back /tmp/DB-BACKUP/2015-09-16_12-05-39/
rm /var/lib/mysql-new/ib_logfile1
rm /var/lib/mysql-new/ib_logfile0