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 keylist.txt | xargs -n 1 -P 4 -I{} sh -c './lister keys/{} > {}.txt;' |
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
find . -maxdepth 1 -type f -name 'x*.txt' -printf '%f\n' | xargs cat | parallel -j16 -N 1000 -I{} cp {} --target-directory=/data & |
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
awk '{print length}' cut.txt | sort -g | uniq -c |
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
attach | |
------ | |
aws ec2 attach-volume --volume-id vol-123 --instance-id i-123 --device /dev/sdf --region us-east-1 | |
lsblk (renamed on linux as xv*) | |
sudo file -s /dev/xvdf (if reports only 'data' then no filesystem) | |
sudo mkfs -t ext4 /dev/xvdf (ONLY IF NO FILESYSTEM ie NEW VOLUME) | |
sudo mkdir /data (create mount-point e.g. data) | |
sudo mount /dev/xvdf /data (mount device at /data) | |
sudo chmod xxx /data (to add permissions) | |
optional: mount volume on instance restart |
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
sudo apt-get install python-pip | |
sudo pip install awscli | |
aws configure |
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
ls | parallel -j16 -I{} tar -czf /data/keys/{}.tar.gz {} & |
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
find . -type f -mmin +60 | xargs -I {} aws s3 sync {} s3://.... |
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
diff file1 file2 | awk '{if ( $2 != "") print $2}' |
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 | |
while read -r line | |
do | |
printf "attempting: $line > " | |
tmpfile=./tmp/$line.xml | |
aws s3 cp s3://*****/$line $tmpfile > /dev/null | |
if grep -q "<???????:para>" $tmpfile; then | |
printf "ABSTRACT: Y > " | |
xmlstarlet sel -t -o "{ @@@@id@@@@ : @@@@" -v "//?????:eid" -o "@@@@, @@@@abstract@@@@ : @@@@" -t -v "//abstract/?????" -o "@@@@}" $tmpfile > $tmpfile.json | |
sed -i -e 's/"/\\"/g' $tmpfile.json |
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
aws s3 ls s3:// | awk '{ count +=1; size += $3 } END { print "Count:", count, "Size:", size, "bytes" }' |
OlderNewer