Skip to content

Instantly share code, notes, and snippets.

View petergloor's full-sized avatar
🙂
playing Github ;)

Peter Gloor petergloor

🙂
playing Github ;)
View GitHub Profile
@petergloor
petergloor / raid_speed.md
Last active May 30, 2017 12:33
Temporarily decrease raid 1 activity to let other operations better perform

In order to avoid performance issues for other operations (e.g. upgrades or backups) slow down raid 1 synch by lowering its max speed to zero. This might especially be useful after a fresh install when the system performs slow for a few hours, but still some final work needs to be done (e.g. create user accounts and software installation/configuration).

First check the current value of /proc/sys/dev/raid/speed_limit_max:

# cat /proc/sys/dev/raid/speed_limit_max
200000

Next, set /proc/sys/dev/raid/speed_limit_max to 0:

echo 0 > /proc/sys/dev/raid/speed_limit_max

@petergloor
petergloor / shh_key_file_permissions.md
Last active April 12, 2023 04:47
shh key file permissions

General file permissions for ssh.

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub  
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
@petergloor
petergloor / main.go
Created January 25, 2017 13:00
MaxInt, MinInt, MaxUint and MinUint in Go (golang)
package main
import "fmt"
// Constant definitions
const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(^uint(0) >> 1)
const MinInt = -MaxInt - 1