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 / export_arc_bookmarks.py
Created September 3, 2024 22:36
Script to export Arc Browser bookmarks
import json
file_path = '/Users/<username>/Library/Application Support/Arc/StorableSidebar.json'
lists = {}
tabs = []
with open(file_path, 'r') as f:
parsed_json = json.load(f)
items = parsed_json['sidebar']['containers'][1]['items']
find /dir1/ -type f -exec md5sum {} + | sort -k 2 > dir1.txt
find /dir2/ -type f -exec md5sum {} + | sort -k 2 > dir2.txt
diff -u dir1.txt dir2.txt
@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: