Skip to content

Instantly share code, notes, and snippets.

View sentinelleader's full-sized avatar

Deepak Mohandas sentinelleader

View GitHub Profile
@sentinelleader
sentinelleader / web-servers.md
Created May 13, 2021 14:02 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@sentinelleader
sentinelleader / ls.rst
Created February 13, 2018 12:04 — forked from amitsaha/ls.rst
How does `ls` work?

How does ls work?

I wanted to be really able to explain to a fair amount of detail how does the program ls actually work right from the moment you type the command name and hit ENTER. What goes on in user space and and in kernel space? This is my attempt and what I have learned so far on Linux (Fedora 19, 3.x kernel).

How does the shell find the location of 'ls' ?

@sentinelleader
sentinelleader / gist:6f9c27a1ed495aa8568ce12c679902b5
Created November 27, 2017 07:58 — forked from ptigas/gist:2820165
linked list implementation in python
class Node :
def __init__( self, data ) :
self.data = data
self.next = None
self.prev = None
class LinkedList :
def __init__( self ) :
self.head = None
<Response>
<Gather input="speech"
action="http://0a485498.ngrok.io/"
partialResultCallback="http://0a485498.ngrok.io/">
<Say>Say ahoy to Twilio Speech Recognition!</Say>
</Gather>
</Response>
@sentinelleader
sentinelleader / complexitypython.txt
Created September 27, 2017 01:15 — forked from Gr1N/complexitypython.txt
Complexity of Python Operations
Complexity of Python Operations
In this lecture we will learn the complexity classes of various operations on
Python data types. Then we wil learn how to combine these complexity classes to
compute the complexity class of all the code in a function, and therefore the
complexity class of the function. This is called "static" analysis, because we
do not need to run any code to perform it.
------------------------------------------------------------------------------
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI)
# This should be performed as root since it's going to be installing a bunch of stuff
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached
#! /bin/bash
#
# This script needs "fpm". If you dont have it,
# run "gem install fpm"
#
# You also need to "apt-get install python-setuptools" (otherwise fpm fails)
clean() {
rm -rf whisper-0.9.9 carbon-0.9.9 graphite-web-0.9.9
@sentinelleader
sentinelleader / munin-graphite.rb
Created September 11, 2012 17:08
munin-graphite
#!/usr/bin/env ruby
#
# graphite-mdash client - build ontop of munin-graphite
#
# Copyright: Copyright (c) 2012, Jonas Genannt <jonas@brachium-system.net>
#
# Author:: Adam Jacob (<adam@hjksolutions.com>)
# Copyright:: Copyright (c) 2008 HJK Solutions, LLC
# License:: GNU General Public License version 2 or later
#
@sentinelleader
sentinelleader / snowden-ietf93.md
Last active August 29, 2015 14:27 — forked from mnot/snowden-ietf93.md
Transcript of Edward Snowden's comments at IETF93.
@sentinelleader
sentinelleader / rmq-publish-with-header.c
Last active August 29, 2015 14:23
rmq-publish-with-header.c for Mosquitto MQTT broker
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <clem_rmq.h>
#include <assert.h>
#include <amqp_tcp_socket.h>
#include <amqp.h>