Skip to content

Instantly share code, notes, and snippets.

Michael Buluma buluma

Block or report user

Report or block buluma

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ansible-cert-bot
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
# - test_idempotence: whether to test playbook's idempotence (default = true)
View gist:7512f99fd52dc62292f09532186f3ee3

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@buluma
buluma / recipe: cherry-pick tags
Created Dec 30, 2017 — forked from nickfloyd/recipe: cherry-pick tags
To cherry pick from head and commit back into a tag
View recipe: cherry-pick tags
-from master in working branch
>> git branch [new branch] [tag]
>> git checkout [branch]
-pull commit out and add it to the commit at the top of the tag
>> git cherry-pick [commit] or git cherry-pick [firstcommit]^..[lastcommit] if you have a range
-resolve conflicts
-delete the local tag
>> git git tag -d [tag]
-add a new tag at the head of the old one
>> git tag [tag]
@buluma
buluma / revert-a-commit.md
Created Dec 29, 2017 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository
View revert-a-commit.md

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@buluma
buluma / Joomla Direct Logout Link
Created Nov 21, 2017
Joomla Direct Logout Link
View Joomla Direct Logout Link
@buluma
buluma / gist:a46e02ad92c7c7e50ca9f50f125fe57b
Created Nov 3, 2017 — forked from raramuridesign/gist:8858597
Logout link for Joomla 1.5, 2.5 and 3.0
View gist:a46e02ad92c7c7e50ca9f50f125fe57b
Joomla 1.5 Logout Link
<?php
$returnURL = base64_encode(JURI::root() . "");
$user =& JFactory::getUser();
echo 'Hi,'.$user->username;
?>
<a href="index.php?option=com_user&task=logout&return=<?php echo $returnURL; ?>">
<input type="button" name="Submit" class="button" value="Logout"></a>
@buluma
buluma / my.cnf
Last active Feb 1, 2017 — forked from luk-/my.cnf
CentOS 5.6 default my.cnf
View my.cnf
[mysqld]
server_id=1
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
#replication config
@buluma
buluma / gist:a10a6fb6315b06dca2b3
Last active Jan 7, 2016 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
View gist:a10a6fb6315b06dca2b3
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #007B00; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@buluma
buluma / pedantically_commented_playbook.yml
Created Sep 30, 2015 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@buluma
buluma / wp.sh
Last active Sep 2, 2015 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
View wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
You can’t perform that action at this time.