Skip to content

Instantly share code, notes, and snippets.

@bglopez
bglopez / template.pl
Created June 21, 2019 07:14 — forked from gjherbiet/template.pl
A Perl script template
#!/usr/bin/env perl -w
##############################################################################
# File :
# Author : Guillaume-Jean Herbiet <guillaume-jean@herbiet.net>
#
#
# Copyright (c) 2010 Guillaume-Jean Herbiet (http://herbiet.net)
#
# This program is free software: you can redistribute it and/or modify

Keybase proof

I hereby claim:

  • I am bglopez on github.
  • I am bglopez (https://keybase.io/bglopez) on keybase.
  • I have a public key ASAZhnuiMtdwkl5q1WPNnWplVzSXP-M587KzrYmnQp-X1wo

To claim this, I am signing this object:

@bglopez
bglopez / get_windows_ip.sh
Created August 4, 2020 18:33
Get IP address of Windows 10 host through WSL2. MobaXterm's X11 forwarding seems to work only when you set the DISPLAY variable to the LAN IP address of the Windows host itself and not the VM IP or 127.0.0.1.
#!/usr/bin/env bash
# example output
# regex in mywinip can be replaced with the following to snag more private subnets:
# '^.*(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.).*'
# but it *will* catch the 172 address assigned to the VM/as gateway as well
#
# mygw: 172.20.192.1
# mywinhost: DESKTOP-N2VKDIR
# mywinip: 192.168.0.39
# Use like: python setx.py my_python_program [args...]
#
# my_python_program can be a literal path to a file (e.g., foo.py), or the unqualified
# name of a Python program in PATH. In the latter case, setx.py examines PATH for
# a program with that name.
#
# Prints every line executed, including the filename and line number.
#
# This is a hacky prototype for py27; it almost certainly breaks in significant ways on
# non-Unix, or Python3000; and has only been tested on a FreeBSD derivative. It still
@bglopez
bglopez / fifo_set_queue.py
Created December 12, 2020 03:30 — forked from lewellent/fifo_set_queue.py
FIFO Set Queue for Redis (Python)
__author__ = "Todd Lewellen"
"""
The MIT License (MIT)
Copyright (c) 2014 Todd Lewellen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@bglopez
bglopez / build_sl-h.sh
Created February 22, 2022 04:15 — forked from eggplants/build_sl-h.sh
build sl-h (patched sl, created by: jsdfq43wtr)
#!/usr/bin/env bash
set -euo pipefail
set -x
# Ubuntu: apt update && apt install build-essential curl libncurses5-dev -y
# Mac: brew update && brew install curl gcc ncurses make
if ! command -v curl gcc make &> /dev/null; then
echo "require: build-essential curl libncurses5-dev" >&2
@bglopez
bglopez / ln-log.mk
Created March 15, 2022 14:01 — forked from thydel/ln-log.mk
Link log from deep to flat
top:; @date
log := find /space/log -name '*.log'
base := cut -d/ -f4-
apache-links := sed -e 's;\(.*\)/\(.*\);ln -f /space/log/\1/\2 /space/log2/\1_\2;'
php-links := sed -e 's;\(.*\)/php/\(.*\);ln -f /space/log/\1/\2 /space/log2/\1_php_\2;'
apache := $(log) | grep -v /php/ | $(base) | $(apache-links)
php := $(log) | grep /php/ | $(base) | $(php-links)
@bglopez
bglopez / JSON_to_URL_encoded_form.py
Created September 29, 2022 00:38 — forked from aayla-secura/JSON_to_URL_encoded_form.py
Convert JSON data to URL encoded form (application/x-www-form-urlencoded)
#!/usr/bin/env python3
import json
from urllib.parse import quote, quote_plus
import sys
import os
import argparse
parser = argparse.ArgumentParser(
@bglopez
bglopez / sentinel.mrc
Created December 20, 2022 22:01 — forked from EdGruberman/sentinel.mrc
mIRC TFC Server Management Script
on *:START:{ sentinel.load }
on *:EXIT:{ sentinel.unload }
on *:CONNECT:{ if ( $hget(sentinel.general,autoactivate) == 1 && $hget(sentinel.general.status,activated) != 1 ) sentinel.activate }
alias sentinel.load {
;--Load settings from ini file into hash tables
hmake sentinel.irc 5
hload -i sentinel.irc sentinel.ini irc
if ( $hget(sentinel.irc,admin) == $null ) hadd sentinel.irc admin #clan.private password
if ( $hget(sentinel.irc,tv) == $null ) hadd sentinel.irc tv #clan.tv
if ( $hget(sentinel.irc,monitor) == $null ) hadd sentinel.irc monitor #clan
@bglopez
bglopez / rscan.js
Created May 25, 2023 17:02 — forked from 80sVectorz/rscan.js
Recursive scan terminal command for outputing an ascii tree representation of the network.
//Bitburner script: https://github.com/bitburner-official/bitburner-src https://store.steampowered.com/app/1812820/Bitburner/
//Recursive scan terminal command for displaying an ascii art tree representation of the full network:
// rscan --detailed
// -------------------Network Tree-------------------|-|Balance|-|Hack Chance|-|Security LVL|-|Root?|
// home----------------------------------------------| $387.370m 99% 1% [X]
// ├─n00dles | $62.856k 99% 1% [X]
// │ ├─zer0------------------------------------------| $3.717m 75% 8% [X]
// │ │ ├─silver-helix | $20.868m 57% 11% [X]
// . . . . ... ... ... ...
// . . . . ... ... ... ...