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
cat log.txt | grep EXPRESSION | sed 's/.*EXPRESSION://g' - | more |
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
package dmk.solr; | |
import java.io.File; | |
import java.io.FilenameFilter; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.UUID; |
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
db.collection.find({ principal: /user1/, deleted: false, settings: { $ne: undefined } }, { principal:1, "_id":false }) | |
db.collection( { "_id": "" }, { $set: { "deleted": true }}) | |
db.collection( { principal: /user1/ }).count() | |
db.collection( { principal: /user1/ }, "deleted": { $exists: false }).count() | |
db.collection( { principal: /.*/ }, $set: { delete: true }, { upsert: true, multi: true }) |
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
#!/bin/bash | |
if [ -z "$1"] || [ -z "$2" ] | |
then | |
echo "Usage: `basename $0 <certname> <user>" | |
fi | |
openssl pkcs12 -in $1 -nomacver -out $2.pem |
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
#!/bin/bash | |
openssl x509 -in $1.pem -text |
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
#!/bin/bash | |
#sample take from mongodb docs, configure ssl | |
# the below generates a self signed cert and private key w/ no pass valid for 365 days | |
CRT=mongodb-cert.crt | |
KEY=mongodb-cert.key | |
openssl req -new -x509 -days 365 -nodes -out $CRT -keyout $KEY | |
cat $CRT $KEY > mongodb.pem |
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
#!/bin/bash | |
IN_DIR=/home/hadoop/dmk-in | |
OUT_DIR=/home/hadoop/dmk-out | |
LIB=$PWD/lib | |
CLASSPATH="dmk-mapper.jar" | |
MY_HADOOP_CP="-libjars $PWD/dmk-mapper.jar" | |
LIB_JAR_DELIM=, |
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
package dmk; | |
public class TestJob extends Configured implements Tool{ | |
private static final String JAVA_OPTS = "-Xmx500m -Xms500m"; | |
private static final String USAGE= "Usage: hadoop jar <jarfile> TestJob [generic opts] <input> <output>"; | |
public in run(String[] args){ | |
Configuration conf = getConf(); | |
String[] otherArgs = new GernicOptsionParser(conf, args).getRemainingArgs(); | |
conf.set("mapred.child.java.opts", JAVA_OPTS); |
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
#!/bin/bash | |
USERNAME= | |
HOSTNAME= | |
DATABASENAME= | |
COLLECTIONNAME= | |
#export mongodb records | |
mongoexport --ssl -u $USERNAME -h $HOSTNAME -d $DATABASENAME -c $COLLECTIONAME -p > records.dump.`date`.out |
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
iptables -A INPUT-p tcp -s localhost --dport 8983 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 8983 -j DROP |
OlderNewer