Skip to content

Instantly share code, notes, and snippets.

# How to create an RPM repository
# This is for Redhat 64 bit versions of Linux. You can create your own RPM repository # to host your custom RPM packages.
#
# See "How to create an RPM from source with spec file" for more information.
# https://gist.github.com/1376973
# Step: 1
# Install createrepo
#!/bin/sh
# This is for Redhat 64 bit versions of Linux with `createrepo` installed. If you
# do not have createrepo, you can install it with:
# yum install -y createrepo
# Change DESTDIR path to RPMS directory of your repo
DESTDIR="/var/www/repo/rhel/6"
for ARCH in x86_64
@miku
miku / main.tex
Last active August 29, 2015 13:56
Nuclid Map.
% From: https://docs.google.com/file/d/0B6hnQC2sJnn-R2RaZ2gybUNaQjg/edit?pli=1
% \usepackage[usenames,dvipsnames]{pstricks}
% \usepackage{epsfig}
% \usepackage{pst-grad} % For gradients
% \usepackage{pst-plot} % For axes
% User Packages:
% \usepackage{arial}
\psscalebox{1.0 1.0} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-9.555931)(28.244461,9.555931)
@miku
miku / 1-jquery.html
Last active August 29, 2015 13:56
Progression. See also: http://imgur.com/a/Fdwxp
<!--
Visual comparison: http://imgur.com/a/Fdwxp
* Basic display.
* No multiple tags, multiple subfield values.
* No "Show more".
* 25 LOC.
-->
<script type="text/javascript">
$(document).ready(function() {
@miku
miku / escats.sh
Last active August 29, 2015 13:56
ES cats.
# just the master
curl localhost:9200/_cat/master
# all nodes
curl localhost:9200/_cat/nodes
# all indices
curl localhost:9200/_cat/indices
# (bsz) shards ok (STARTED)?
@miku
miku / snippet.py
Last active August 29, 2015 13:56
Using lftp inside a luigi task.
#
# It's not really elegant (I'm happy to hear about alternatives),
# but has done what it should so far.
#
# lftp takes care of the mirroring and this task is completed if a single file containing
# the paths to the mirrored file has been successfully written - so it's a bit indirect,
# but at least follows the one-file-per-task rule.
#
# It would be ok to run this task over and over, since after the first transfer the directories
# should be in sync.
@miku
miku / README.md
Last active August 29, 2015 13:56
Bayes et al.

Story

A conditional probability is a probability based on some background information - that make up a condition.

The cookie problem

* Resilience instead of strength
* Pull, instead of push
* Take risks, instead of safety
* System, instead of objects
* God compasses, not maps
* Work on practice, instead of theory
* Disobedience, instead of compliance
* Crowd, instead of the experts
* Learning, instead of education
@miku
miku / kadane.py
Last active August 29, 2015 13:57
kadane
#!/usr/bin/env python
def max_subarray(A):
max_ending_here = max_so_far = 0
for x in A:
max_ending_here = max(0, max_ending_here + x)
max_so_far = max(max_so_far, max_ending_here)
return max_so_far
if __name__ == '__main__':
@miku
miku / LSH.md
Last active August 29, 2015 13:57
LSH notes

Notes

Basic problems: NN and ANN.

Locality sensitive hashing is a family of algorithms for NN.

Given a collection of n points, build a data structure which, given any query point, reports the data point, that is closest to the query.