This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # Just for practicing the file operation in python | |
| def file_basics(): | |
| print ' File Operations\n', '*' * 80 | |
| types_of_file = """ | |
| Text Files represent content as normal str strings, perform unicode and decoding automatically (plain) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import hashlib | |
| """ | |
| one.txt | |
| This sentence is encrypted using XOR cipher. | |
| """ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import this | |
| ''' | |
| The Zen of Python, by Tim Peters | |
| Beautiful is better than ugly. | |
| Explicit is better than implicit. | |
| Simple is better than complex. | |
| Complex is better than complicated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Netcat | |
| ====== | |
| The Netcat tool is known as the Swiss Army knife for TCP/IP connections. | |
| (netcat or nc both are same) | |
| nc -h | |
| netcat -h | |
| man netcat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // PARENT - JavaScript (Parent.html) | |
| window.addEventListener('message', function (event) { | |
| console.log("Hello from -> " + event.data); | |
| // Ignores messages from untrusted domains. | |
| //if (event.origin != 'URL of Iframe') return; | |
| }); | |
| // IFRAME - JavaScript (child.html) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from time import sleep | |
| from threading import Timer | |
| def sleep_sort(values): | |
| sleep_sort.result = [] | |
| def add1(x): | |
| print 'Appending value in list -> %d' % x | |
| sleep_sort.result.append(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function f() { | |
| sleep "$1" | |
| echo "$1" | |
| } | |
| while [ -n "$1" ] | |
| do | |
| f "$1" & shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Well I am a beginner. | |
| netcat 23.23.190.204 2002 | |
| Welcome | |
| Enter 20 spam words to authenticate yourself. | |
| 01/20: spam | |
| 02/20: maps | |
| 03/20: hot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Berlekamp-Massey Algorithm | |
| #from __future__ import print_function | |
| s = [GF(2)(0), 0, 1, 0, 0, 0, 0, 0, 1, 1, 0] #input sequence | |
| n = len(s) | |
| C = [GF(2)(1)] | |
| B = [GF(2)(1)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| def gcd(a, b): | |
| while a != b: | |
| if a > b: | |
| a = a - b | |
| else: | |
| b = b - a | |
| return a |