package main
import "runtime/pprof"
func main() {
pprof.StartCPUProfile(os.Stderr)
defer pprof.StopCPUProfile()
// ...
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
# put in /etc/sysctl.conf | |
net.core.default_qdisc=fq | |
net.ipv4.tcp_congestion_control=bbr |
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 | |
echo "- - -" > sudo tee /sys/class/scsi_host/*/scan |
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
# https://blog.ubuntu.com/2016/01/20/data-driven-analysis-tmp-on-tmpfs | |
# In /etc/fstab: | |
tmpfs /tmp tmpfs rw,size=128m,noexec,nosuid 0 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
#!/bin/bash | |
rfkill block bluetooth |
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 | |
sudo apt install -y tor | |
# get hostname from /var/lib/tor/ssh/hostname on the server | |
torsocks ssh [email protected] |
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 | |
google-chrome --headless --disable-gpu --print-to-pdf="$PDF_NAME" "$URL" |
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
# Put in ~/.ssh/config | |
Host * | |
ControlMaster auto | |
ControlPath ~/.ssh/%r@%h:%p | |
ControlPersist yes | |
ServerAliveInterval 30 |
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
gawk -v FPAT=\'[^,]*|"[^"]*"\' '{print $3}' < test.csv |
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 | |
DEV=$(mount | grep /media/ | awk '{print $1}') | |
udisksctl unmount -b "$DEV" | |
udisksctl power-off -b "$DEV" |