Python script to convert mysqldump output to JSON file. Most of the code was borrowed from github.com/jamesmishra/mysqldump-to-csv
You'll want to update the 'parse_row' function to map each item in a row to a dictionary.
| gcloud compute --project "backpack-external" instances create "backpack1" \ | |
| --zone "us-east1-b" \ | |
| --boot-disk-auto-delete \ | |
| --machine-type "n1-standard-2" \ | |
| --metadata startup-script=" | |
| \ | |
| #!/bin/bash | |
| sudo shutdown -P +10 | |
| sudo rm -r amazon-scrapper-1M-nodejs/ | |
| sudo apt-get update && sudo apt-get install -yq --no-install-recommends libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libnss3 && curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && Y | sudo apt-get install -y nodejs && Y | sudo apt-get install -y build-essential && git clone https://github.com/dipta007/amazon-scrapper-1M-nodejs && cd amazon-scrapper-1M-nodejs && npm install && sudo npm install pm2 -g && sudo pm2 start index.js |
| #!/bin/sh | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # Set the colours you can use | |
| black='\033[0;30m' | |
| white='\033[0;37m' | |
| red='\033[0;31m' |
Python script to convert mysqldump output to JSON file. Most of the code was borrowed from github.com/jamesmishra/mysqldump-to-csv
You'll want to update the 'parse_row' function to map each item in a row to a dictionary.
| <?php | |
| class Debug { | |
| /** | |
| * A collapse icon, using in the dump_var function to allow collapsing | |
| * an array or object | |
| * | |
| * @var string | |
| */ |
| // Pretend that cookies work | |
| (function (document) { | |
| var cookies = {}; | |
| document.__defineGetter__('cookie', function () { | |
| var output = []; | |
| for (var cookieName in cookies) { | |
| output.push(cookieName + "=" + cookies[cookieName]); | |
| } | |
| return output.join(";"); | |
| }); |
| <?php | |
| // Based on <https://github.com/mecha-cms/x.minify> | |
| namespace x\minify\_ { // start namespace | |
| $n = __NAMESPACE__; | |
| \define($n . "\\token_boolean", '\b(?:true|false)\b'); | |
| \define($n . "\\token_number", '-?(?:(?:\d+)?\.)?\d+'); |
| GE2EN = ((set)-> | |
| (string)-> | |
| (Array::map.call string, (char)-> | |
| set[char] || char).join('') | |
| )({"ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k'","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p'","ჟ":"zh","რ":"r","ს":"s","ტ":"t'","უ":"u","ფ":"p","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts'","ჭ":"ch'","ხ":"kh","ჯ":"j","ჰ":"h"}) |
| <?php | |
| date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php | |
| /** | |
| * The root directory where the repos live. | |
| * | |
| * @var string | |
| */ | |
| $root_dir = '/your/root/dir/'; |
| # Script to be placed in elasticsearch/bin | |
| # Launch it from elasticsearch dir | |
| # bin/backup indexname | |
| # We suppose that data are under elasticsearch/data | |
| # It will create a backup file under elasticsearch/backup | |
| if [ -z "$1" ]; then | |
| INDEX_NAME="dummy" | |
| else | |
| INDEX_NAME=$1 |