Moving everything, except
$ pwd
~/test/t
$ ls
a.t aa.t b.t c.t
$ mv ./!(a*) .. # if you are using zsh, use ^
if [ $# -lt 1 ];then | |
INTERFACE='enp2s0f0' | |
MAC='2C:76:8A:BB:D4:52' | |
else | |
INTERFACE=$1 | |
MAC=$2 | |
fi | |
sudo ifconfig $INTERFACE down & \ | |
sudo ifconfig $INTERFACE hw ether $MAC & \ |
#!/bin/bash | |
# This script configure ubuntu after installation | |
# i.e., install the programs | |
# Printf ----------------------------------------- | |
# 38 --> foreground | |
# 48 --> background | |
# ------------------------------------------------------------------------------ | |
# Script settings |
#!/usr/bin/env bash | |
set -ex | |
OPENCV_VERSION=3.4.7 | |
pushd /media/PPCAMP/opencv/opencv-$OPENCV_VERSION | |
mkdir -p build | |
pushd build | |
RPI_VERSION=$(awk '{print $3}' < /proc/device-tree/model) | |
if [[ $RPI_VERSION -ge 4 ]]; then | |
NUM_JOBS=$(nproc) |
#include <algorithm> // transform | |
#include <cstdlib> // atoi | |
// invalid_argument https://en.cppreference.com/w/cpp/error/exception | |
// see https://en.cppreference.com/w/cpp/error/out_of_range | |
// https://softwareengineering.stackexchange.com/questions/430984/what-are-the-best-practices-when-implementing-c-error-handling | |
#include <chrono> | |
#include <cmath> // pow, sqrt | |
#include <exception> | |
#include <fstream> // For file-based logging | |
#include <iostream> // cout |
Moving everything, except
$ pwd
~/test/t
$ ls
a.t aa.t b.t c.t
$ mv ./!(a*) .. # if you are using zsh, use ^
A curated list of tips and configs for VScode
This is a collection of my personal dotfiles. I use these files to configure my shell, git, and other tools. I have included a brief description of each file and a link to the file in this repository.
# it requires python 3.11+ | |
from typing import Self, NewType | |
import inspect | |
# TODO: check for some error library that implements something similar to Go | |
class NewError: | |
__msg: str | |
__reason: Self | None |
Store it in /etc/sudoers.d/nopasswd-for-user
PUT_YOUR_USER_HERE ALL=(ALL:ALL) NOPASSWD: ALL
<script lang="ts"> | |
// SmuiType adds a "input$" prefix to a given html attribute, thus it's usefull when use restProps | |
type SmuiType<T> = { | |
[Key in keyof T & string as `input$${Key}`]?: T[Key]; | |
}; | |
// Add HTML smui attributes properties typings | |
type Props<T> = { | |
[Key in keyof T]: T[Key]; | |
}; |