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/env bash | |
# quick and dirty way to filter out items from JSON file (my use-case: CF template resources) | |
grep vpc prod-VPC.json | egrep -v '(Ref|DependsOn)' | grep \{ | sed 's/[^0-9a-zA-Z]//g' | uniq |
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
def get_filenames(search_path=None): | |
""" | |
List all files under .git | |
:return: | |
""" | |
intab = '\\' | |
outtab = '/' | |
transtab = maketrans(intab, outtab) | |
files_list = [] |
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/env bash | |
cd /var/log ; for i in `ls -l | grep drw | awk '{print $NF}'`; do cd $i; for j in `ls | more` ; do cat /dev/null > $j ; done ; cd - ; done | |
rm -rfv /etc/udev/rules.d/* | |
rm -rfv /etc/ssh/ssh_host_* | |
cd $HOME | |
rm -rfv .bash_history | |
rm -rf .ssh/authorized_keys | |
history -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
#!/usr/bin/env bash | |
for i in `ls -l | grep drw | awk '{print $NF}'`; do cd $i; for j in `ls | more` ; do cat /dev/null > $j ; done ; cd - ; 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
#!/usr/bin/env bash | |
if ! [ "$#" -eq 1 ]; then | |
echo "Usage: install_ffmpeg_amzn_linux.sh build_directory" | |
exit 1 | |
fi | |
CPU_THREADS=`cat /proc/cpuinfo | grep processor | tail -1 | awk '{print $NF}'` | |
ROOT_DIR=$1 | |
SOURCES_DIR=$ROOT_DIR/ffmpeg_sources |
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
# Exemple CEPH.conf file with a bit of tunning around scrubing. | |
# very short intervals were to prove that scrubbing could be done every hour but isnt happening because of begin and end time of day settings | |
[global] | |
fsid = ef66f3c8-2cbe-4195-8fbc-bc2b14ba6d69 | |
public_network = 192.168.100.0/24 | |
cluster_network = 192.168.101.0/24 | |
mon_initial_members = nc-0 | |
mon_host = 192.168.100.3 | |
auth_cluster_required = cephx |
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/env bash | |
# GNU GENERAL PUBLIC LICENSE | |
# Version 3, 29 June 2007 | |
# Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
# Everyone is permitted to copy and distribute verbatim copies | |
# of this license document, but changing it is not allowed. | |
# Preamble |
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/env bash | |
for policy in `aws iam list-group-policies --group-name $GROUP_NAME --endpoint-url=$IAM_URL --region euca --output=text | awk '{print $2}'` ; do | |
aws iam get-group-policy --policy-name "$policy" --group-name $GROUP_NAME --endpoint-url=$IAM_URL --region euca > "$policy".json | |
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
#!/usr/bin/env bash | |
for host in 02 03 04; do | |
journal=1 | |
for osd_disk in b c d e; do | |
echo "host node-$host disk sd$osd_disk journal sdf$journal" | |
# echo osd prepare node-"$host":/dev/sd"$osd_disk"1:/dev/sdf"$journal" | |
# echo osd activate node-"$host":/dev/sd"$osd_disk"1:/dev/sdf"$journal" | |
ceph-deploy osd prepare node-"$host":/dev/sd"$osd_disk"1:/dev/sdf"$journal" | |
ceph-deploy osd activate node-"$host":/dev/sd"$osd_disk"1:/dev/sdf"$journal" |
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/env bash | |
# Duplicate a valida source file and changes the IP address following the IP pattern | |
for server in {56..86}; do | |
IP=`echo $server + 30 | bc` | |
echo "server $server will have IP $IP" | |
rm -rfv ustlsaime0$server | |
cp ustlsaime055 ustlsaime0$server |