Skip to content

Instantly share code, notes, and snippets.

@dannomatic
dannomatic / pause-declining-ctr.js
Created September 13, 2016 20:44
Pause Campaigns with Declining CTR
function main() {
AdWordsApp.createLabel("PausedCTR", "ad group paused due to declining CTR", "red");
AdWordsApp.createLabel("PausedCPA", "ad groups paused due to declining Conversions", "yellow");
//NOTE: set your max CPA value. You don't want to pause an ad group with a rising CPA unless that CPA goes over your limit.
var cpaMax = 0;
var adGroupsIterator = AdWordsApp.adGroups()
.withCondition("Clicks > 25")
function main() {
/*
Make a copy of the spreadsheet listed below and save it to your own Google Drive.
Template - https://docs.google.com/spreadsheet/ccckey=0Ao4Qdm9yCtaGdHpiWmpYSWoxcE9Wd0dEV0xDY3l5UGc#gid=0
Take the url of your new spreadsheet and enter it in the ssURL field below
*/
var ssURL = "spreadsheet.com";
var codeURL = "https://s3.amazonaws.com/ppc-hero-tools/daily-metrics-log.js";
@davedavis
davedavis / Install-Google-Ads-Editor-Ubuntu
Created July 29, 2020 12:44
Install Google Ads Editor 1.4+ on Ubuntu 20 - Focal Fossa
Download the Editor exe here: http://dl.google.com/adwords_editor/GoogleAdsEditorSetup.exe
Install Wine:
sudo dpkg --add-architecture i386
wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
sudo apt update; sudo apt install --install-recommends winehq-stable winetricks
Open Wineconfig and change the OS to Windows 10:
winecfg
import requests
#from selenium import webdriver
from bs4 import BeautifulSoup as bs
inp=input("Enter flipkart link of the product- ")
#chromedriver = "C:\\Users\\crazy\\Desktop\\chromedriver"
#driver=webdriver.Chrome(chromedriver)
#driver.get(inp)
#price=driver.find_element_by_xpath('/html/body/div[1]/div/div[3]/div[2]/div[1]/div[2]/div[2]/div/div[3]/div[1]/div/div[1]')
#print(price)
txt=requests.get(inp).text
from flask import Flask,request, url_for, redirect, render_template
import requests
from bs4 import BeautifulSoup
import pprint
import smtplib
from email.message import EmailMessage
import csv ### For storing all the information of name,price,desired price,links and email in a csv file
import schedule
import time
### Open terminal, paste this
open -n /Applications/Screaming\ Frog\ SEO\ Spider.app/
<!--
Go to your YouTube video.
Click Share
Copy The link: https://youtu.be/rW_Zjdnzc1k
Grab the id from Video. In the example above, it would be rW_Zjdnzc1k
replace the xxx in the code below with the id from the previous step
paste the code on Page.
Boatdrinks for all!!!
-->
@maheshwarishivam
maheshwarishivam / nginx-block-badagent.conf
Last active March 19, 2021 11:49
Nginx Config to Block Bad Bots, Scrapers and Hacker user Agents
http {
map $http_user_agent $badagent {
default 0;
~*(ahrefsbot|alexibot|appengine|aqua_products|archive.org_bot|archive|asterias|attackbot|b2w|backdoorbot|becomebot|blackwidow|blekkobot) 1;
~*(blowfish|botalot|builtbottough|bullseye|bunnyslippers|ccbot|cheesebot|cherrypicker|chinaclaw|chroot|clshttp|collector) 1;
~*(control|copernic|copyrightcheck|copyscape|cosmos|craftbot|crescent|custo|demon) 1;
~*(disco|dittospyder|dotbot|download|downloader|dumbot|ecatch|eirgrabber|email|emailcollector) 1;
~*(emailsiphon|emailwolf|enterprise_search|erocrawler|eventmachine|exabot|express|extractor|extractorpro|eyenetie) 1;
~*(fairad|flaming|flashget|foobot|foto|gaisbot|getright|getty|getweb!|gigabot) 1;
~*(github|go!zilla|go-ahead-got-it|go-http-client|grabnet|grafula|grub|hari|harvest|hatena|antenna|hloader) 1;
@eksiscloud
eksiscloud / www.conf
Created June 5, 2020 20:10
/etc/php/7.4/fpm/pool.d/www.conf for 1G/1CPU droplet of DigitalOcean
[www]
listen = /run/php/php7.4-fpm.sock
user = www-data
group = www-data
listen.owner = www-data
listen.group = www-data
pm = ondemand
pm.max_children = 2
pm.process_idle_timeout = 10s
pm.max_requests = 100
@eksiscloud
eksiscloud / redis.conf
Last active March 19, 2021 11:59
Simplified /etc/redis/redis.conf
bind 127.0.0.1 ::1
protected-mode yes
port 6379
tcp-backlog 511
# unixsocket /var/run/redis/redis-server.sock
# unixsocketperm 700
timeout 0
tcp-keepalive 300
daemonize yes