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
sips -Z 1024 *.jpg |
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
#option 1: | |
for i in $(seq 1 N); do dd if=/dev/urandom of=$i bs=1M count=2; done | |
#option 2: | |
dd if=/dev/urandom of=masterfile bs=1 count=20000 | |
split -b 1000 -a 10 masterfilex |
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
rsync -aHAXxv --numeric-ids --delete --progress -e "ssh -T -c arcfour -o Compression=no -x" user@<source>:<source_dir> <dest_dir> |
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
# Useful when $(ls) gives the error that the file list too long is | |
find . -name "*.bin" -exec mv {} /path/to/dest/ \; |
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
for FILE in $(ls | grep -v \\.); do | |
BIN_FILE=$(echo ${file:0:60}.bin) | |
NEW_BIN_FILE=$FILE.bin | |
mv $BIN_FILE $NEW_BIN_FILE | |
done |
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
for FILE in $(ls *.foo); do | |
NAME=$(echo $FILE | cut -d '_' -f 1) | |
NAMEBAR=$NAME.bar | |
mv $FILE DONE/ | |
mv $NAMEBAR DONE/ | |
done |
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 | |
for item in * | |
do | |
unzip $item | |
name=$(echo $item | cut -f1 -d ' ' ) | |
echo "all_files.zip" $name".foo" | |
done |
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
gzip -d "" -f gzippe_file | |
#For several files under several directories | |
for item in $(ls -d -1 $PWD/**/*); do | |
echo $item; zcat $item > temp; | |
sed -i 's/, / /g' temp; | |
gzip temp; | |
mv temp.gz $item; | |
done; |
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
s3cmd --access_key=12345 --secret_key="ABCDE" get s3://bucket/* --skip-existing |
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
#!/usr/bin/python | |
""" Read json files extracted from pcaps, | |
embed the features and output a libsvm file. | |
""" | |
import json | |
import numpy as np | |
from sklearn.feature_extraction.text import CountVectorizer | |
from sklearn.datasets import dump_svmlight_file |
OlderNewer