Skip to content

Instantly share code, notes, and snippets.

Avatar
🏴‍☠️

Anderson Bosa andersonbosa

🏴‍☠️
View GitHub Profile
@andersonbosa
andersonbosa / crypt.rb
Created Sep 20, 2022 — forked from ChunAllen/crypt.rb
Encryption using AES-256-CBC with Rails
View crypt.rb
module Crypt
class << self
ENCRYPTION_KEY = Rails.application.secrets[:encryption_key]
ALGO = 'aes-256-cbc'.freeze
def encrypt(value)
crypt(:encrypt, value)
end
@andersonbosa
andersonbosa / gist:d0f0d7cb102b5dcfcf14c692827be8f3
Created Sep 20, 2022 — forked from ericchen/gist:3081968
ruby openssl AES encrypt and decrypt
View gist:d0f0d7cb102b5dcfcf14c692827be8f3
require 'base64'
require 'digest'
require 'openssl'
module AESCrypt
def AESCrypt.encrypt(password, iv, cleardata)
cipher = OpenSSL::Cipher.new('AES-256-CBC')
cipher.encrypt # set cipher to be encryption mode
cipher.key = password
View hackerrank--staircase.js
function parse_frame_by_size (size, i) {
const spaces_to_add = size - i
const bricks_to_add = i
let frame = ""
for (let n = 1; n <= spaces_to_add; n++) {
frame = frame + " "
}
for (let n = 1; n <= bricks_to_add; n++) {
frame = frame + "#"
View .editorconfig
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
View parser-pensador.com.js
function parseResponseToDOM (html) {
var parser = new DOMParser()
var dom = parser.parseFromString(html, "text/html")
return {parser, dom}
}
async function getDomFromUrl (url) {
return fetch(url)
.then(resp => resp.text())
.then(parseResponseToDOM)
@andersonbosa
andersonbosa / url_encode.rb
Created May 18, 2022 — forked from vills/url_encode.rb
Percent encoding for URI conforming to RFC 3986. Ref: http://tools.ietf.org/html/rfc3986#page-12
View url_encode.rb
require 'liquid'
require 'uri'
# Percent encoding for URI conforming to RFC 3986.
# Ref: http://tools.ietf.org/html/rfc3986#page-12
module URLEncoding
def url_encode(url)
return URI.escape(url, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
end
end
View wordlist-generator-32198.sh
for j in $(seq 100 999); do
foo="%\&*+-/:;<=>?@\\_";
for (( i=0; i<${#foo}; i++ )); do
echo "3LetrasAqui$j${foo:$i:1}";
done;
done > out.txt
@andersonbosa
andersonbosa / cookiebase
Created May 11, 2022
Search for COOKIE explains in CookieBase
View cookiebase
#!/bin/sh
# Anderson Bosa < https://github.com/andersonbosa | @t4inha >
# elvis: cookie -- Search for COOKIE explains in CookieBase
# Add to this to "/usr/lib/surfraw/cookiebase"
. surfraw || exit 1
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search words]...
Description:
View mangalivre-upgrader.user.js
// ==UserScript==
// @name mangalivre.net upgrader
// @namespace Violentmonkey Scripts
// @match https://mangalivre.net/ler/*
// @author github.com/andersonbosa
// @gist https://gist.github.com/andersonbosa/98c96867c2bdbf77ac0bdd25fd21c802
// ==/UserScript==
function nextChapter () {
window.document
View pastebin-exfiltrator-installator.sh
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
TOOL_DIR=$HOME/tools
PASTEBIN_GIST=https://gist.githubusercontent.com/andersonbosa/919236ea9a90cf28e61efe38a0abf9f6/raw
EXFILTRATOR_GIST=https://gist.githubusercontent.com/andersonbosa/7463de5ad9893d685a27e5a309978088/raw
echo "[INF] creating tools directories $TOOL_DIR ..."
mkdir -p $TOOL_DIR