This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Automatic FlutterFlow imports | |
import '../../backend/backend.dart'; | |
import '../../flutter_flow/flutter_flow_theme.dart'; | |
import '../../flutter_flow/flutter_flow_util.dart'; | |
import '../widgets/index.dart'; // Imports other custom widgets | |
import '../actions/index.dart'; // Imports custom actions | |
import '../../flutter_flow/custom_functions.dart'; // Imports custom functions | |
import 'package:flutter/material.dart'; | |
// Begin custom widget code | |
// DO NOT REMOVE OR MODIFY THE CODE ABOVE! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer_extra = require('puppeteer-extra'); | |
puppeteer_extra.use(require('puppeteer-extra-plugin-anonymize-ua')()); | |
const StealthPlugin = require('puppeteer-extra-plugin-stealth'); | |
puppeteer_extra.use(StealthPlugin()); | |
module.exports = async ({ context, browser }) => { | |
const { url } = context; | |
const ws_endpoint_url = browser.wsEndpoint(); | |
const newBrowser = await puppeteer_extra.connect({ | |
browserWSEndpoint: ws_endpoint_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const waitTillHTMLRendered = async (page, timeout = 30000) => { | |
const checkDurationMsecs = 1000; | |
const maxChecks = timeout / checkDurationMsecs; | |
let lastHTMLSize = 0; | |
let checkCounts = 1; | |
let countStableSizeIterations = 0; | |
const minStableSizeIterations = 3; | |
while(checkCounts++ <= maxChecks){ | |
let html = await page.content(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "ap" | |
path = ARGV[0] | |
bucket = ARGV[1] | |
while true do | |
files = Dir.glob("#{path}/*.jsar").select{|f| (Time.now - File.mtime(f)) > 60} | |
puts "-- Files to move - #{files.size}" | |
files.each{|file| | |
puts "-- -- Moving #{file}" | |
`gsutil -m mv #{file} #{bucket}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDealerDomain(dealer_id) { | |
var url = 'http://marketcheck-prod.apigee.net/v1/dealer/'+ dealer_id + '?api_key=p3OCLOt1HQpxfp1zNVUVopAdWumsStPv'; | |
var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true}); | |
Logger.log(response); | |
return JSON.parse(response).website_s | |
} | |
function getDomainInventoryCount(domain, inventory_type) { | |
var url = 'http://marketcheck-prod.apigee.net/v1/search?api_key=p3OCLOt1HQpxfp1zNVUVopAdWumsStPv&source=' + domain + '&car_type=' + inventory_type; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export TOPOLOGY_ID=mc_vdp_crawler-1-1505395275 | |
Grep Error from Autobot Logs - | |
ansible -i hosts_sample supervisor -a 'bash -lc "grep Error /home/anand/apache-storm-1.1.0/logs/workers-artifacts/ab-parser-logs/*"' | |
Proxy fetch success counts - | |
ansible -i hosts_sample supervisor -a "bash -lc \"grep 'Proxy fetcher tuple success' ~/storm-1.1.0_6/storm/apache-storm-1.1.1/logs/workers-artifacts/$TOPOLOGY_ID/670*/*.log* | wc -l\"" | |
Proxy fetch error counts - | |
ansible -i hosts_sample supervisor -a 'bash -lc "grep XXX ~/storm-1.1.0_6/storm/apache-storm-1.1.1/logs/workers-artifacts/$TOPOLOGY_ID/670*/*.log* | wc -l"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To clean up Zk and Storm local stores and restart cluster - | |
On red01 | |
cd /home/anand/projects/ansible-storm | |
ansible-playbook -i hosts_sample roles/stop_storm.yaml | |
ansible -i hosts_sample supervisor -a 'bash -lc "killall ruby"' | |
Check if no ruby processes running on the supervisors - repeat killall till you see no processes | |
ansible -i hosts_sample supervisor -a 'bash -lc "ps -ef | grep ruby"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
letter_value = {'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, | |
'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, | |
'J' => 1, 'K' => 2, 'L' => 3, 'M' => 4, | |
'N' => 5, 'P' => 7, 'R' => 9, 'S' => 2, | |
'T' => 3, 'U' => 4, 'V' => 5, 'W' => 6, | |
'X' => 7, 'Y' => 8, 'Z' => 9, '1' => 1, | |
'2' => 2, '3' => 3, '4' => 4, '5' => 5, | |
'6' => 6, '7' => 7, '8' => 8, '9' => 9, '0' => 0, | |
'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, | |
'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pre-requisites - | |
1. You'd need Ruby installed on the host(rvm.io) | |
2. Set the solr host env variable | |
export SOLR_HOST=10.68.77.13:8983 | |
3. Set the collection name env var | |
export SOLR_COLLECTION=<your collection name> | |
DROP the Solr Collection | |
curl "http://$SOLR_HOST/solr/admin/collections?action=DELETE&name=$SOLR_COLLECTION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundler-1.9.9/lib/bundler.rb:122:in `setup' | |
2016-12-14T13:57:09.833Z 31533325-c205-11e6-98eb-f1a7b4768b8e from /var/task/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/setup.rb:18:in `<top (required)>' | |
from /var/task/lib/ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require' | |
from /var/task/lib/ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require' | |
from /var/task/lib/ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require' | |
2016-12-14T13:57:09.915Z 31533325-c205-11e6-98eb-f1a7b4768b8e {"errorMessage":"Command failed: /bin/sh -c ./hello | |
/var/task/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find i18n-0.7.0 in any of the sources (Bundler::GemNotFound) |