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 | |
usermod -l newusername -d /home/newusername -m oldusername | |
groupmod -n newusername oldusername |
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
# Strategy: | |
# Remove all double quotes. | |
# Replace all tabs with double-quotes on either side of a comma. | |
# Add double-quotes to the beginning and the end of the line. | |
# Debian | |
sed -e 's/\"//g' -e 's/\t/\",\"/g' -e 's/^/\"/' -e 's/$/\"/' filename.tab > filename.csv | |
# OS X: The \t needs to be replaced by CTRL+v followed by a tab. |
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: bacula | |
user: user | |
sudo: True | |
tasks: | |
- name: Restore files from bacula for weekly restore tests | |
shell: /bin/echo "restore before=2013-10-14\ 08:00:00 client={{ item }}-fd restoreclient={{ item }}-fd file=</tmp/{{ item }}-file-list where=/tmp/bacula-restores yes" | /usr/bin/bconsole | |
with_items: | |
- hostname1 | |
- hostname2 |
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
dpkg --list | grep "^rc" | cut -d " " -f 3 | xargs apt-get autoremove --purge -y |
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 | |
awk '{ print $1 } ' access.log | uniq -c | sort |
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 | |
gather_facts: true | |
name: CVE-2014-6271 - Bash Fix with Debian 6 Support | |
tasks: | |
- name: Add LTS to sources.list | |
lineinfile: > | |
dest=/etc/apt/sources.list | |
insertafter=EOF |
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 gpack() { | |
if [ -d ".git" ]; then | |
echo -n "List of files:" ; git show --pretty="format:" --name-only $1 | |
if [ $? == 0 ]; then | |
git show --pretty="format:" --name-only $1 | xargs tar czf ../`printf '%q\n' "${PWD##*/}"`-partial-`cdate`.tar.gz | |
echo ; echo -n "Tar bundle: ../" ; ls -1t .. | head -n 1 | |
else | |
echo "git SHA Not Found" | |
fi | |
else |
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
# | |
# Delete Ansible retry files | |
# | |
5 * * * * /usr/bin/find /Users/user/. -maxdepth 1 -type f -name \*.retry -exec rm {} \; > /dev/null 2>&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
RewriteEngine on | |
# | |
# If the request comes in on the domain cname, redirect to domain root | |
# | |
RewriteCond %{HTTP_HOST} ^www\.domain1\.com$ [NC] | |
RewriteCond %{HTTP_HOST} !^$ | |
RewriteRule ^/?(.*) http://domain1.com/$1 [L,R=301,NE,NC] | |
RewriteCond %{HTTP_HOST} ^www\.domain2\.com$ [NC] | |
RewriteCond %{HTTP_HOST} !^$ | |
RewriteRule ^/?(.*) http://domain2.com/$1 [L,R=301,NE,NC] |
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
# | |
# According to AWS Docs - http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html | |
# | |
# Rewrites all sender addresses to a single canonical ses verified address. | |
# | |
# Expects a vars files at ../vars/PostfixSES-vars.yml with the following variables: | |
# - ses_host: email-smtp.us-west-x.amazonaws.com | |
# - ses_port: 587 | |
# - ses_username: ses-smtp-username | |
# - ses_password: ses-smtp-password |
OlderNewer