Skip to content

Instantly share code, notes, and snippets.

Anand asinode

Block or report user

Report or block asinode

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Following Links in Python
In this assignment you will write a Python program that expands on ( The program will
use urllib to read the HTML from the data files below, extract the href= vaues from the anchor tags, scan for a
tag that is in a particular position relative to the first name in the list, follow that link and repeat the process a
number of times and report the last name you find.
We provide two files for this assignment. One is a sample file where we give you the name for your testing and
print "Matrix Addition\n==============="
print "We need a few things from you. \nYou will give us the dimensions as well as the values for both matrices.\n"
print "Matrix-1:\n---------"
rows1 = input("How many rows you would like in your first matrix? ")
cols1 = input("How many columns you would like in your first matrix? ")
values1 = rows1 * cols1
print "The matrix you have chosen is, ", rows1, "x", cols1, "matrix with ", rows1, "rows and ", cols1, "columns, and totally ", values1, "elements inside the matrix."
list1 = []
asinode /
Created Aug 22, 2016 — forked from sagar-webonise/
Python script for taking mysqldump
#!/usr/bin/env python
import ConfigParser
import os
import time
import getpass
def get_dump():
print "Enter user:"
user = raw_input()
asinode /
Created Jul 18, 2016 — forked from bnagy/
Mutt, Gmail and GPG

GPG / Mutt / Gmail


This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
View gist:915480bd5da7046873534770fc40a512
<!doctype html>
<title>Site Maintenance</title>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
asinode /
Created May 3, 2016 — forked from Pablosan/
A bash script that will set up a new EC2 instance and ssh into it.
# Authorize TCP, SSH & ICMP for default Security Group
#ec2-authorize default -P icmp -t -1:-1 -s
#ec2-authorize default -P tcp -p 22 -s
# The Static IP Address for this instance:
IP_ADDRESS=$(cat ~/.ec2/ip_address)
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat)
asinode /
Created May 2, 2016 — forked from rrosiek/
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
echo -e "\n--- Mkay, installing now... ---\n"

#Debian 8 DO Locale Issues Fix


"Locale problems" in both the 32-bit & 64-bit versions of Debian 8 droplets

Create a new Debian 8 droplet and login as root:

asinode / gist:e5a1acfc7ad2712d6658
Created Jul 20, 2015
Naive Bayes Classifier using JasonBrownlee's Blog Post (100% copy of his work)
View gist:e5a1acfc7ad2712d6658
"cells": [
"cell_type": "markdown",
"metadata": {
"collapsed": false
"source": [
"# How To Implement Naive Bayes From Scratch in Python"
You can’t perform that action at this time.