Skip to content

Instantly share code, notes, and snippets.

View KazChe's full-sized avatar

kam chehresa KazChe

View GitHub Profile
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB({ apiVersion: '2012-08-10' });
var docClient = new AWS.DynamoDB.DocumentClient()
var params = {
TableName: "mytable",
FilterExpression: "#schedule_type = :schedule_type_val",
ExpressionAttributeNames: {
"#schedule_type": "schedule_type",
},
// we can narrow the returned result - still does a full-scan
@KazChe
KazChe / shared_folder_centos_virtualbox.txt
Last active March 3, 2017 18:13 — forked from larsar/shared_folder_centos_virtualbox.txt
Mount shared folder on CentOS in VirtualBox
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot
(from : https://simplifiedthinking.co.uk/2015/10/03/install-mqtt-server/ )
Installing Brew
The Mosquitto MQTT Server can be easily installed using Homebrew. If it’s not installed on your system already, then a quick visit to the homepage will give you all you need to get going. Homebrew is an OS X Package Manager for installing and updating non-Mac OS X utilities that are more commonly found in other variants of Linux. To install the basic package manager run the following command.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installing Mosquitto MQTT
@KazChe
KazChe / UDJC.java
Created August 11, 2016 21:34
Pentaho PDI - User Defined Java Class - Simple Implementation
private FieldHelper fieldOne = null;
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
Object[] r = getRow();
if (r == null) {
setOutputDone();
return false;
}
curl -X POST --data <filename> http://<URL> -H "key:value>" -H "<if multiple headers>"
FROM centos:centos6
#Install WGET
RUN yum install -y wget
#Install tar
RUN yum install -y tar
# Download JDK
RUN cd /opt;wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz; pwd
@KazChe
KazChe / gist:a75a7d165649846fd50e
Created December 13, 2014 23:54
nodejs encrypt / decrypt
var fs = require('fs'),
crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq',
payload = {
"id": "12345",
"description": "description",
"location": "123 street",
"userIdentity": {
"phoneNumber": "5550000000",
@KazChe
KazChe / request_template
Created May 2, 2014 01:46
blog_hateoas_transition_request_template
{
"links":[
{
"rel":"addphone",
"href":"http://localhost:8080/rest/account/v1/addphone",
"httpMethod":"POST",
"stateTransitionVars":{
"phoneNumber": {
"countryCode": "",
"phoneNumber": ""
@KazChe
KazChe / swap.html
Created March 29, 2014 08:34
blog_ajax_loader_swap_markup
$('#moneyman').each(function() {
$("<button id='moneyman'><img src='/ap/resources/images/299.GIF' />).attr(
{ name: this.name,
value: this.value
}).insertBefore(this);
}).remove();
@KazChe
KazChe / loader.html
Created March 29, 2014 08:25
blog_ajax_loader_markup
<div id="asyncCall" style="width: 10px;">
<input id="moneyman" style='width:190px;' type="button" value="Request Money">
<span id="asyncErrors" style="color:red;"></span>
</div>