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

This file has been truncated, but you can view the full file.
# Title: StevenBlack/hosts with the fakenews, gambling, porn and social extensions
#
# This hosts file is a merged collection of hosts from reputable sources,
# with a dash of crowd sourcing via GitHub
#
# Date: 27 October 2021 22:16:52 (UTC)
# Extensions added to this file: fakenews, gambling, porn, social
# Number of unique domains: 141,078
#
# Fetch the latest version of this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts
#!/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)
@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 / Joomla Direct Logout Link
Created November 21, 2017 18:53
Joomla Direct Logout Link
@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>