Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Ashok Bakthavathsalam kgashok

🎯
Focusing
Block or report user

Report or block kgashok

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
@kgashok
kgashok / cron.md
Created Dec 17, 2017 — forked from evancz/cron.md
Cron job to remind myself to stretch
View cron.md

Type crontab -l to see your cron jobs. Type crontab -e to edit them. You have to use Vim apparently.

Add a line like this:

0,30	*	*	*	*	/Users/YOURNAME/Documents/scripts/stretch.sh

That is on every 0th and 30th minute of the hour. Make sure all the separators in there are tabs!

@kgashok
kgashok / replace_words.js
Created Dec 14, 2017 — forked from mrcoles/replace_words.js
Replaces words in a web page
View replace_words.js
// ### Replace words in document
//
// Update all instances of `fromWord` to `toWord` within the text
// in the current document.
//
function replaceWordsInDocument(fromWord, toWord) {
if (/\s/.test(fromWord)) {
throw new Error('You must enter a single word without whitespace');
}
View Hemingway.fibonacci.js
// Ernest Hemingway
function fibonacci(size) {
var first = 0, second = 1, next, count = 2, result = [first, second];
if(size < 2)
return "the request was made but it was not good"
while(count++ < size) {
@kgashok
kgashok / reverseListBetweenMandN.md
Last active Oct 3, 2017 — forked from superlayone/reverseListBetweenMandN.md
Reverse a linked list from position m to n in-place and in one-pass.
View reverseListBetweenMandN.md

##Leetcode-Reverse Linked List II##

Reverse a linked list from position m to n. Do it in-place and in one-pass.

For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4,

return 1->4->3->2->5->NULL.

Note: Given m, n satisfy the following condition:

View serialAsyncMap.babel.js
var serialAsyncMap = function () {
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(collection, fn) {
var result, _iterator, _isArray, _i, _ref2, item;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
result = [];
_iterator = collection, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();
@kgashok
kgashok / Game.fsx
Created Mar 3, 2017 — forked from battermann/Game.fsx
Data-centric vs Function-centric Domain Design
View Game.fsx
open System
// -----------------------------------------------------------
// Domain
// -----------------------------------------------------------
module GameDomain =
type Dice = One | Two | Three | Four | Five | Six
@kgashok
kgashok / Game.fsx
Created Mar 3, 2017 — forked from battermann/Game.fsx
Data-centric vs Function-centric Domain Design
View Game.fsx
open System
// -----------------------------------------------------------
// Domain
// -----------------------------------------------------------
module GameDomain =
type Dice = One | Two | Three | Four | Five | Six
@kgashok
kgashok / enterprise-tic-tac-toe-2.fsx
Created Mar 3, 2017 — forked from swlaschin/enterprise-tic-tac-toe-2.fsx
Follow up to the example of implementing "enterprise" tic-tac-toe in a functional way.
View enterprise-tic-tac-toe-2.fsx
(*
enterprise-tic-tac-toe-2.fsx
Follow up to the example of implementing "enterprise" tic-tac-toe in a functional way.
* Added true capability based security.
Related blog post: http://fsharpforfunandprofit.com/posts/enterprise-tic-tac-toe-2/
*)
@kgashok
kgashok / info_sec python modules
Created Oct 31, 2016 — forked from sh1nu11bi/info_sec python modules
This a collection of Python modules commonly associated with InfoSec.
View info_sec python modules
Scapy: send, sniff and dissect and forge network packets. Usable interactively or as a library
pypcap, Pcapy and pylibpcap: several different Python bindings for libpcap
libdnet: low-level networking routines, including interface lookup and Ethernet frame transmission
dpkt: fast, simple packet creation/parsing, with definitions for the basic TCP/IP protocols
Impacket: craft and decode network packets. Includes support for higher-level protocols such as NMB and SMB
pynids: libnids wrapper offering sniffing, IP defragmentation, TCP stream reassembly and port scan detection
Dirtbags py-pcap: read pcap files without libpcap
flowgrep: grep through packet payloads using regular expressions
Knock Subdomain Scan, enumerate subdomains on a target domain through a wordlist
Mallory, extensible TCP/UDP man-in-the-middle proxy, supports modifying non-standard protocols on the fly
@kgashok
kgashok / C#Example.cs
Created May 10, 2016 — forked from ahmedahamid/C#Example.cs
Why I started to feel differently about C# | Using Dictionaries
View C#Example.cs
//
// (1) C#: Defining an initializing a dictionary [key type=string, value type=int]
//
Dictionary<string, int> dict = new Dictionary<string, int>()
{
{"Eve", 101},
{"George", 150},
{"Emma", 200}
};
//
You can’t perform that action at this time.