Skip to content

Instantly share code, notes, and snippets.

@anilshanbhag
anilshanbhag / wpengine.py
Created May 13, 2024 20:52
Find WPEngine Domain
import subprocess
# List of domains
domains = [
"twitter.com", "api.twitter.com", "bloomberg.com", "economictimes.indiatimes.com",
"finance.yahoo.com", "moneycontrol.com", "cnbc.com", "www.cnbctv18.com",
"bqprime.com", "wsj.com", "archive.is", "retaildive.com", "oilprice.com",
"hindustantimes.com", "electrek.co", "trendlyne.com", "zerohedge.com",
"cleantechnica.com", "lightreading.com", "reuters.com", "www.nseindia.com",
"windy.com", "pvtechnology.com", "www.pv-tech.org", "removepaywall.com",
@anilshanbhag
anilshanbhag / simple_dag.py
Created December 7, 2020 17:50
Airflow Example
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
def print_hello():
return "Hello world!"
let hash = "QVFBUVVWNmxaTWIwZ0pWSVp6NWIwamFzMEEzOWlHZHRESjdZdkFISDdUZVJyYjgxeUNFM0h3OVNILVRhSDZLS3NZOGtUNUVma2wxZXpFTmxrYU5hMjg5Nw==";
while (true) {
const url = 'https://www.instagram.com/graphql/query/?query_hash=42323d64886122307be10013ad2dcc44&variables={"id":"2094987403","first":"50","after":"' + hash + '"}'
const response = await fetch(url);
const obj = await response.json();
obj.data.user.edge_owner_to_timeline_media.edges.forEach((x) => {
console.log(x.node.id, x.node.shortcode, x.node.taken_at_timestamp, x.node.edge_media_preview_like.count, x.node.edge_media_to_comment.count);
});
@anilshanbhag
anilshanbhag / concentration.py
Last active June 15, 2023 15:12
Script to block/unblock websites using /etc/hosts
#!/usr/bin/python
"""
Greatest productivity script ever created. Adds whole bunch of entries to /etc/hosts
Need to manually delete it !:/
"""
import sys
lines = open('/etc/hosts').readlines()
@anilshanbhag
anilshanbhag / boingo.sh
Last active May 23, 2017 19:07
Many airports offer only 30 min free wifi. Use this script to get around it.
#!/bin/bash
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/./0/2; s/.$//'
sudo ifconfig en0 ether d0:e4:74:b3:71:55
networksetup -detectnewhardware
@anilshanbhag
anilshanbhag / preload_parallel.py
Created February 8, 2017 20:46
Preloaded Mnist
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
($0:vec[float],$1:vec[vec[float]],$2:vec[float]) =>
$3 := ($4 := ($5 := (res(
indexedfor(
{$1},
0L,
len($1),
1,
vecBuilder[vec[float]]((long(len($1))-long(0L))),
($6:vecBuilder[vec[float]],$7:long,$8:vec[float]) =>
merge($6,res(
(a1:vec[float],a0:vec[vec[float]],a2:vec[float]) =>
map(
zip(
a1,
map(
map(
a0,
(b:vec[float]) =>
res(
for(
@anilshanbhag
anilshanbhag / hosts
Created November 21, 2013 05:47
Hosts file to prevent google / youtube ads Paste the contents into /etc/hosts file in linux / mac
127.0.0.1 3ad.doubleclick.net
127.0.0.1 ad-emea.doubleclick.net
127.0.0.1 ad-g.doubleclick.net
127.0.0.1 ad-yt-bfp.doubleclick.net
127.0.0.1 ad.3au.doubleclick.net
127.0.0.1 ad.ae.doubleclick.net
127.0.0.1 ad.au.doubleclick.net
127.0.0.1 ad.be.doubleclick.net
127.0.0.1 ad.br.doubleclick.net
127.0.0.1 ad.de.doubleclick.net
@anilshanbhag
anilshanbhag / outlog.txt
Created July 30, 2013 08:35
Contains list of Hindustan Times links
.