Skip to content

Instantly share code, notes, and snippets.

View redserpent7's full-sized avatar

Zaid Amir redserpent7

View GitHub Profile
@redserpent7
redserpent7 / web3-solc-contract-compile-deploy.js
Created February 25, 2018 19:20 — forked from tomconte/web3-solc-contract-compile-deploy.js
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);
@redserpent7
redserpent7 / imagemagick.bash
Created December 5, 2017 13:42 — forked from bensie/imagemagick.bash
ImageMagick Static Binaries for AWS Lambda
#!/usr/bin/env bash
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime
# As of Nov 23, 2015, this is Amazon Linux AMI 2014.09.2 x86_64 (ami-0c682c64)
#
# Lambda includes ImageMagick 6.7.8-9 preinstalled, so you need to prepend PATH
# with the folder containing these binaries in your Lambda function to ensure
# these newer binaries are used.
sudo yum -y install libpng-devel libjpeg-devel libtiff-devel gcc
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: CMAKE_C_COMPILER-NOTFOUND
Build flags:
Id flags:
The output was:
No such file or directory
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
@redserpent7
redserpent7 / es_groovy_issue.sh
Last active August 29, 2015 14:20
ES example of groovy not throwing any exceptions when ctx._source is misspelled.
export ES_HOST=http://localhost:9200
# Create an index we will call it users
curl -XPUT $ES_HOST/users
# Configure mapping, files with path and size
curl -XPUT $ES_HOST/users/files/_mapping -d '
{
"doc": {
"properties": {
#Create an Index
curl -XPUT 'localhost:9200/files
#Create index mapping enabling _source and disabling _all fields
#Without the store property set to true, no results are returned
curl -XPUT /files/rawfiles/_mapping -d '{
"rawfiles": {
"_source": {
"enabled": true