This file contains hidden or 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
cpu-status-string(){ | |
# Create some colours | |
idle="\u001b[32m" | |
low="\u001b[36m" | |
medium="\u001b[33m" | |
high="\u001b[31m" | |
reset="\u001b[0m" | |
# Extract CPU info from top |
This file contains hidden or 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 | |
# GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu) | |
# Some of these are a little tongue-in-cheek as an unresponsive prompt would be | |
# an annoying distraction. But still. This file should be sourcable to ensure | |
# individual commands can be pasted straight into the terminal. | |
# Uptime | |
PS1='$( |
This file contains hidden or 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
head -c -1 | |
tr "\n" " " | |
echo -n $(<command>) | |
xargs echo -n | |
[[ $(<command>) =~ <regex> ]] && echo -n $BASH_REMATCH |
This file contains hidden or 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
# Garmin | |
https://connect.garmin.com/modern/proxy/download-service/files/wellness/2019-06-13 | |
# Cryptocurrencies | |
https://min-api.cryptocompare.com/data/histominute?fsym=ZRX&tsym=USD&limit=1999 |
This file contains hidden or 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 | |
[[ $# == 1 ]] && count=$1 || count=750 | |
# Fetch some samples | |
nibbles=8 | |
readarray samples < <(xxd -cols $nibbles -plain -s 42 -len $(( nibbles * count ))) | |
# Loop through samples | |
i=0 |
This file contains hidden or 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
# Create Google Cloud instance using Ubuntu 16 LTS | |
# Tick Allow HTTP traffic and Allow HTTPS traffic | |
# Launch SSH web browser | |
# Paste the following | |
# Just agree to stuff and have a root password ready | |
# Based on this | |
# https://www.tecmint.com/install-wordpress-on-ubuntu-16-04-with-lamp/ | |
sudo apt update && \ |
This file contains hidden or 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
#include <iostream> | |
#include <vector> | |
struct fax { | |
~fax() { | |
static size_t i = 0; | |
std::cout << ++i << " dtor\n"; | |
} | |
}; |
This file contains hidden or 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
Technology | Gigabits/s | Category | |
---|---|---|---|
USB 1.1 | 0.012 | Peripheral | |
ADSL2+ | 0.024 | Broadband | |
HSPA+ | 0.042 | Mobile | |
Bluetooth 5.0 | 0.05 | Wireless | |
LTE | 0.173 | Mobile | |
DOCSIS 3.0 (Virgin fibre) | 0.216 | Broadband | |
VME64 32-64bit | 0.4 | Bus | |
USB 2.0 | 0.48 | Peripheral | |
1 Gb Ethernet | 1 | LAN |
This file contains hidden or 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
const std::map<double, std::string> notes{ | |
// Catch all for lower bound search | |
{0.0, "Bx"}, | |
// All the notes we're interested in. At the low end a single Fourier bin | |
// will map to multiple notes. Further up multiple bins will be assigned | |
// the same note. | |
{16.35, "C0"}, | |
{17.32, "C#0"}, |
This file contains hidden or 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
```bash | |
sudo ufw enable | |
sudo ufw allow 8080 | |
sudo ufw status | |
``` |
OlderNewer