Skip to content

Instantly share code, notes, and snippets.

View 0xquad's full-sized avatar

Alex Just Alex 0xquad

  • Synlabs Consulting Inc.
  • Montreal, Quebec, Canada
View GitHub Profile
@0xquad
0xquad / teampass-to-bitwarden.js
Created March 25, 2024 20:13
Migrating from TeamPass 2.x to Bitwarden/Vaultwarden
// On TeamPass version 2.x, login on the web interface and use
// the following in the dev console to retrieve all passwords in an array
// that can be imported directly to Vaultwarden/Bitwarden:
elem = document.createElement('textarea');
KEY = 'paste-here-the-session-key-from-the-html-source';
$.post("sources/items.queries.php", {
type: "lister_items_groupe", id: 1, restricted: '', start: 0,
uniqueLoadData: '', key: KEY,
nb_items_to_display_once: 999
/*
** A script to move many items from a collection to another in Bitwarden/Vaultwarden.
**
** As of 2024-03 Bitwarden still haven't implemented any feature to move a lot of items
** from one collection to another. Refs:
** - https://community.bitwarden.com/t/how-to-move-lot-of-items-into-an-existing-collection/53798/8
** - https://github.com/dani-garcia/vaultwarden/discussions/2705
**
** This script offers a semi-manual/automated way of doing that.
**
@0xquad
0xquad / blurblib.py
Created January 4, 2019 21:24
blurblib
#!/usr/bin/env python3
@0xquad
0xquad / id-adjust.py
Last active January 5, 2023 06:28
Adjust uid/gid on all files and directories under a given root.
#!/usr/bin/env python3
#
# Adjust uid/gid on all files and directories under a given root.
# Adjustment can be made conditional on a minimum uid/gid. Adjustments
# can be either absolute or relative.
#
# Copyright (c) 2018-2023, Alexandre Hamelin <alexandre.hamelin gmail.com>
# Published under the MIT license.
import sys, os
@0xquad
0xquad / app.py
Created September 12, 2018 20:59
Sample flask app that enumerates domain admins
#!/usr/bin/env python
# To be run on windows, must have pywin32 installed (win32.win32* modules)
# Intended to be used within a flask-app-template virtualenv directory
from flask import Flask, request, url_for, jsonify, redirect, abort
from flask_genshi import Genshi, render_template
try:
# virtualenv.exe on windows doesn't make use of the python system
# site-packages directory, so we need to append that path to sys.path
# to use win32 (unless win32 has been installed in the virtualenv,
@0xquad
0xquad / JSONFetch.ps1
Created August 16, 2018 20:34
JSON API fetch tests with Powershell
function ConvertTo-JSON([object] $item){
add-type -assembly system.web.extensions
$ps_js=new-object system.web.script.serialization.javascriptSerializer
return $ps_js.Serialize($item)
}
function ConvertFrom-JSON([object] $item){
add-type -assembly system.web.extensions
$ps_js=new-object system.web.script.serialization.javascriptSerializer
@0xquad
0xquad / WinXP-SP3-VBox.md
Last active January 4, 2018 05:35
Install a minimal version of WinXP SP3 in VirtualBox

Install an optimized size version of WinXP SP3 in VirtualBox

  1. Create a new vm
    • WinXP SP2
    • 1GB RAM
    • 40GB dynamic disk, .vdi or other
    • shared folder to the host (C:\ or /)
    • for QHD displays, set the VM zoom factor to 200% for this VM
  2. Mount fr_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-73982.iso or any other WinXP installation file to the optical drive
@0xquad
0xquad / SAMPLE.csv
Last active March 18, 2017 04:52
Parse ffprobe output and print results in predictable format
meta major_brand mp42
meta minor_version 512
chapter 0:0 start=0 end=20 title=TITLE-0-0
chapter 0:1 start=20 end=112.64 title=TITLE-0-1
stream 0:0 v c:h264~yuv420p~640x352~699kb/s~25fps language=eng default
stream 0:1 a c:aac~44100hz~stereo~131kb/s language=eng default
stream 0:2 v c:mjpeg~yuvj520p~405x600
stream 0:3 a c:aac~44100hz~stereo~122kb/s language=eng
stream 0:4 s c:mov_text~640x52 language=eng default
stream 0:5 s c:mov_text~640x52 language=fra default
#!/bin/sh
# Splits an AV file with multiple chapters into separate files.
# Copyright (c) 2017, Alexandre Hamelin <alexandre.hamelin gmail.com>
[[ $# -gt 0 ]] || exit 1
file=$1
[[ -f "$file" ]] || exit 2
ext=${file##*.}
@0xquad
0xquad / dump-audiocd.sh
Last active October 27, 2022 21:19
CD rip script that uses cdda2wav and lame
#!/bin/sh
#
# Rip an audio CD to MP3 complete with ID3 tags. Requires cdda2wav and lame.
#
# Copyright (c) 2016-2022, Alexandre Hamelin <alexandre.hamelin gmail.com>
# Check requirements
for bin in cdda2wav lame; do
type -Pp $bin >/dev/null || {