This file contains hidden or 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
| find . -name '*.sql' | awk '{ print "source",$0 }' | mysql --batch -u xxx -p <database> |
This file contains hidden or 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
| mysqlimport -u root -p<password or prompt> -f --local <database> `pwd`/*.csv &> ../db_insert.log |
This file contains hidden or 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
| awk -F\" '{print $(NF-1)}' |
This file contains hidden or 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
| awk -F. '!a[$NF]++{print $NF}' |
This file contains hidden or 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
| grep -F -x -v -f <file to compare:file B>.txt <base file:file A>.txt | |
| # or: | |
| comm <(sort fileB) <(sort fileA) -3 > output.txt | |
| # prints lines that are both in file1 and file2 (intersection) | |
| awk 'NR==FNR{a[$0];next} $0 in a' file1 file2 |
This file contains hidden or 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
| #!/bin/bash | |
| ### USAGE | |
| ### | |
| ### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7 | |
| ### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
| ### | |
| ### CLI options Contributed by @janpieper | |
| ### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch |
This file contains hidden or 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
| weekdays = ('Monday', 'Tuesday', 'Wednesday', | |
| 'Thursday', 'Friday', 'Saturday', 'Sunday', ) | |
| def convert_choice(*args): | |
| """Convert weekdays representation to 127 bits | |
| Example: | |
| >> # Monday, Tuesday, Friday, Sunday | |
| >> bw.convert(1, 1, 0, 0, 1, 0, 1) |
This file contains hidden or 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
| import time | |
| import random | |
| import requests | |
| from profilehooks import profile | |
| def timeit(method): | |
| def timed(*args, **kw): | |
| ts = time.time() |
This file contains hidden or 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
| #!/bin/sh | |
| sudo echo "export NEO4J_HOME=/opt/neo4j" >> /etc/environment | |
| source /etc/environment | |
| sudo mkdir -p $NEO4J_HOME | |
| sudo chown ubuntu.ubuntu $NEO4J_HOME | |
| cd /tmp |
This file contains hidden or 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
| #!/usr/bin/python | |
| import cgi | |
| import requests | |
| import json | |
| from simple_salesforce import Salesforce | |
| #login here: | |
| #https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3MVG9A2kN3Bn17hsWsLDatw._IVMEUBoPKv.7ksp0tz7xLX4tWDVgyzwTCA7i_yTfP.qYuNOsSoPNcdVH6DuE&redirect_uri=http://localhost/cgi-bin/python/oauth.py |