Skip to content

Instantly share code, notes, and snippets.

View gozes's full-sized avatar

Juan A. Sanchez gozes

View GitHub Profile
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@scottjad
scottjad / Rakefile.diff
Created September 27, 2011 06:59
Octopress Rakefile changes to support org-mode
@@ -20,9 +20,10 @@ blog_index_dir = 'source' # directory for your blog's index pa
deploy_dir = "_deploy" # deploy directory (for Github pages deployment)
stash_dir = "_stash" # directory to stash posts for speedy generation
posts_dir = "_posts" # directory for blog files
+org_posts_dir = "org_posts"
themes_dir = ".themes" # directory for blog files
-new_post_ext = "markdown" # default new post file extension when using the new_p
-new_page_ext = "markdown" # default new page file extension when using the new_p
+new_post_ext = "org" # default new post file extension when using the new_post t
+new_page_ext = "org" # default new page file extension when using the new_page t
@tenderlove
tenderlove / terrible.rb
Last active May 16, 2020 13:13
I am a terrible person
require 'fiddle'
module IAmAHorriblePerson
def unset flag
value = _wrap self
flags = 8.times.map { |i| value[i] }.pack('C8').unpack('Q').first
[flags & ~flag].pack('Q').unpack('C8').each_with_index { |n,i|value[i] = n }
end
def class= k
@Jxck
Jxck / rob.go
Last active November 17, 2022 20:34
gocon 2014
type errWriter struct {
w io.Writer
err error
}
func (e *errWriter) Write(p []byte) {
if e.err != nil {
return
}
_, e.err = e.w.Write(p)
@ucarion
ucarion / lib.rs
Created December 18, 2014 03:08
Rust State Monad
/Users/ulyssecarion/rust/sparsile/src/lib.rs:7:9: 13:10 error: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
/Users/ulyssecarion/rust/sparsile/src/lib.rs:7 State {
/Users/ulyssecarion/rust/sparsile/src/lib.rs:8 runState: |firstState| {
/Users/ulyssecarion/rust/sparsile/src/lib.rs:9 let (result, nextState) = (self.runState)(firstState);
/Users/ulyssecarion/rust/sparsile/src/lib.rs:10
/Users/ulyssecarion/rust/sparsile/src/lib.rs:11 (f(result).runState)(nextState)
/Users/ulyssecarion/rust/sparsile/src/lib.rs:12 }
...
/Users/ulyssecarion/rust/sparsile/src/lib.rs:6:65: 14:6 note: first, the lifetime cannot outlive the block at 6:64...
/Users/ulyssecarion/rust/sparsile/src/lib.rs:6 fn and_then<B>(&self, f: |A| -> State<S, B>) -> State<S, B> {
@bkaradzic
bkaradzic / orthodoxc++.md
Last active July 29, 2024 04:50
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
-- Findings: almost everything could be inferred
@queertypes
queertypes / Logging.hs
Created April 22, 2016 01:33
Simple, context-rich logging module in Haskell
module API.Logging (
-- * Initialize
mkLog,
-- * Context, Types
Context(..),
Method(..),
Log,
-- * Logging

How to pass the OSCP

  1. Recon
  2. Find vuln
  3. Exploit
  4. Document it

Recon

Unicornscans in cli, nmap in msfconsole to help store loot in database.

@unfo
unfo / oscp-tips.md
Last active December 13, 2018 17:14

A few tips for OSCP

  1. Doing all of the exercises is important since you will discover low-hanging fruit from the labs based on the recon you do with the different tools in the exercises.
  2. Be wary of doing full /24 range port scans, especially for anything more than a few TCP ports. The machines might be in all sorts of broken states left by students etc.
  3. When starting to recon a specific machine:
  • Revert
  • Port scan
  • Try to identify services

Those steps in that order are important. You want a fresh state for the machine and you want to do just simple port scanning first because doing nmap's service scanning or nse scripts might send payloads that actually crash services. So be careful.