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
| dd if=/dev/zero bs=1m count=1024 | AWS_DEFAULT_REGION=auto s5cmd --profile cf --endpoint-url https://xxxxxxxxxxxxxx.r2.cloudflarestorage.com pipe s3://your-bucket/largefile.txt |
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
| pip install notebook | |
| cargo install evcxr_jupyter | |
| evcxr_jupyter --install | |
| jupyter notebook |
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 | |
| apt install jq -y | |
| # Install Terraform (latest version) | |
| LATEST_TF_VERSION=$(curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | jq -r '.tag_name') | |
| curl -LO "https://releases.hashicorp.com/terraform/${LATEST_TF_VERSION#v}/terraform_${LATEST_TF_VERSION#v}_linux_amd64.zip" | |
| unzip "terraform_${LATEST_TF_VERSION#v}_linux_amd64.zip" | |
| sudo mv terraform /usr/local/bin/ | |
| rm "terraform_${LATEST_TF_VERSION#v}_linux_amd64.zip" |
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 | |
| # Specify the desired volume size in GiB as a command line argument. If not specified, default to 50 GiB. | |
| SIZE=${1:-50} | |
| # Get the ID of the environment host Amazon EC2 instance. | |
| TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 60") | |
| INSTANCEID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/instance-id 2> /dev/null) | |
| REGION=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/placement/region 2> /dev/null) |
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
| ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa | |
| ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa | |
| ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa |
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
| # I forgot the firmware password on my MacBook Air and didn't want to take it in: | |
| # http://support.apple.com/kb/TS2391 | |
| # info | |
| # http://paulmakowski.blogspot.com/2009/03/apple-efi-firmware-passwords.html | |
| # run the following command to retrieve your obfuscated firmware password: | |
| # sudo nvram -p | grep security-password | |
| security_password = "%..." | |
| # take the complement of every second bit: |
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
| # Counting in Python using lists | |
| # by Andrew Odendaal (https://ao.gl/counting-in-python-using-a-list/) | |
| magic = 0x616f-0x414f | |
| numbers = [ | |
| (magic/0x186A0), | |
| (magic/0x3E8/8), | |
| (magic/0x3E8/4), | |
| (magic/0o1534-7), |
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
| from pynput.mouse import Button, Controller | |
| import time | |
| mouse = Controller() | |
| mouse.position = (0, 0) | |
| mouse.move(50, 50) | |
| for i in range(1000): | |
| mouse.move(75, 75) | |
| time.sleep(1) |
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
| function solution(N) { | |
| var binary = N.toString(2); | |
| var length = binary.length; | |
| var ones = []; | |
| for(var i=0; i<length; i++) { | |
| if (binary[i]=='1') ones.push(i); | |
| } | |
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
| import sys | |
| import requests | |
| import random | |
| from multiprocessing.dummy import Pool as ThreadPool | |
| ''' | |
| Usage: | |
| $ python server.py random 25 | |
| $ python server.py google.com |
NewerOlder