Skip to content

Instantly share code, notes, and snippets.

View buluma's full-sized avatar
🏠
:shipit:

Michael Buluma buluma

🏠
:shipit:
View GitHub Profile
@buluma
buluma / brew-dnsmasq.md
Created August 19, 2022 10:23 — forked from davebarnwell/brew-dnsmasq.md
install dnsmasq with brew

Install dnsmasq and configure for *.dev.local domains

$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf

Reload configuration and clear cache

# Copy the daemon configuration file into place.
$ sudo cp $(brew list dnsmasq | grep /homebrew.mxcl.dnsmasq.plist$) /Library/LaunchDaemons/

$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

@buluma
buluma / gist:7512f99fd52dc62292f09532186f3ee3
Created March 4, 2018 05:34 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

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 December 30, 2017 05:20 — forked from nickfloyd/recipe: cherry-pick tags
To cherry pick from head and commit back into a tag
-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 December 29, 2017 12:12 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

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 / gist:a46e02ad92c7c7e50ca9f50f125fe57b
Created November 3, 2017 09:24 — forked from raramuridesign/gist:8858597
Logout link for Joomla 1.5, 2.5 and 3.0
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 February 1, 2017 23:38 — forked from luk-/my.cnf
CentOS 5.6 default 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 January 7, 2016 02:28 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!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 September 30, 2015 18:13 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ 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 September 2, 2015 13:01 — 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!
#!/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: "