Skip to content

Instantly share code, notes, and snippets.

💭
White Mage

Douglas Muth dmuth

💭
White Mage
Block or report user

Report or block dmuth

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 drupal-chatroom-block.php
<?php
/**
* This code is to load a chat created with Drupal's Chat Room module
* (http://drupal.org/project/chatroom) into a block.
* If implemented properly, users will be able to chat from any page
* on the site that displays this block.
*
* @author Douglas Muth <http://www.dmuth.org/>
*/
@dmuth
dmuth / gist:1587034
Created Jan 10, 2012
How to secure a Drupal site
View gist:1587034
<?php
/**
*
* From my blog post at:
*
* http://www.dmuth.org/node/1202/how-secure-drupal-site
*
*/
$path = getenv("SCRIPT_URL");
@dmuth
dmuth / gist:1587038
Created Jan 10, 2012
Drupal shows "create content" menu item to anonymous users
View gist:1587038
<?php
/**
* From my blog post at:
*
* http://www.dmuth.org/node/1201/drupal-shows-create-content-menu-item-anonymous-users
*
*/
if (strstr($_SERVER["REQUEST_URI"], "/node/add")) {
View gist:4069811
[dolph:~ ] $ curl -v http://64.121.64.153:8000/stream/1/
* About to connect() to 64.121.64.153 port 8000 (#0)
* Trying 64.121.64.153... connected
> GET /stream/1/ HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-apple-darwin10.7.0) libcurl/7.22.0 OpenSSL/1.0.1c zlib/1.2.7 libidn/1.22
> Host: 64.121.64.153:8000
> Accept: */*
>
ICY 401 Service Unavailable
icy-notice1:<BR>SHOUTcast Distributed Network Audio Server/win64 v2.0.0.29<BR>
@dmuth
dmuth / gist:5695205
Created Jun 2, 2013
/etc/network/interfaces
View gist:5695205
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
@dmuth
dmuth / gist:8165763
Created Dec 28, 2013
Some changes I made to the script found at http://jonathan-kim.com/2013/gmail-no-response Specifically: I added the ignoreThisSubject() and threadHasIgnoreLabel() functions.
View gist:8165763
/*
* This script goes through your Gmail Inbox and finds recent emails where you
* were the last respondent. It applies a nice label to them, so you can
* see them in Priority Inbox or do something else.
*
* To remove and ignore an email thread, just remove the unrespondedLabel and
* apply the ignoreLabel.
*
* This is most effective when paired with a time-based script trigger.
*
@dmuth
dmuth / DeleteGmailBulk.js
Last active Feb 17, 2016
Delete threads from your Gmail mailbox in bulk Raw
View DeleteGmailBulk.js
//
// Paste this function into the window at http://script.google.com/ and
// then click the triangle button in the menu bar to run it.
//
// After the script is finished running (which can take a minute or longer!),
// go to View -> Logs to view the logs of the script execution.
//
// Based off of a script I found at https://productforums.google.com/forum/#!topic/gmail/YeQVDuPIQzA
//
View solve.php
#!/usr/bin/env php
<?php
/**
* This script solves the problem posted at https://www.facebook.com/hserus/posts/10209365831889209
*
* If you choose an answer to this question at random, what is the chance you will be correct?
*
* A) 25%
* B) 50%
* C) 60%
@dmuth
dmuth / s3-undelete.sh
Created Dec 11, 2016
Script to undelete files from Amazon S3
View s3-undelete.sh
#!/bin/bash
#
# This script can be used to undelete objects from an S3 bucket.
# When run, it will print out a list of AWS commands to undelete files, which you
# can then pipe into Bash.
#
# e.g.: s3-undelete.sh <options> > files.txt; cat files.txt | bash
#
# You will need the AWS CLI tool from https://aws.amazon.com/cli/ in order to run this script.
#
View keybase.md

Keybase proof

I hereby claim:

  • I am dmuth on github.
  • I am dmuth (https://keybase.io/dmuth) on keybase.
  • I have a public key ASA3KPZ_mYWvzsYrN2KCqpRjY30CPUy1ZCuc_3CWhB1yIwo

To claim this, I am signing this object:

You can’t perform that action at this time.