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
hadoop fs -rm -r -f /tmp/test_snapshot | |
hadoop fs -mkdir /tmp/test_snapshot | |
hadoop fs -put x.txt /tmp/test_snapshot | |
hadoop fsck /tmp/test_snapshot/ -files -blocks -locations -includeSnapshots | |
(execute as hdfs user) | |
hdfs dfsadmin -allowSnapshot /tmp/test_snapshot/ |
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
export KAFKA_OPTS="-Djava.net.preferIPv4Stack=true -Dsun.security.krb5.debug=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
host1 - server: | |
netcat -v -l -n 2000 >/dev/null | |
host2 - client: | |
dd if=/dev/zero bs=100M count=10 | netcat -v suse-ambari.cloud.hortonworks.com 2000 |
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
#validate keytabs | |
for keytab in `ls /etc/security/keytabs/*.keytab`; do principal=`klist -k $keytab | tail -1 | awk '{print $2}'`;kinit -kt $keytab $principal;rt=$?;listprincipal=`klist | grep Default`;kdestroy;echo "status = $rt - keytab = $keytab - principal = $principal"; done 2>/dev/nul | |
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/jdk64/jdk1.8.0_60/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://sles11-full-security-m1.cloud.hortonworks.com/DBNAME -u 'USERNAME' -p 'PASSWORD' -noheader -trim -c \; -query "SELECT version();" |
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
for fieldA in A B C D E F G H | |
do | |
for fieldB in O P Q R S T U V W X Y Z | |
do | |
for i in {1..100000} | |
do | |
echo $fieldA,$fieldB,$i,$RANDOM | |
done | |
done | |
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
import sys, os, stat | |
zones_hosts = {} | |
open_zones = {} | |
incomings = {} | |
zones_hosts_file = sys.argv[1] | |
open_zones_file = sys.argv[2] | |
rules_file = sys.argv[3] | |
dir_output = "deploy/" |
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 sys, os, stat | |
zones_hosts = {} | |
open_zones = {} | |
servers = {} | |
clients = {} | |
zones_hosts_file = sys.argv[1] | |
rules_file = sys.argv[2] | |
dir_output = "deploy/" |
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
sample search filters: | |
(&(objectClass=group)(cn=*HADOOP*)) | |
(|(memberof=CN=GROUP1,OU=XXXX,OU=YYY,DC=domain,DC=com)(memberof=CN=GROUP2,OU=XXXX,OU=YYY,DC=domain,DC=com)(sAMAccountName=username1)) | |
((CN=GROUP1,OU=XXXX,OU=YYY,DC=domain,DC=com)(CN=GROUP2,OU=XXXX,OU=YYY,DC=domain,DC=com)) | |
ldapsearch -x -h yourldapserver.com -b cn=accounts,dc=domain,dc=com -s sub "YOUR-SEARCH-FILTER" | |
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
mkdir aux | |
#cp your jar to aux | |
cd aux | |
jar xf file_original.jar | |
rm file_original.jar | |
#do your stuff | |
#... | |
jar cvf file_new.jar . | |
#check new file content |