Skip to content

Instantly share code, notes, and snippets.

View noraj's full-sized avatar
💎
FLOSSing

Alexandre ZANNI noraj

💎
FLOSSing
View GitHub Profile
@noraj
noraj / gulp-cjs-to-esm.md
Last active November 29, 2023 16:13
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)
View gulp-cjs-to-esm.md

Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Context

del v7.0.0 moved to pure ESM (no dual support), which forced me to move my gulpfile to ESM to be able to continue to use del.

The author sindresorhus maintains a lot of npm packages and does not want to provides an upgrade guide for each package so he provided a generic guide. But this guide is a bit vague because it's generic and not helping for gulp, hence this guide.

Guide

View how_to_use_bundler_and_rubygems_on_wasm.md

How to use Bundler and RubyGems on WebAssembly

# Download prebuilt ruby
curl -LO https://github.com/ruby/ruby.wasm/releases/download/2022-08-09-a/ruby-head-wasm32-unknown-wasi-full.tar.gz
tar xfz ruby-head-wasm32-unknown-wasi-full.tar.gz

# Install the same version of native ruby to avoid bundler version mismatch in "BUNDLED WITH" of Gemfile.lock
rbenv install 3.2.0-dev
rbenv local 3.2.0-dev
@noraj
noraj / pretty-csv.rb
Last active June 9, 2021 19:28
List installed BA pentest tools + description
View pretty-csv.rb
#!/usr/bin/env ruby
require 'csv'
installed_tools = %x(pacman -Sl blackarch).split("\n").grep(/\[installed\]/)
tools_list = []
installed_tools.each do |line|
_repo, tool, _version, _status = line.split(' ', 4)
description = %x(pacman -Qs #{tool}).split("\n")[1].strip
@MichaelCurrin
MichaelCurrin / README.md
Last active October 9, 2023 23:19
GitHub GraphQL - Get Pull Requests using GH's GraphQL API
View README.md

Get Pull Requests using GH's GraphQL API

How to get Pull Requests data using Github in the browser, or using the API to allow for automating reporting or building in values into a website.

Resources

@noraj
noraj / BA-tips.md
Last active October 13, 2023 22:47
BlackArch dev tips
View BA-tips.md
@brasey
brasey / Configure systemd-resolved to use a specific DNS nameserver for a given domain.md
Created October 25, 2019 14:38
Configure systemd-resolved to use a specific DNS nameserver for a given domain
View Configure systemd-resolved to use a specific DNS nameserver for a given domain.md

Configure systemd-resolved to use a specific DNS nameserver for a given domain

Use case

Given

  • I use a VPN to connect to my work network
  • I'm on a Linux computer that uses systemd-resolved
  • I have a work domain called example.com
  • example.com is hosted by both public and private DNS nameservers
@Moutard3
Moutard3 / mp3-upload-direct-link.md
Last active October 8, 2023 06:06
Tutorials / Walkthrough for uploading & getting direct link of sound file (mp3, ogg, ...)
View mp3-upload-direct-link.md
@nepsilon
nepsilon / git-change-commit-messages.md
Last active November 28, 2023 13:02
How to change your commit messages in Git? — First published in fullweb.io issue #55
View git-change-commit-messages.md

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@activeshadow
activeshadow / create-ports-table.rb
Created May 10, 2015 01:49
Generate Markdown table of open ports from Nmap scan results
View create-ports-table.rb
host_addr = %r{Host: (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})}
open_port = %r{([0-9]+)/open/}
ports = {}
ARGV.each do |f|
File.foreach(f) do |l|
l.scan(host_addr) do |a|
l.scan(open_port) do |p|
ports[a.first] = [] unless ports.key?(a.first)
@Averroes
Averroes / hmac_pickle.py
Created April 11, 2015 12:55
hmac pickle
View hmac_pickle.py
#!/usr/bin/env python
"""Check the digests of pickles passed through a stream.
"""
#end_pymotw_header
import hashlib
import hmac
try:
import cPickle as pickle
except: