Some notes/resources for bypassing anti-bot/scraping features on Cloudflare, Akamai, etc.
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
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
| usage() { | |
| cat <<EOF | |
| Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
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
| Recording Rule Example 1 | |
| ================================ | |
| # Aggregating up requests per second that has a path label: | |
| - record: instance_path:requests:rate5m | |
| expr: rate(requests_total{job="myjob"}[5m]) | |
| - record: path:requests:rate5m | |
| expr: sum without (instance)(instance_path:requests:rate5m{job="myjob"}) | |
| Recording Rule Example 2 |
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
| local | |
| volume_cached_poetry_path = 'cached-poetry', | |
| volume_cached_poetry_deps = 'cached-deps', | |
| command_install = 'poetry install -vv', | |
| command_test = 'poetry run pytest .', | |
| step(name, commands, version='3.8') = { | |
| name: '%s-%s' % [name, version], | |
| image: 'python:%s' % version, |
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
| #!/usr/bin/env node | |
| /** | |
| * Grafana Dashboard Screenshot | |
| * | |
| * Derived from https://github.com/sindresorhus/capture-website/blob/v0.8.0/index.js | |
| * by @sindresorhus (MIT). | |
| */ | |
| const fs = require('fs'); |
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
| /// Make CPUs usage as a sin wave | |
| #include <math.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/time.h> | |
| #include <unistd.h> | |
| const float PI = 3.1415926; | |
| const int TIME_SLICE = 40000; // 40 ms |
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
| # file /home/user/gpg-no-tty.sh | |
| #!/bin/bash | |
| /usr/bin/gpg --batch --no-tty "$@" |
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
| #!/usr/bin/env python | |
| import sys | |
| from selenium import webdriver | |
| from selenium.webdriver.common.by import By | |
| from selenium.webdriver.support.ui import WebDriverWait | |
| from selenium.webdriver.support import expected_conditions | |
Follow the instructions on Github to Create an Access Token in Github
By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.
You can tell Git you want to store credentials in the osxkeychain by running the following:-
Steps from https://stackoverflow.com/q/19856192 with minor changes to work on Ubuntu 16.04.
# Install the Nvidia driver
sudo apt-add-repository ppa:ubuntu-x-swat/updates
sudo apt-get update
sudo apt-get install nvidia-current
# Driver installation needs reboot
sudo reboot now
NewerOlder