Skip to content

Instantly share code, notes, and snippets.

# View current configuration
cat /etc/postfix/main.cf | grep inet_interfaces
# Backup current configuration to a date/time stamp formatted file
sudo cp /etc/postfix/main.cf /etc/postfix/main_`date +%Y_%m_%d_%H.%M.%S`.cf
# Make the change
sudo sed -i "s|inet_interfaces = all|inet_interfaces = 127.0.0.1|" /etc/postfix/main.cf
# Review the current configuration
@dkittell
dkittell / SetDNS.sh
Last active September 6, 2024 11:24
#!/bin/sh
# SetDNS.sh
#
#
# Created by David Kittell on 6/14/19.
#
# Variables - Start
sExternalIPService="http://dns.kittell.net/ip.php"
@dkittell
dkittell / UnixIdentification.sh
Last active March 7, 2024 13:44
Unix Identification is a script that originated with VMWare but I have added some other systems to the script.
#!/bin/bash
###############################################################################################
# PROGRAM: UnixIdentification.sh
# DESCRIPTION: Identify the UNIX operating system that you are on
#
# INITIAL CREDIT: UnixIdentification is a script that originated with VMWare but I have added
# some other systems to the script.
#
# Command line: bash UnixIdentification.sh
@dkittell
dkittell / hosts.ps1
Last active March 7, 2019 12:29 — forked from markembling/hosts.ps1
Powershell script for adding/removing/viewing entries to the hosts file.
#
# Powershell script for adding/removing/showing entries to the hosts file.
#
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
#
# Original Script: https://gist.github.com/markembling/173887/1824b370be3fe468faceaed5f39b12bad010a417
# Modified Script: https://gist.github.com/andreymir/405b924d32dace51af2b
# Modified Script: https://gist.github.com/lantrix/052dff5737957aae4e25
#
@dkittell
dkittell / Ubuntu_RemovePreloadedApps.sh
Created January 5, 2018 02:21
Remove Preloaded Ubuntu Apps
for i in org.gnome.Software \
org.gnome.Totem \
aisleriot \
cheese \
org.gnome.Cheese \
evolution-data-server-uoa \
firefox \
gnome-mahjongg \
gnome-sudoku \
libreoffice* \
@dkittell
dkittell / filter_stats.sh
Last active September 12, 2019 17:25
Pi-Hole Statistics
#!/bin/sh
# Pi-Hole Statistics
#
#
# Created by David Kittell on 3/21/17.
#
clear
@dkittell
dkittell / adlists.list
Last active September 14, 2019 12:16
Ad Block Server URLs
http://hosts-file.net/ad_servers.txt
http://hosts-file.net/hphosts-partial.asp
http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts;showintro=0&mimetype=plaintext
http://someonewhocares.org/hosts/hosts
http://sysctl.org/cameleon/hosts
http://unbelovedhosts.apk.defim.de/hosts
http://winhelp2002.mvps.org/hosts.txt
http://www.malwaredomainlist.com/hostslist/hosts.txt
http://www.montanamenagerie.org/hostsfile/hosts.txt
@dkittell
dkittell / MySQL-WordPressActivePlugins.sql
Last active January 12, 2018 05:04
WordPress MySQL Database Information
-- Not a pretty approach but this will help you get a listing of all active plugins
DROP TABLE
IF EXISTS wp_active_plugins;
CREATE TEMPORARY TABLE wp_active_plugins (plugin_file VARCHAR(150));
ALTER TABLE wp_active_plugins ADD UNIQUE INDEX ix_plugin (plugin_file);
INSERT IGNORE
INTO wp_active_plugins
@dkittell
dkittell / Get-REST.ps1
Created December 22, 2015 12:27
PowerShell - REST Client
param (
[Parameter( Mandatory=$true)]
[string]$Address
)
clear
function Get-MAC() {
param($Address)
begin {
$APIURL = "http://<URL>/address.xml?&search="
$resource = "$($APIURL)$($Address)"
@dkittell
dkittell / PHP-DynamicBreadcrumbs.php
Last active July 21, 2022 18:59
PHP - Dynamic Breadcrumbs
<?php
// Credit goes to Dominic Barnes - http://stackoverflow.com/users/188702/dominic-barnes
// http://stackoverflow.com/questions/2594211/php-simple-dynamic-breadcrumb
// This function will take $_SERVER['REQUEST_URI'] and build a breadcrumb based on the user's current path
function breadcrumbs($separator = ' &raquo; ', $home = 'Home')
{
// This gets the REQUEST_URI (/path/to/file.php), splits the string (using '/') into an array, and then filters out any empty values
$path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));