Skip to content

Instantly share code, notes, and snippets.

View deajan's full-sized avatar

Orsiris de Jong deajan

View GitHub Profile
@DecisionNerd
DecisionNerd / csv2json.sh
Created November 13, 2015 03:13
CSV to JSON converter using BASH. Original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
#!/bin/bash
# CSV to JSON converter using BASH
# original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
# thanks SecaGuy!
# Usage ./csv2json.sh input.csv > output.json
input=$1
[ -z $1 ] && echo "No CSV input file specified" && exit 1
[ ! -e $input ] && echo "Unable to locate $1" && exit 1
@yumpy
yumpy / reset-usb.txt
Last active October 27, 2022 12:08
To reset USB Hub
# from: https://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line
#
# This will reset all of USB1/2/3 attached ports[1]:
#
for i in /sys/bus/pci/drivers/[uoex]hci_hcd/*:*; do
echo "${i##*/}" > "${i%/*}/unbind"
echo "${i##*/}" > "${i%/*}/bind"
done
@0x3333
0x3333 / output.md
Last active April 9, 2024 13:38
Show Memory and CPU usage of kvm vms
RAM
---
vm-1                      = 1,024 MiB
vm-2                      = 2,048 MiB

Total: 3,072 MiB

CPU(s)
------
@shamil
shamil / mount_qcow2.md
Last active April 19, 2024 10:28
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8