Skip to content

Instantly share code, notes, and snippets.

View sigismund's full-sized avatar

Žiga Drnovšček sigismund

View GitHub Profile
@sigismund
sigismund / openapi.yaml
Created October 27, 2022 13:51
Create proxy GCP Service endpoint
swagger: "2.0"
info:
title: Simple service endpoint for GCP
version: 1.0.0
host: $DOMAIN_NAME
x-google-endpoints:
- name: $DOMAIN_NAME
target: $IP_ADDR
x-google-allow: all
basePath: /
@sigismund
sigismund / get_good_bots.sh
Created December 8, 2023 09:26
Get IP ranges of "good" crawl bots. Bash version of https://github.com/AnTheMaker/GoodBots
#!/bin/bash
# This is copy of script used in Github Actions of https://github.com/AnTheMaker/GoodBots
# Requirements: curl, whois, jq
WORKING_DIRECTORY=$(pwd)
mkdir -p iplists
# Generate GoogleBot IP-List
curl -s https://developers.google.com/static/search/apis/ipranges/googlebot.json | jq -r '.prefixes[].ipv6Prefix,.prefixes[].ipv4Prefix | select( . != null )' | tr -d "[:blank:]" > $WORKING_DIRECTORY/iplists/googlebot.ips