Moving everything, except
$ pwd
~/test/t
$ ls
a.t aa.t b.t c.t
$ mv ./!(a*) .. # if you are using zsh, use ^
package main | |
import ( | |
"context" | |
"encoding/json" | |
"errors" | |
"net" | |
"net/http" | |
"os" | |
"os/signal" |
// You can edit this code! | |
// Click here and start typing. | |
package main | |
import "fmt" | |
func main() { | |
a := []string{"foo", "bar", "baz", "zas"} | |
fmt.Println(len(a), a) // 4 [foo bar baz zas] |
# | |
# ██████╗██╗███████╗ ██████╗ ██████╗ | |
# ██╔════╝██║██╔════╝██╔════╝██╔═══██╗ | |
# ██║ ██║███████╗██║ ██║ ██║ | |
# ██║ ██║╚════██║██║ ██║ ██║ | |
# ╚██████╗██║███████║╚██████╗╚██████╔╝ | |
# ╚═════╝╚═╝╚══════╝ ╚═════╝ ╚═════╝ | |
# | |
# ██████╗ █████╗ ████████╗ ██████╗██╗ ██╗██╗███╗ ██╗ ██████╗ | |
# ██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██║ ██║██║████╗ ██║██╔════╝ |
#!/bin/bash | |
PROGRAM=DEFAULT | |
FOLDER_TO_EXECUTE="$HOME/$PROGRAM" | |
CURR_FOLDER="$(pwd)" | |
# How to run | |
# | |
# 1. Copy this script to /usr/bin | |
# sudo cp output.sh /usr/bin/genoutput |
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 ^
Summary
A curated list of tips and configs for VScode