Skip to content

Instantly share code, notes, and snippets.

View theFra985's full-sized avatar

Francesco Cattoni theFra985

View GitHub Profile
@r15ch13
r15ch13 / iommu.sh
Last active June 22, 2024 20:03
List IOMMU Groups and the connected USB Devices
#!/usr/bin/env bash
shopt -s nullglob
lastgroup=""
for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do
for d in $g/devices/*; do
if [ "${g##*/}" != "$lastgroup" ]; then
echo -en "Group ${g##*/}:\t"
else
echo -en "\t\t"
function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 28, 2024 14:47 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@mburakerman
mburakerman / package.json
Last active September 26, 2022 17:32
Webpack 4 config.js (SCSS to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-sass",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@kekru
kekru / Remote API via daemon.json.md
Last active January 11, 2024 18:20
Enable Docker Remote API via daemon.json
@Joe4evr
Joe4evr / AudioModule.cs
Last active October 18, 2023 15:32
D.Net 1.0 audio example
using System.Threading.Tasks;
using Discord.Commands;
public class AudioModule : ModuleBase<ICommandContext>
{
// Scroll down further for the AudioService.
// Like, way down
private readonly AudioService _service;
// Remember to add an instance of the AudioService
@afranchuk
afranchuk / WIXProjectDependencies.cs
Last active October 27, 2023 14:00
An MSBuild Task to automatically load project dependencies for WIX to bundle into an installer.
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
namespace BuildTasks
@joelverhagen
joelverhagen / VersionConventions.md
Last active August 3, 2018 15:37
NuGet Package Version Conventions

NuGet Package Version Conventions

CI packages and release packages

A common pattern for NuGet package versions is producing two sets of .nupkgs for every CI build. That is two sets of functionally equivalent packages produced from the same source. Two sets are:

  1. CI packages: a NuGet package version that is suffixed with a build number. This allows bleeding edge consumption of the latest APIs or fixes. These packages are typically pushed to a development package feed like VSTS or MyGet. Example version numbers: 4.0.0-rc-2046, 3.5.0-rtm-1996, 3.5.0-beta2-1543
@Ratler
Ratler / gist:7756deecc330db9ce07a
Last active August 27, 2021 17:30
A few quick bash one-liners to export/save import/load docker containers/images

NOTE: make sure you export containers and images in separate directories or it's very likely there will be issues when importing or loading your backups using the following snippets

Export all containers

$ while read image container_id; do 
    docker export $container_id > ${image////_}-${container_id}.tar 
 done &lt; &lt;(docker ps -a -f status=exited | tail -n +2 | awk '{ print $2 " " $1 }')
@goyalankit
goyalankit / bash_to_zsh_history.rb
Last active October 28, 2023 05:07
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values