Skip to content

Instantly share code, notes, and snippets.

View shulhi's full-sized avatar
🏃‍♂️

Shulhi Sapli shulhi

🏃‍♂️
View GitHub Profile
@shulhi
shulhi / request.json
Created July 21, 2021 00:21
generate-graph
{
"modifications": [
{
"name": "text_date",
"text": "2021-07-20"
},
{
"datasets": [
{
"data": [
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
module Lib where
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
--{-# LANGUAGE RankNTypes #-}
--{-# LANGUAGE UndecidableInstances #-}
--{-# LANGUAGE AllowAmbiguousTypes #-}
--{-# LANGUAGE GADTs #-}
import Data.Aeson
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
--{-# LANGUAGE RankNTypes #-}
--{-# LANGUAGE UndecidableInstances #-}
--{-# LANGUAGE AllowAmbiguousTypes #-}
--{-# LANGUAGE GADTs #-}
import Data.Aeson
@shulhi
shulhi / matrix-sgd.py
Created November 7, 2014 01:51
Low Rank appromixation using SGD
#!/usr/bin/python
#
# Created by Albert Au Yeung (2010)
#
# An implementation of matrix factorization
# http://www.quuxlabs.com/blog/2010/09/matrix-factorization-a-simple-tutorial-and-implementation-in-python/
#
try:
import numpy
except:
[root@cdh5-1 ~]# netstat -tunalp | grep LISTEN
tcp 0 0 192.168.0.86:9995 0.0.0.0:* LISTEN 3303/java
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 13256/redis-server
tcp 0 0 0.0.0.0:9996 0.0.0.0:* LISTEN 3277/java
tcp 0 0 0.0.0.0:56076 0.0.0.0:* LISTEN 16686/java
tcp 0 0 0.0.0.0:7180 0.0.0.0:* LISTEN 1944/java
tcp 0 0 192.168.0.86:9997 0.0.0.0:* LISTEN 3277/java
tcp 0 0 0.0.0.0:9998 0.0.0.0:* LISTEN 3326/java
tcp 0 0 0.0.0.0:7182 0.0.0.0:* LISTEN 1944/java
tcp 0 0 192.168.0.86:9999 0.0.0.0:* LISTEN 3326/java
import java.net.InetAddress;
import java.net.UnknownHostException;
public class dns {
public static void main(String[] args) throws UnknownHostException {
InetAddress addr = InetAddress.getLocalHost();
System.out.println(String.format(
"IP:%s hostname:%s canonicalName:%s",
addr.getHostAddress(),

This document contains some notes I have gathered while I was trying to setup a redis service using boot2docker running on OS X. This won't cover what Docker is, see Docker website for details.

Installing boot2docker

First, install Virtualbox and follow the steps at http://docs.docker.com/installation/mac/

Since Docker only runs on Linux, boot2docker runs a virtual machine in Virtualbox (or VMWare etc), however you can run the docker command on OS X

@shulhi
shulhi / algo.md
Last active August 29, 2015 14:01
Algorithm list
@shulhi
shulhi / cloudera.md
Created April 25, 2014 08:56
Cloudera Troubleshoot

If Zookeeper cannot be started, check for DNS resolution.

$ hostname
$ hostname -f
$ python -c 'import socket; print socket.getfqdn(), socket.gethostbyname(socket.getfqdn())'