Skip to content

Instantly share code, notes, and snippets.

@hiteshjasani
hiteshjasani / readme.md
Last active May 31, 2018 21:34
Tmux conf

Sample commands working with tmux

# start tmux
% tmux new-session -s mysession

# detach from session
`d

# reattach to session
@hiteshjasani
hiteshjasani / Editors.hs
Created September 29, 2014 23:42
Parsing html with Haskell
---------------------------------------------------------------
-- |
-- Module : Editors
-- Copyright : (c) Hitesh Jasani, 2007
-- License : BSD3
--
-- Maintainer : Hitesh Jasani <[email protected]>
-- Stability : provisional
-- Portability :
--
@hiteshjasani
hiteshjasani / gist:135b186db1fe2eb6ab36
Last active August 29, 2015 14:07
Nim example of Haskell Maybe type
###############################
## Library code
type
TMaybeKind = enum
mkJust,
mkNothing
TMaybe[T] = object
case kind: TMaybeKind
of mkJust: val: T
@hiteshjasani
hiteshjasani / jeromq_context_term_hang_bug.md
Last active November 20, 2015 13:09
Terminate context hang

Main Thread:

  • create context (zmq/context 1)
  • create workers and pass them the context
  • start the worker threads
  • addShutdownHook
    • shutdown the worker threads
    • join the worker threads
    • sleep 2s ;; without this line the terminate context sometimes hangs, with it so far it has never hung
    • terminate the context (.term context) ;; sometimes hangs here
@hiteshjasani
hiteshjasani / sysctl.yml
Created November 22, 2016 17:16 — forked from jkordish/sysctl.yml
ansible sysctl for ec2. perferrably used for 1g nics.
- hosts: localhost
tasks:
- name: update sysctl
action: sysctl state=present reload=yes {{ item }}
with_items:
# max open files
- name=fs.file-max value=65535
# lets not use swap.
- name=vm.swappiness value=0
# enable syn coockies. this can actually cause overhead.
@hiteshjasani
hiteshjasani / clojars.md
Last active November 10, 2022 08:34
Clojars instructions

Publish Release

  1. Update version in project.clj
  2. lein deploy clojars

Setup

Project

1. Ensure prefix is on project in project.clj

@hiteshjasani
hiteshjasani / tensorflow_build.sh
Last active October 15, 2020 08:26
Building tensorflow using Bazel with cpu optimizations
# Install bazel
# download tensorflow src
# Checkout tagged version
# ./configure
# Compile
bazel build -c opt --copt=-march=native //tensorflow/tools/pip_package:build_pip_package
#bazel build -c opt --copt=-mavx --copt=-msse4.1 --copt=-msse4.2 //tensorflow/tools/pip_package:build_pip_package
# Build the PIP package
@hiteshjasani
hiteshjasani / homebrew-cheatsheet.md
Last active February 16, 2018 16:58
Homebrew cheatsheet
Command Desc
brew update Update brew package info
brew upgrade <package-name> Install new version of package
brew info <package-name> See which version is linked
brew ls <package-name> --versions List package versions
brew ls <package-name> List files in package
brew switch <package-name> <version> Link to specified version of package
brew cleanup Remove outdated package versions
@hiteshjasani
hiteshjasani / Makefile
Last active February 26, 2018 17:15
Clojurescript synthetic index examples
run:
clj -Sdeps '{:paths ["."] :deps {org.clojure/clojurescript {:git/url "https://github.com/clojure/clojurescript" :sha "ec0e4c49fa5bf97d6c8b5a8e5d3bd957855bfe56"}}}' -m cljs.main -re browser -c index -r
run-reagent:
clj -Sdeps '{:paths ["."] :deps {org.clojure/clojurescript {:git/url "https://github.com/clojure/clojurescript" :sha "ec0e4c49fa5bf97d6c8b5a8e5d3bd957855bfe56"} reagent {:mvn/version "0.8.0-alpha2"}}}' -m cljs.main -re browser -c index-reagent -r
@hiteshjasani
hiteshjasani / gpg-lein-clojars-cheatsheet.md
Last active March 3, 2018 04:25
GPG, lein and clojars

Solution

$ GPG_TTY=$(tty) lein deploy clojars

This will pop up an ascii window asking for the password to the key. It then continues with the deploy to clojars.