echo 2 >> /sys/module/hid_apple/parameters/fnmode
This file contains 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
use anyhow::{anyhow as e, Result}; | |
pub async fn host_to_ip(host: &str) -> Result<String> { | |
match tokio::net::lookup_host(host).await { | |
Ok(mut ips) => { | |
if let Some(ip) = ips.next() { | |
Ok(ip.to_string()) | |
} else { | |
Err(e!("No IP address found for {}", host)) | |
} |
This file contains 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
openssl genrsa -out server.key 2048 | |
openssl ecparam -genkey -name secp384r1 -out server.key | |
openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650 |
Error
The authenticity of host 'github.com (140.82.113.4)' can't be established.
Fix
ssh-keyscan github.com >> ~/.ssh/known_hosts
- Beautiful is better than ugly.
- Explicit is better than implicit.
- Simple is better than complex.
- Complex is better than complicated.
- Flat is better than nested.
- Sparse is better than dense.
- Readability counts.
This file contains 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 | |
# sample config (4x2 grid on a 3840x2160 screen) | |
screen_cols=424 | |
screen_rows=116 | |
screen_width=3840 | |
screen_height=2160 | |
grid_col_count=4 | |
grid_row_count=2 |
This file contains 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
.responsive-border { | |
box-shadow: 1px 0 0 0 black, | |
0 1px 0 0 black, | |
1px 1px 0 0 black, | |
1px 0 0 0 black inset, | |
0 1px 0 0 black inset; | |
} |
Fix for rubygems SSL certificate error on Windows
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
- Download R1 GlobalSign Root Certificate: https://secure.globalsign.net/cacert/Root-R1.crt
- Save it somewhere local, so you can easily access it from a command prompt.
- Convert to a PEM file.
openssl x509 -in Root-R1.crt -out GlobalSignRootR1.pem -outform PEM -inform DEF
- Copy the new
GlobalSignRootR1.pem
file that it creates into:D:\Ruby23-x64\lib\ruby\2.3.0\rubygems\ssl_certs\
<-- this path will obviously be different depending on where you've got Ruby installed!