Skip to content

Instantly share code, notes, and snippets.

View 0x3333's full-sized avatar

Tercio Filho 0x3333

  • São Paulo, Brazil
  • 01:07 (UTC -03:00)
View GitHub Profile
@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 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)
------
@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 <terciofilho@gmail.com>
#
# 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
@0x3333
0x3333 / README.md
Last active February 3, 2016 15:49
DHCPD active lease reporter

DHCPD Pool active lease reporter

This python script will print all active leases availables in the /var/lib/dhcp/dhcpd.leases file.

This is not my work! See Author below.

Output example:

+--------------------------------------------------------------------------------------------------

| DHCPD ACTIVE LEASES REPORT

@0x3333
0x3333 / README.md
Last active February 1, 2022 22:45
Oh My Zsh plugin to colourize commands output

Oh My Zsh Colourize Plugin

This plugin uses CCZE to colourize some commands output.

Installation:

Copy ccze.plugin.zsh to ~/.oh-my-zsh/custom/plugins/ccze and logout and login again.

Usage: