#After pdfs and docs have been carved from filsystem, the folowing commands can be used to search for specific documents
##Search for PDF containing specific text:
find . -name '.pdf' -exec sh -c 'pdftotext -q "{}" - | grep --with-filename --label="{}" --color "Search Query"' ;
##Search for .doc or .DOC files containing specific text:
find -name '.doc' | while read -r file; do
catdoc "$file" | grep -H --label="$file" "Search Query"
done
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
| assemblyMergeStrategy in assembly := { | |
| case PathList("javax", "servlet", xs @ _*) => MergeStrategy.last | |
| case PathList("javax", "activation", xs @ _*) => MergeStrategy.last | |
| case PathList("org", "apache", xs @ _*) => MergeStrategy.last | |
| case PathList("com", "google", xs @ _*) => MergeStrategy.last | |
| case PathList("com", "esotericsoftware", xs @ _*) => MergeStrategy.last | |
| case PathList("com", "codahale", xs @ _*) => MergeStrategy.last | |
| case PathList("com", "yammer", xs @ _*) => MergeStrategy.last | |
| case "about.html" => MergeStrategy.rename | |
| case "META-INF/ECLIPSEF.RSA" => MergeStrategy.last |
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
| //fiels are the array of data values | |
| //column map is the headers | |
| val columnMap = Headers.column_name.zipWithIndex | |
| val jsonMapping = (ListMap[String, Any]()/: columnMap) { (a, f) => | |
| a + ( "\"" + f._1 + "\"" -> fields(f._2)) | |
| fields.foreach(_ match => {case empty : null}) |
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 com.datastax.spark.connector.cql.CassandraConnector | |
| import org.apache.spark.{SparkContext, SparkConf} | |
| import org.apache.spark.sql.{Row, SQLContext} | |
| /** Spark SQL: Txt, Parquet, JSON Support with the Spark Cassandra Connector */ | |
| object SampleJson extends App { | |
| import com.datastax.spark.connector._ | |
| import GitHubEvents._ | |
| val conf = new SparkConf(true) |
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
| object Implicits { | |
| implicit class CaseClassToString(c: AnyRef) { | |
| def toStringWithFields: String = { | |
| val fields = (Map[String, Any]() /: c.getClass.getDeclaredFields) { (a, f) => | |
| f.setAccessible(true) | |
| a + (f.getName -> f.get(c)) | |
| } | |
| s"${c.getClass.getName}(${fields.mkString(", ")})" |
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
| #include <CGAL/Timer.h> | |
| /// Nanoflann code | |
| #include <nanoflann.hpp> | |
| #include <cstdlib> | |
| #include <iostream> | |
| #include <fstream> | |
| #include <vector> |
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 | |
| # The MIT License (MIT) | |
| # Copyright (c) 2013 Alvin Abad | |
| # https://alvinabad.wordpress.com/2013/03/23/how-to-specify-an-ssh-key-file-with-the-git-command | |
| if [ $# -eq 0 ]; then | |
| echo "Git wrapper script that can specify an ssh-key file | |
| Usage: | |
| git.sh -i ssh-key-file git-command |
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
| - name: etcd.service | |
| command: start | |
| content: | | |
| [Unit] | |
| Description=etcd | |
| Requires=setup-network-environment.service | |
| After=setup-network-environment.service | |
| [Service] | |
| EnvironmentFile=/etc/environment | |
| User=etcd |
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 | |
| ENV="/etc/environment" | |
| HOSTS="/etc/hosts" | |
| # Test for RW access to $1 | |
| touch $HOSTS | |
| touch $ENV | |
| if [ $? -ne 0 ]; then | |
| echo exiting, unable to modify: $ENV |