Skip to content

Instantly share code, notes, and snippets.

View derekjhyang's full-sized avatar

Derek Yang derekjhyang

View GitHub Profile
@0xdevalias
0xdevalias / bypassing-cloudflare-akamai-etc.md
Last active October 5, 2025 20:34
Some notes/resources for bypassing anti-bot/scraping features on Cloudflare, Akamai, etc.
@m-radzikowski
m-radzikowski / script-template.sh
Last active October 9, 2025 00:41
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/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...]
@devops-school
devops-school / Example-prometheus-Recording-Rule.yaml
Created March 31, 2020 08:07
Example-prometheus Recording Rule
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
@Gr1N
Gr1N / .drone.jsonnet
Created December 8, 2019 13:46
Why Drone CI can be interesting for you? Example of Drone CI configuration using Jsonnet
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,
@adamelliotfields
adamelliotfields / index.js
Last active August 11, 2023 16:17
Grafana Dashboard Screenshot using Puppeteer
#!/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');
/// 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
@saschadoemer
saschadoemer / gpg-no-tty.sh
Last active September 21, 2023 13:44
Simple workaround for "no-tty" GPG signing - Part I
# file /home/user/gpg-no-tty.sh
#!/bin/bash
/usr/bin/gpg --batch --no-tty "$@"
@livelace
livelace / grafana_dashboards.py
Created January 31, 2019 17:41
Take a screenshot of a Grafana dashboard.
#!/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
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active October 6, 2025 09:37
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

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:-

@dgoguerra
dgoguerra / opengl-ubuntu-ec2-install.md
Last active September 11, 2020 13:27
Set up OpenGL on a Ubuntu 16.04 g2.2xlarge EC2 machine (following https://stackoverflow.com/q/19856192)

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