Skip to content

Instantly share code, notes, and snippets.

View amandoabreu's full-sized avatar

Amando Abreu amandoabreu

View GitHub Profile
# Create function
CREATE OR REPLACE FUNCTION get_organization_id_by_user_id(p_user_id INTEGER)
RETURNS INTEGER AS $$
DECLARE
v_organization_id INTEGER;
BEGIN
SELECT organization
INTO v_organization_id
FROM users
WHERE id = p_user_id;
@amandoabreu
amandoabreu / nuke-docker
Created March 4, 2019 16:36
Nuke docker containers, volumes, and all
$ docker system prune
This will remove:
- all stopped containers
- all volumes not used by at least one container
- all networks not used by at least one container
- all dangling images
As below, this is nuclear.
To clean your system, first remove containers
@amandoabreu
amandoabreu / revslider-exploit.pl
Created March 4, 2019 07:46 — forked from blackknight36/revslider-exploit.pl
pwn a vulnerable wordpress site
#!/usr/bin/perl
#
# Title: Slider Revolution/Showbiz Pro shell upload exploit
# Author: Simo Ben youssef
# Contact: Simo_at_Morxploit_com
# Discovered: 15 October 2014
# Coded: 15 October 2014
# Updated: 25 November 2014
# Published: 25 November 2014
# MorXploit Research
@amandoabreu
amandoabreu / downvote.js
Last active October 23, 2018 17:12
Downvote all reddit comments in any given page(vanilla)
/* Likely is caught by vote-spamming filters,
but it's just to feel better anyway,
just copy and paste the following into your console and press enter
*/
var simulateClick = function (elem) {
var evt = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window
});
@amandoabreu
amandoabreu / tortoiseandthehare.js
Last active October 18, 2018 06:39
Finding cycles by iterating a list at different speeds until the same value is reached
const EMPTY = null;
const isEmpty = (node) => node === EMPTY;
const pair = (first, rest = EMPTY) => ({first, rest});
const list = (...elements) => {
const [first, ...rest] = elements;
return elements.length === 0
? EMPTY
: pair(first, list(...rest))
$(window).scroll(function() {
if ($(this).scrollTop() > 0){
$('body').addClass("header-detached");
} else {
$('body').removeClass("header-detached");
}
});
@amandoabreu
amandoabreu / Css-image-mask-to-create-gritty-overlays-.markdown
Created February 6, 2015 00:20
Css image mask to create gritty overlays