Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.
Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.
Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple
) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic
module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.
Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.
Older Keychron keyboards (those not based on QMK) use the hid_apple
driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.
from collections import OrderedDict | |
# >>> import cache_dict | |
# >>> c = cache_dict.CacheDict(cache_len=2) | |
# >>> c[1] = 1 | |
# >>> c[2] = 2 | |
# >>> c[3] = 3 | |
# >>> c | |
# CacheDict([(2, 2), (3, 3)]) | |
# >>> c[2] |
#!/usr/bin/env node | |
// Usage: | |
// Login manually, saving your authenticated session in "data": | |
// $ ./fbpost --login | |
// | |
// Now you can post whatever you want via argument: | |
// $ ./fbpost "Hello world, this is a post!" | |
// | |
(async() => { | |
const puppeteer = require('puppeteer'); |
# After open a lot of console windows with the csshX (ClusterSSH), if the windows are too small to work with, | |
# then is better to resize the consoles and view only one (the rest will be also executing the same commands) | |
# in order to be able to work for example with some editors and other stuff. | |
# move the console to 0,0 | |
printf '\e[3;0;0t' | |
# resize to 27x85 characters (laptop) | |
printf '\e[8;27;85t' |
# first install pygmentize to the mac OS X or macOS system with the built-in python | |
sudo easy_install Pygments | |
# then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc. | |
alias pcat='pygmentize -f terminal256 -O style=native -g' |
In order to give someone access to hosts that are available only by ssh "bouncing" (ProxyJump
),
add a user for this specific purpose.
We have an internal openstack where instances get IPs on per-tenant networks. Each tenant has a 'bastion' host that has a "public" ip (floating ip). You can access other instances by bouncing through the bastion. From time to time I want to let someone else into an instance. This could be done either with:
a.) just give them shell access to the bastion and let them hop through. Sharing an unrestricted shell account on my bastion is less than ideal. b.) assign a floating/"public" IP to the instance so they could go directly in. Floating IPs are limited, so this is less than ideal.
So instead, I have set up a single user as described here that can only be used for ProxyJump. It allows others proxied access to my instances but without granting them full shell access.
/* fix_fft.c - Fixed-point in-place Fast Fourier Transform */ | |
/* | |
All data are fixed-point short integers, in which -32768 | |
to +32768 represent -1.0 to +1.0 respectively. Integer | |
arithmetic is used for speed, instead of the more natural | |
floating-point. | |
For the forward FFT (time -> freq), fixed scaling is | |
performed to prevent arithmetic overflow, and to map a 0dB | |
sine/cosine wave (i.e. amplitude = 32767) to two -6dB freq |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |