Skip to content

Instantly share code, notes, and snippets.

View frock81's full-sized avatar

Fabio Rocha frock81

  • Brazil, DF
View GitHub Profile
@frock81
frock81 / todo_setup_desktop_env.md
Last active May 4, 2024 23:29
Lembretes para personalização do ambiente desktop após uma instalação.

Personalização do Desktop

Gnome Shell Extensions

Uso e recomendo

  • Clipboard Indicator
  • CHC-E — Custom Hot Corners - Extended
  • Dash to Panel (desabilitar a extensão Cosmic Dock)
  • GSConnect
@frock81
frock81 / rename.py
Last active May 2, 2023 23:43
This script lists all the files with a ".zip" extension in the current directory and its subdirectories. It then renames any file that matches the pattern "(.*NEO-202[123]{1}-)([0-9]*)(.*\.zip)" to have a zero-padded integer in the middle, with five digits. This script was generated by ChatGPT, a language model trained by OpenAI.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script lists all the files with a ".zip" extension in the current directory and its subdirectories.
# It then renames any file that matches the pattern "(.*NEO-202[123]{1}-)([0-9]*)(.*\.zip)" to have a zero-padded integer in the middle, with five digits.
# This script was generated by ChatGPT, a language model trained by OpenAI.
import os
import re
@frock81
frock81 / threshold.sh
Last active April 26, 2023 23:54
Loop through a barcode grayscale image with different threshold values and tries to read them. Requires imagemagick and zbarimg.
#!/bin/bash
# This script will run zbarimg on a thresholded image
# for a range of threshold values.
usage() {
echo "Usage: $0 <filename> [-s <symbology>] [-a <start_threshold>] [-o <stop_threshold>]"
echo " <filename> Required. Specifies the input file name"
echo " -s, --symbology Optional. Specifies the symbology type"
echo " -a, --start-threshold Optional. Specifies the start threshold (default: 45)"
echo " -o, --stop-threshold Optional. Specifies the stop threshold (default: 55)"
@frock81
frock81 / os.yml
Created May 14, 2021 22:26
Produces a list with the operating systems being executed on each host
- hosts: all
become: false
vars:
output_file: os.csv
tasks:
- block:
# For permisison setup.
- name: get current user
command: whoami
register: whoami
@frock81
frock81 / libvirt_domain.py
Last active August 24, 2020 13:36
Ansible module libvirt_domain
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, Fabio Rocha <frock81@yahoo.com.br>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'