$> my_array=(one two three)
$> echo ${my_array}
one
| use std::error::Error; | |
| use std::io::{Cursor, Write}; | |
| use std::sync::{Arc, Mutex}; | |
| use std::thread; | |
| struct Actor { | |
| buffer: Arc<Mutex<dyn Write + Sync + Send>> | |
| } | |
| /// This Actor does write in the given Buffer (StdOut, File, …) |
| use std::{collections::HashMap, error::Error, fmt::Display, path::PathBuf}; | |
| #[derive(Debug)] | |
| pub enum ConfigError { | |
| /// Configuration setting named is missing. | |
| Missing(String), | |
| /// Type mismatch | |
| TypeMismatch { expected: String, present: String }, |
| use std::collections::HashMap; | |
| struct Square { | |
| name: String, | |
| pawn: Option<String>, | |
| } | |
| struct GameBoard { | |
| squares: HashMap<String, Square>, | |
| } |
| alias ll='ls -lh' | |
| alias la='ll -a' | |
| ylw=$(tput setaf 227) | |
| grn=$(tput setaf 154) | |
| red=$(tput setaf 196); | |
| bld=$(tput bold); | |
| rst=$(tput sgr0); | |
| export PS1="[\[$([ $UID -eq 0 ] && echo "$red" || echo "$grn")\]$(hostname)\[$rst\]]:\[$bld\]\w\[$rst\]\$ " |
| parec \ | |
| -d alsa_output.pci-0000_00_1f.3.analog-stereo.monitor \ | |
| --fix-format --fix-rate --no-remix --file-format=wav \ | |
| file.wav |
| parec --channels=1 --latency-msec=2 | ./baudline -stdin -stdout | pacat |
| -- gist from http://stackoverflow.com/questions/5108876/kill-a-postgresql-session-connection | |
| -- prevent people from connecting to the database | |
| revoke connect on database :db_name from public, … ; | |
| SELECT | |
| pg_terminate_backend(pid) | |
| FROM | |
| pg_stat_activity | |
| WHERE | |
| -- don't kill my own connection! | |
| pid <> pg_backend_pid() |
| -- | |
| -- PostgreSQL database dump | |
| -- | |
| -- Dumped from database version 10.3 (Debian 10.3-1.pgdg70+1) | |
| -- Dumped by pg_dump version 10.3 (Debian 10.3-1.pgdg70+1) | |
| SET statement_timeout = 0; | |
| SET lock_timeout = 0; | |
| SET idle_in_transaction_session_timeout = 0; |