Skip to content

Instantly share code, notes, and snippets.

@jawinn
jawinn / CreateWordpressUser.php
Last active December 16, 2023 21:58
Create WordPress Admin User from PHP
<?php
// ADD NEW ADMIN USER TO WORDPRESS
// ----------------------------------
// Put this file in your Wordpress root directory and run it from your browser.
// Delete it when you're done.
require_once('wp-blog-header.php');
require_once('wp-includes/registration.php');
// ----------------------------------------------------
@nddrylliog
nddrylliog / host-manager
Created November 15, 2011 22:06
A command-line utility to manage the /etc/hosts file.
#!/bin/bash
# Idea and interface taken from https://github.com/macmade/host-manager
path="/etc/hosts"
addusage="Usage: `basename $0` -add host address"
remusage="Usage: `basename $0` -remove host"
case "$1" in
-add)
if [ $# -eq 3 ]; then
if [[ -n $(grep "^$3.*[^A-Za-z0-9\.]$2$" ${path}) ]]; then