Skip to content

Instantly share code, notes, and snippets.

View ZeroDeth's full-sized avatar
🏠
Working from home

Sherif Abdalla ZeroDeth

🏠
Working from home
View GitHub Profile
@ZeroDeth
ZeroDeth / apache-shell-script.sh
Created August 5, 2017 18:24
Installs Apache on a RHEL/CentOS server
# Install Apache.
yum install --quiet -y httpd httpd-devel
# Copy configuration files.
cp httpd.conf /etc/httpd/conf/httpd.conf
cp httpd-vhosts.conf /etc/httpd/conf-vhosts.conf
# Start Apache and configure it to run at boot.
service httpd start
chkconfig httpd on
@ZeroDeth
ZeroDeth / apache-playbook.yml
Created August 5, 2017 19:36
Apache Playbook
---
- hosts: all
become: yes
tasks:
- name: Install Apache.
yum: name={{ item }} state=present
with_items:
- httpd
@ZeroDeth
ZeroDeth / timezone-playbook.yml
Created August 10, 2017 23:58
Ansible Configure timezone setting
---
- hosts: all
become: yes
tasks:
- name: set timezone to Europe/London
timezone:
name: Europe/London
@ZeroDeth
ZeroDeth / system-updates-playbook.yml
Created August 11, 2017 02:28
Ansible Playbook Installing System Updates for YUM and APT
---
- hosts: all
become: yes
tasks:
- name: Install system updates for centos systems
yum:
name: '*'
state: latest
@ZeroDeth
ZeroDeth / README.md
Created January 9, 2018 09:36 — forked from MoOx/README.md
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
title tags authors
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
git
github
gitlab
bitbucket
MoOx
@ZeroDeth
ZeroDeth / README.md
Created January 9, 2018 09:36 — forked from MoOx/README.md
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
title tags authors
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
git
github
gitlab
bitbucket
MoOx
@ZeroDeth
ZeroDeth / aws-swap
Created January 10, 2018 11:49 — forked from EntropyWorks/aws-swap
Do you have multiple AWS profiles that you need to swap between?
#!/bin/bash
#
# Do you have multiple AWS profiles?
# Here is how I deal with them.
#
# Make sure you add "${HOME}/.bash_aws_profile" to your .bashrc or .bash_profile so
# all new terminal sessions are updated with your choice.
#
aws-swap(){
unset AWS_DEFAULT_PROFILE
@ZeroDeth
ZeroDeth / timestamp.sh
Created January 10, 2018 11:49 — forked from EntropyWorks/timestamp.sh
Timestamp output
# Not originally created by me btw.
# Handy python timestamp trick
function p-timestamp() {
python -c 'import sys,time;sys.stdout.write("".join\
(( " ".join((time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime())\
, line)) for line in sys.stdin )))'
}
## Custom echo that adds a timestamp
function echo() {
@ZeroDeth
ZeroDeth / Ansible install
Created February 9, 2018 16:31 — forked from dpalomar/Ansible install
Steps to install Ansible on Debian/Ubuntu
# base requirements
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get install -y python-setuptools python-dev libffi-dev libssl-dev git sshpass tree
sudo easy_install pip
sudo -H pip install cryptography
# sudo -H pip install ansible==2.1.1.0 if you don't need virtualenv
# virtualenv
@ZeroDeth
ZeroDeth / aws-create-key-pair.ssh
Created February 12, 2018 16:51
Convert a AWS PEM into a ssh pub key
ssh-keygen -y -f aws_private_key.pem > aws_public_key.pub