Skip to content

Instantly share code, notes, and snippets.

@ixs
ixs / ssltest.py
Last active February 28, 2020 21:41
Heartbleed test with data dump functionality.
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
#
# Modified slightly by Andreas Thienemann <athienemann@schubergphilis.com> for clearer exploit code
# and 64k reads
#
# This version of the exploit does write received data to a file called "dump" in the local directory
# for analysis.
@phikshun
phikshun / netgear_upnp_csrf.rb
Created March 18, 2014 23:44
Netgear UPnP CSRF
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
'Name' => 'NetGear UPnP CSRF',
@davidhooey
davidhooey / oracle_statistics_generating_and_seleting.sql
Created October 10, 2013 18:48
Oracle Statistics Generating And Deleting
NOTE:
Oracle9i: estimate_percent defaults to NULL which is COMPUTE
Oracle10g: estimate_percent defaults to to_estimate_percent_type (get_param('ESTIMATE_PERCENT'))
-- ********************************
-- * Generating Schema Statistics *
-- ********************************
execute dbms_stats.gather_schema_stats(ownname=>'SCHEMAOWNER',estimate_percent=>NULL,cascade=>TRUE,degree=>dbms_stats.default_degree)
execute dbms_stats.gather_schema_stats(ownname=>'SCHEMAOWNER',estimate_percent=>NULL,cascade=>TRUE,degree=>dbms_stats.default_degree,method_opt=>'FOR ALL INDEXED COLUMNS SIZE AUTO')
execute dbms_stats.gather_schema_stats(ownname=>'SCHEMAOWNER',estimate_percent=>NULL,cascade=>TRUE,degree=>dbms_stats.default_degree,method_opt=>'FOR ALL INDEXED COLUMNS SIZE 1') -- No Histograms
@rinze
rinze / dataframe_matrix_timing.R
Last active December 21, 2015 15:58
Difference in timing for vectorized simple operations between an R matrix and a data.frame.
# Timing measurement in R. Vectorized operation on matrix / data.frame
# Author: José María Mateos - jmmateos@ieee.org
#
# For certain vectorized operations, it makes sense to convert your data.frame
# into a matrix. Even if you are using apply, the data frame iteration can be
# real slow.
#
# In this example, I will compute the Euclidean distance for a random vector
# and a random matrix / data.frame of thousands of elements. Operations will be
# done in two different ways: using the apply function over the columns and
find ~/Downloads/Gmail -type f | grep -v '\.git' | ruby -rdate -e 'today = Date.today; STDIN.each { |path| content = File.read(path.strip); begin; from = content.grep(/^From:/).fetch(0); date = content.grep(/^Date:/).fetch(0); puts from if Date.parse(date) > today - 365; rescue IndexError; end }' | while read line; do echo "$line" | ~/.mutt/add-aliases.sh; done
package com.tumblr.fibr.service.filter
import com.tumblr.fibr.config.FilterConfig
import com.tumblr.fibr.tsdb.{TsdbRequest, TsdbResponse}
import com.google.common.cache.{Cache, CacheBuilder}
import com.twitter.finagle.Service
import com.twitter.util.Future
import java.util.concurrent.{Callable, TimeUnit}
/**
@tcr
tcr / gist:5108489
Created March 7, 2013 14:42
Testing Twitter official API keys
// npm install rem read
var rem = require('rem')
, fs = require('fs')
, read = require('read');
var tw = rem.connect('twitter.com', '1.1')
, oauth = rem.oauth(tw);
// Add whichever API keys you want to test here.
// Including the iPhone/Android apps, these keys are configured as "desktop"
@sam
sam / PatternMatching.scala
Last active December 14, 2015 09:50
Pattern Matching examples. Try them out in your REPL!
// One way to think about "match" is as a "map" method for arbitrary objects:
// So I can "map" a number:
10 match { case i => i * 4 }
// Mapping Tuples is especially awesome:
(1, "one") match { case (i,s) => i + 1 -> s"$s!!!" }
// Ok, maybe you're not all that impressed. Now that you know
// you can "map" a Tuple with Pattern Matching, it makes using
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
# create our directories