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
Setting up a SSL Cert from Comodo | |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo. | |
These are the steps I went through to set up an SSL cert. | |
Purchase the cert | |
Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You'll be asked for the content of the CSR file when ordering the certificate. |
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
https://launchpad.net/mysql-tuning-primer |
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
hdfs fsck -list-corruptfileblocks |
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
echo "PATH=${PATH}:/opt/scripts" > /etc/profile.d/scripts-path.sh && chmod 755 /etc/profile.d/scripts-path.sh |
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
ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |
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
# get the current HUE credential password for CM | |
cat /proc/`ps -ef| grep hue |\ | |
grep runcherrypyserver |\ | |
awk '{print $2}'`/environ |\ | |
sed 's/.*\(HADOOP_CREDSTORE_PASSWORD=.*\)/\1/' | |
export HUE_CONF_DIR="/var/run/cloudera-scm-agent/process/`ls -alrt /var/run/cloudera-scm-agent/process | grep HUE | tail -1 | awk '{print $9}'`" | |
export JAVA_HOME=/usr/java/default | |
export HADOOP_CREDSTORE_PASSWORD=xxxxxxxxxxxxxxx | |
build/env/bin/hue useradmin_sync_with_unix |
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 | |
NOW=`date +%s` | |
SIXHOURSAGO=`echo "$NOW - 21600" |bc` | |
HADOOPBIN="/usr/bin/hadoop" | |
IFS=$'\n' | |
for i in `$HADOOPBIN fs -ls /user/root/.staging/`; do | |
IFS=' ' | |
JOBDATE=`echo $i|awk '{print $6" "$7}'` |
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
If you happen to be using CDH distribution of Hadoop, it comes with a very useful HdfsFindTool command, which behaves like Linux's find command. | |
If you're using the default parcels information, here's how you'd do it: | |
hadoop jar /opt/cloudera/parcels/CDH/jars/search-mr-*-job.jar \ | |
org.apache.solr.hadoop.HdfsFindTool -find PATH -mtime +N | |
Where you'd replace PATH with the search path and N with number of days. |
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 | |
####################### | |
# Backup the filesystem metadata for hadoop using namenode url | |
# Change the variables to match appropriate env and put this script in crontab | |
####################### | |
#Variables | |
TODAY=$(date +"%Y-%m-%d-%H%M") #date and time | |
BACKUP_PATH="/home/backup/hadoop/fsimage" #path to store metadata | |
RT_DAYS="4" #Rentention in days |
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="Usage: dir_diff.sh [days]" | |
if [ ! "$1" ] | |
then | |
echo $usage | |
exit 1 | |
fi |