Skip to content

Instantly share code, notes, and snippets.

View alikalantaripor's full-sized avatar

Ali Kalantari Por alikalantaripor

  • Vasetkala
  • Rafsanjan, Iran
View GitHub Profile
@alikalantaripor
alikalantaripor / Repository_Backup.txt
Last active April 21, 2021 14:35
Backup git repositories
backup_repositories(){
gh repo list ownerusername > 'temp.txt'
cut -f1 'temp.txt' > 'repositories.txt'
while IFS= read -r repository; do
echo "## Start Backup from $repository"
directory_name=$(cut -d "/" -f2 <<< $repository)
if cd $directory_name;
then cd '..';
else gh repo clone $repository;
@alikalantaripor
alikalantaripor / find-google-ips.sh
Last active December 20, 2020 09:40
Performs reverse and forward DNS lookups to list Googlebot's IPs, given a list of IP addresses as a file. Useful for filtering access logs to find out actual Googlebot visits. An implementation of https://support.google.com/webmasters/answer/80553?hl=en
#!/bin/bash
# example: ./find-google-ips.sh list.txt > google.txt
while IFS= read -r ip
do
FIND_HOST="$(host $ip)"
if [[ $FIND_HOST == *"google"* ]]; then
echo $ip
fi
done < "$1"