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
# forward connections from src=* to remote_host:8001 to localhost:8002 | |
ssh -R \*:8001:localhost:8002 user@remote_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
How can I listen on ports 80 and 443? Do I have to run as root? | |
On Linux, you can use setcap to grant your binary the permission to bind low ports: | |
$ sudo setcap cap_net_bind_service=+ep /path/to/your/binary |
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 | |
# call this script with an email address (valid or not). | |
# like: | |
# ./makecert.sh joe@random.com | |
mkdir certs | |
rm certs/* | |
echo "make server cert" | |
openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1" | |
echo "make client cert" | |
openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=DE/ST=NRW/L=Earth/O=Random Company/OU=IT/CN=www.random.com/emailAddress=$1" |
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
1 REM NOTHING | |
2 REM | |
3 REM | |
5 REM DATNOIDS Copyright (c) 1982 By Casey Roche | |
8 REM | |
9 SCREEN 0,0,0 | |
10 KEY OFF:WIDTH 80:COLOR 0,1,0:CLS:PLAY"mb":COLOR 4,0:LOCATE 24,1:PRINT" "+STRING$(78,219):SOUND 1000,1:PRINT" 000000 0000 00000000 00 00 000000 00000000 000000 00000":SOUND 2000,1 | |
80 PRINT" 0222220 022220 02222220 02 20 02222220 02222220 0222220 0222220":SOUND 1000,1:PRINT" 02 20 02 20 22 020 20 02 20 22 02 20 0220 ":SOUND 2000,1 | |
120 PRINT" 02 20 02 20 22 0220 20 02 20 22 02 20 0220 ":SOUND 1000,1:PRINT" 02 20 02222220 22 0202020 02 20 22 02 20 0220 ":SOUND 2000,1 | |
160 PRINT" 02 20 02 20 22 02 0220 02 20 22 02 20 0220":SOUND 1000,1:PRINT" 02 20 02 20 22 02 020 02 20 22 02 20 0220":SOUND 2000,1 |
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 | |
yum -y update | |
yum install -y git | |
cd /tmp | |
rm -rf update-golang | |
git clone https://github.com/udhos/update-golang | |
cd update-golang | |
./update-golang.sh |
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
https://docs.aws.amazon.com/pt_br/AWSEC2/latest/UserGuide/amazon-linux-ami-basics.html | |
Script de dados do usuário: Começa com #! ou Content-Type: text/x-shellscript. | |
Ou seja, basta: | |
#!/bin/bash | |
systemctl stop spotbq | |
systemctl disable spotbq |
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
git config --global user.name udhos | |
git config --global user.email udhos | |
git config --global credential.helper 'cache --timeout=3600' |
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
// https://play.golang.org/p/mJYbMCxYbbK | |
package main | |
import ( | |
"fmt" | |
) | |
func main() { |
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
// https://stackoverflow.com/a/51097467/1011695 | |
package main | |
import ( | |
"fmt" | |
"unsafe" | |
) | |
func main() { |
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
$ go list -m -versions rsc.io/sampler | |
rsc.io/sampler v1.0.0 v1.2.0 v1.2.1 v1.3.0 v1.3.1 v1.99.99 | |
$ | |
https://blog.golang.org/using-go-modules |