Skip to content

Instantly share code, notes, and snippets.

@navin-mohan
navin-mohan / tlp.sh
Created April 9, 2018 06:50
Setup TLP
#!/bin/bash
sudo pacman -S tlp --noconfirm
sudo systemctl enable tlp.service
sudo systemctl enable tlp-sleep.service
sudo systemctl mask systemd-rfkill.service
sudo systemctl mask systemd-rfkill.socket
sudo systemctl start tlp.service
sudo systemctl start tlp-sleep.service
from html.parser import HTMLParser
class TextExtractionParser(HTMLParser):
'''
Custom HTML Parser that extracts
textual data from HTML
'''
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
self.word_list = []
@navin-mohan
navin-mohan / runningkey.cpp
Last active March 9, 2018 19:46
Running key cipher implementation in C++
/*
The Running Key
----------------
The running key cryptographic algorithm is a classical cipher that uses a long key
such as random sentences from books to encrypt another message. It uses a table for
mapping the cipher text using the key and the plain-text.
get more info here
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@navin-mohan
navin-mohan / mec_proxy_apt.conf
Created August 25, 2017 05:26
Apt conf for mec proxy
# /etc/apt/apt.conf
Acquire::http::Proxy "http://mec:mec@192.168.0.4:3128";
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define TAB_SIZE 100
#define SYMBOL_SIZE 30
#define OPCODE_SIZE 10
@navin-mohan
navin-mohan / symtab.c
Last active November 14, 2017 15:02
symtab complete
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define SYMTAB_SIZE 100
#define SYMBOL_SIZE 30
typedef unsigned int uint;
@navin-mohan
navin-mohan / Sources.list
Created August 18, 2017 17:38
Debian sources
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://deb.debian.org/debian/ stable main contrib non-free
deb-src http://deb.debian.org/debian/ stable main contrib non-free
deb http://deb.debian.org/debian/ stable-updates main contrib non-free
deb-src http://deb.debian.org/debian/ stable-updates main contrib non-free
@navin-mohan
navin-mohan / codeblocks.md
Last active August 15, 2017 10:19
CodeBlocks

Installing CodeBlocks

On Windows XP / Vista / 7 / 8.x / 10

Download the installer from any of the links below.

It includes both the compiler(gcc) and IDE.

Ubuntu

@navin-mohan
navin-mohan / helper_functions.py
Last active June 11, 2017 10:45
Helper Functions for ML
# Python 3
import numpy as np
from PIL import Image
from io import BytesIO
from IPython import display
def split_test_train(dataset,percent):
'''Randomly splits the data set into test and train sets'''