Skip to content

Instantly share code, notes, and snippets.

View 0x3333's full-sized avatar

TFGF 0x3333

  • 00:54 (UTC -03:00)
View GitHub Profile
@0x3333
0x3333 / README.md
Last active November 11, 2023 12:56
List mounted points in columns

This is an alias to shells to display mount output in formatted columns.

Add this alias to your rc shell(.bashrc, .zshrc, or whatever):

alias mountc='mount | column -t | sort -V'

Example output:

@0x3333
0x3333 / README.md
Last active October 30, 2022 15:30
List KVM/Virsh Network Interface per VM

List KVM/Virsh Network Interface per VM

This script will list all VMs and the network interfaces attached to that VM.

Sample output:

smb:
	vnet1
system_prod:
	vnet8
@0x3333
0x3333 / debug.zsh
Created October 25, 2018 19:43
Debug a ZSH Script - Ask for a confirmation before every command is issued
#!/usr/bin/zsh
TRAPDEBUG() {
read -q "?run \"$ZSH_DEBUG_CMD\"? " || setopt errexit
echo > /dev/tty
}
echo "First command"
echo "Second command"
echo "Last command"
@0x3333
0x3333 / output.md
Last active August 22, 2024 14:05
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)
------
@0x3333
0x3333 / README.md
Created March 15, 2018 12:21
Tabulated mount output

Tabulated and sorted mount output

mount | column -t | sort -V

You can create an alias:

alias mountc='mount | column -t | sort -V'
@0x3333
0x3333 / README.md
Last active December 21, 2018 11:42

Python script to create snapshots for Samba shares using rsync.

The first snapshot will be a full copy(cp -a) the next ones will be hard link to the first.

run smb-snapshot -h for help.

Created a Repo: https://github.com/0x3333/smb-snapshots

@0x3333
0x3333 / README.md
Last active September 27, 2017 17:31
Installing ForkLift version 2 using Cask

ForkLift 2 Cask Install

ForkLift is in version 3, but I have a license for version 2. I want to install ForkLift version 2 using brew cask, if I just run brew cask install forklift it will install version 3.

To install version 2 install the last commit in the cask file forklift.rb for version 2, which is 2.6.6, commit 0bc4d90.

forklift.rb in commit 0bc4d90

@0x3333
0x3333 / prompt_0x3333_setup
Last active September 21, 2017 22:12
Prezto Prompt
#
# Authors:
# Tercio Gaudencio Filho <[email protected]>
#
# Ex:
# USERNAME@HOSTNAME [/FULL/PATH] ✘ $ TIME
function prompt_0x3333_setup {
setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS
@0x3333
0x3333 / directive.md
Created April 27, 2016 22:30
AngularJS 1.X Checkbox Directive

AngularJS 1.X Checkbox Directive

Will evaluate an expression when checked state is changed. A $checked parameter will be passed to expression with checked state.

<input type="checkbox" checkbox-change="changeMyValue($checked)">

var checkboxChangeDirective = function($parse) {

Karabiner Config

Karabiner private.xml for Logitech K750 for Mac

  • Remap Dashboard(F4/F12) to Launchpad