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
VBoxManage clonehd $(ls *.vmdk) box-disk1.vdi --format VDI && \ | |
VBoxManage modifyhd box-disk1.vdi --compact && \ | |
VBoxManage storageattach $(pwd | sed 's#.*/##') --storagectl IDE --device 0 --port 0 --type hdd --medium "box-disk1.vdi" && \ | |
rm -f $(ls *.vmdk) |
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 python3.5 | |
#requires python 3.5 | |
#testing rfc6531 | |
#coding: utf-8 | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.header import Header | |
from email import charset | |
from email.generator import Generator | |
import smtplib |
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 | |
#Move Files in between s3 buckets based on a list | |
#Use Standard_IA so storage will be cheaper | |
while [[ $# > 1 ]] | |
do | |
key="$1" | |
case $key in | |
-f|--file) | |
FILE="$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
# Install fswatch https://github.com/emcrisostomo/fswatch | |
# | |
#Use fswatch in polling mode to listen for Created and Updated events and use touch -a to modify the attribute | |
#this will triger gulp-watch to execute and prevent a loop from fswatch | |
# when used in polling mode is going to be cpu intensive use with care | |
# | |
# | |
WATCH_PATH=/mnt/VBOX_SHARED/ | |
LOG_FILE=/var/log/fix_gulp_watch.log | |
fix_gulp_watch(){ |
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 users-v2.yaml | |
- name: Add users from users dictionary | |
#action: user name={{ item.key }} password={{ item.value.password }} shell={{ item.value.shell }} state={{ item.value.state }} remove=yes update_password=on_create groups="{{ item.key }},{{ item.value.group }}" append=no | |
action: user name={{ item.key }} password={{ item.value.password }} shell={{ item.value.shell }} state={{ item.value.state }} remove=yes update_password=on_create groups="{{ item.value.group }}" append=yes | |
with_dict: users | |
ignore_errors: yes | |
- name: Add keys from users dictionary | |
action: authorized_key user={{ item.key }} key="{{ item.value.ssh_key }}" exclusive=yes | |
with_dict: users | |
########### |
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
- hosts: all | |
# remote_user: | |
sudo: yes | |
sudo_user: root | |
tasks: | |
- script: lsuser-wrapper.sh creates=/tmp/lsuser | |
- shell: 'getent passwd|egrep "bash|zsh|nologin" |cut -d : -f 6' | |
register: home_folder | |
- fetch: src=/tmp/lsuser dest=reports/remote-authorized/lsuser-{{ ansible_hostname }} flat=yes | |
- file: path=/tmp/lsuser state=absent |
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 | |
if [ $# -ne 2 ]; then | |
echo "Specify the environment you want to run the report on as defined in ansible hosts" | |
exit 1 | |
fi | |
ANSIBLE_GROUP=$1 | |
USER=$2 | |
#clear save-user fingerprint | |
rm -f /tmp/local_users |
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 | |
fn_lsuser(){ | |
USER=$1 | |
DATA1=`grep -w $USER /etc/passwd` | |
SNAME=`echo $DATA1 | cut -d: -f1` | |
SID=`echo $DATA1 | cut -d: -f3` | |
SGPNUM=`echo $DATA1 | cut -d: -f4` | |
SHOME=`echo $DATA1 | cut -d: -f6` |
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
function max(arr, big) { | |
big = 0; | |
for (i in cat) { | |
if (cat[i] > big) { big=cat[i]; } | |
} | |
return big | |
} | |
NF > 0 { | |
cat[$1]++; |
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 | |
_APP_PATH=('/home/user1' '/home/user2' '/home/user3') | |
_PERM=('755' '740' '740') | |
aLen=${#_APP_PATH[@]} | |
pLen=${#_PERM[@]} | |
if [ ${aLen} != ${pLen} ];then | |
echo "folder and permisons array don't match " | |
exit 1 | |
fi |
NewerOlder