Skip to content

Instantly share code, notes, and snippets.

View zypeh's full-sized avatar
🔎
If you look for perfection, you'll never be content.

zypeh zypeh

🔎
If you look for perfection, you'll never be content.
View GitHub Profile
# !/usr/python
# The FIN scan utilizes the FIN flag inside the TCP packet,
# along with the port number to connect to on the server.
# If there is no response from the server, then the port is open.
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
@zypeh
zypeh / Startup.gist
Last active December 27, 2015 23:49
Yet another suggestions for Metasploit Dev Setup Environment Wiki
#Use a gemset so we use 1.9.3-p448 when startup
$ cd ./metasploit-framework
$ rvm use 1.9.3-p125
$ rvm gemset create msf
$ echo "rvm use 1.9.3-p125@msf" > .rvmrc
$ rvm use 1.9.3-p125@msf
------- This is mine ----------
@zypeh
zypeh / net.py
Last active August 29, 2015 14:10
Check network interface
#!/usr/bin/env python
import time
import sys
if len(sys.argv) > 1:
INTERFACE = sys.argv[1]
else:
INTERFACE = 'eth0'
STATS = []
@zypeh
zypeh / designer.html
Last active August 29, 2015 14:15
designer
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
-- single line comment, no multi-line comment allowed. Keep it simple, okay ?
-- https://futhark-lang.org/blog/2017-10-10-block-comments-are-a-bad-idea.html
---------------------------------------------------
-- Functions and Values Assignment --
---------------------------------------------------
let varname = 1
let varname_with_type: Bool = true
-- ^-- values name ^-- type
-- comments
--| doc comments, should support latex (my dream)
--|prefix| prefixed comments
--[block comment]--
--[prefix| prefixed block comment]--
[1, 2, 3] -- lists
1 :: 2 :: 3 :: [] -- list
-- Types, should starts with uppercase letters
-- comments
--| doc comments (default markdown)
--| prefix | prefixed comments
--[ block comment
]--
--[ prefix |
prefixed block comment
]--
-- 'Topoi Core' is basically the desugared topoi language.
-- Only consists of basic primitive atoms and functions.
-- This is largely referenced to the ML language, Pie language from the book
-- 'The Little Typer' and (GHC Core)
-- [https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/core-syn-type]
-- write once variable, top level no need to write `let`
n = 3
@zypeh
zypeh / stlc.rs
Created December 9, 2020 12:40
Type-checker for Simply Typed Lambda Calculus
use std::boxed::Box;
/// Simply typed lambda calculus is based on untyped lambda calculus, but
/// added a simple type. (Which is the function type A -> B)
#[derive(PartialEq, Eq, Debug)]
enum Type {
/// Base type
BuiltIn(&'static str), Var(String),
/// Function type (Type * Type)
Lambda(Box<Type>, Box<Type>),