This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# ======================================================================== | |
# Script for compilation and installation of OpenCV with CUDA hardware | |
# acceleration for a Python environment on an Ubuntu-based machine. | |
# ======================================================================== | |
# Originally written for OpenCV 4.6.0 and Ubuntu 20.04 | |
# | |
# The script attempts to automatically infer the CUDA version and location | |
# (thank you NVIDIA for making this more complicated than necessary!). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ========================================================================= | |
# Source: https://gist.github.com/lucaspar/27f5e108b80524b315be10b2a9049817 | |
# ========================================================================= | |
# This script will compile and install a static FFmpeg build with | |
# support for NVENC in Ubuntu. Developed in Ubuntu 23.10, | |
# with NVIDIA Drivers v535.129.03 and CUDA v12.2 with a GPU | |
# with CUDA capability 8.6 (RTX 3080) (see ccap below). | |
# It assumes NVIDA drivers are installed and that you have a | |
# CUDA-compatible GPU. You can check installed drivers with: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Method to find MAC address in text (find_mac_address()) and testing routine.""" | |
from dataclasses import dataclass | |
from typing import List, Optional, Set | |
import re | |
import random | |
RANDOM_SEED = 42 | |
RND = random.Random(RANDOM_SEED) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# Script to automate VPN client start and entering credentials | |
# "xdotool key" and "xdotool type" commands were not working | |
# most of times when using the --window option, so the script | |
# uses the "wmctrl" to switch window focus before typing or | |
# pressing keys. | |
# === BEFORE FIRST EXECUTION === | |
# Set VPN_USERNAME below; | |
# Store the VPN password once with secret-tool: | |
# secret-tool store --label "Cisco VPN credentials" vpn_client "$VPN_USERNAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: tm <session-name> | |
# If the session does not exist, it will be created. | |
# If the session exists, the terminal will be re-attached. | |
# If no session name is provided, the latest attached session is then re-attached. | |
# tmux wrapper to re-attach to a tmux session by name | |
function tm() { | |
# if already in a tmux session, do nothing | |
if [ -n "$TMUX" ]; then | |
echo "Already in tmux session $TMUX" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
How to use this CSS: | |
0. Install the Sidebery extension: https://addons.mozilla.org/en-US/firefox/addon/sidebery/. | |
1. In Sidebery settings: | |
a. Set the title preface must as "[S] " (without quotes). | |
This is used by CSS rules below to identify when Sidebery is active. | |
b. Set 'Tabs tree structure' to false -- this stylesheet doesn't adapt to | |
multiple tab levels, but feel free to tweak it! | |
c. Copy and paste the "SIDEBERY STYLES" section below in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Implementation of correlation and convolution kernels with no dependencies (e.g. numpy) | |
# Translated from the mathematical expressions with a focus on readability (not very "pythonic") | |
# ---------- | |
# print image matrix | |
def printimg(img, title=''): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Fonte: https://gist.github.com/lucaspar/2c20754b37920217678cebb64170cb7a */ | |
/** | |
* Calcula o imposto de renda sobre o valor de rendimentos tributáveis, | |
* conforme tabela progressiva do ano tributário de 2023, seguindo a | |
* incidência mensal do imposto sobre a renda de pessoas físicas (IRPF). | |
* | |
* @params {Number} rendimentos Renda a ser tributada, em R$. | |
* @returns {Number} imposto a pagar sobre `rendimentos`, em R$. | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ::: NVIDIA INSTALL ::: | |
# | |
# Nvidia driver installation: https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux. | |
# Method of "Manual Install using the Official Nvidia.com driver". | |
# | |
# ::: DISPLAY FIX ::: | |
# | |
# 0. append the following to /usr/share/sddm/scripts/Xsetup: | |
# --------- | |
# xrandr --setprovideroutputsource modesetting NVIDIA-0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################################################################### | |
## Sets phone as audio source for laptop speakers through bluetooth ## | |
####################################################################### | |
# check bluetooth | |
rfkill list | |
# if bluetooth blocked, run | |
rfkill unblock bluetooth |