Skip to content

Instantly share code, notes, and snippets.

View mdunham's full-sized avatar
:bowtie:
#OverReacted

Matthew Dunham mdunham

:bowtie:
#OverReacted
View GitHub Profile
@mdunham
mdunham / Create Delete All Messages Button
Last active May 1, 2022 03:08
How to delete all Facebook conversations easily. The script to be run inside Chrome's JavaScript console to delete all the messages and conversations from your Facebook inbox. Instruction: 1 - open your Facebook inbox folder https://www.facebook.com/messages/ 2 - open the Chrome JS console (ALT+CMD+J on Mac OS X) 3 - paste the script and press e…
Simple Method
An easier way to run the script is by simply creating a bookmark in your browser using the following:
Completely, safe.
Bookmark Name: Delete All FB Conversation
Bookmark Url : javascript:!function(){var e=function(o){var n=function(e){var o=function(){var o=document.querySelector("#webMessengerHeaderName").innerText,n=function(e){for(var n=0;n<e.length;n++){var t=e[n];if(-1!==t.innerHTML.indexOf("Delete Conversation"))return console.log("Deleting Messages From: "+o),t.click(),!0}return!1};if("No Selection"===o)return void l();if(!0===n(document.querySelectorAll('a[role="menuitem"]')))setTimeout(t,500);else{var r=document.querySelector('button[data-tooltip-content="Actions"]');if(!r)return void console.log("Unable to locate the delete button");r.click(),setTimeout(e,2e3)}},n=function(){var e=document.querySelector("div.uiScrollableAreaWrap.scrollable");return"undefined"==typeof e||!1===e.hasOwnProperty("scrollHeight")?(console.log("Unable to locate the messages scroll region"),!1):void(e.scro
@mdunham
mdunham / Delete-Facebook-Messages.js
Last active May 18, 2017 18:28
Easier way to delete all your Facebook messages at once.
/**
* Auto Delete All Facebook Messages
*
* You can run this code from the console, but the best way to run it is by
* saving it as bookmark in your bookmark bar. Look at the gists comments for
* instructions on how to save it as a bookmark.
*
* @link http://matthewdunham.net
* @link http://linkedin.com/in/matthewdunham
* @author Matthew Dunham <matt@matthewdunham.net>
@mdunham
mdunham / new-password.js
Last active June 11, 2017 10:48
Mass change all cpanel and user passwords in WHM
/**
* Utility for updating all domain and user cpanel passwords
*
* To use it login to your WHM and click on "Account Functions" then click on "Password Modification"
* Now copy all of the code below and paste it into your browsers dev tools console
* DO NOT FORGET before you run the code make sure you change the variable newPass on line 14 to what
* you want all the new passwords to be now just press enter and let it do its magic
*
* @author Matthew Dunham <matt@matthewdunham.net>
*/
@mdunham
mdunham / console.js
Last active February 20, 2017 06:46
This is was a quick little console script I wrote to help me regenerate the thumbnails of only the posts or in this case products specified.
// HTML: add the tag: <iframe id="f" src="" width="900" height="600"></iframe>
// Then run the following in the console:
var
// Array of wp_posts ID's that need their thumbnails regenerated
ids = ["328921", "326496", "322847", "21967", "16180", "16173"],
// Prevent handling the onload event at the wrong time
loaded = false,
@mdunham
mdunham / zone-scrape.js
Created April 24, 2017 19:52
Scrape WHM DNS zone file editor and compare with another WHM zone
/**
* WHM DNS Zone Scraper
*
* There are two steps to the process first login to WHM and start esiting the zone
* file you want to sync from and run the first script beloew.
*
* Take the output of that script and pass it as JSON to the oldEntries var on part 2.
* Now run part two while editing the DNS zone to the target domain. This will
* output the DNS entries that are not in the current zonefile in proper zone format
*
@mdunham
mdunham / update-dns-serials.sh
Created October 6, 2017 20:40
Mass update all DNS zones and set new serial using find and replace
# Backup
cp -rpf /var/named /var/named.backup
# Find and Replace
replace "find_something" "replace_with" -- /var/named/*.db
# Generate New Serial
grep "serial, todays" /var/named/*.db | sed "s/://g" | cut -d/ -f4 | awk {'system("replace "$2" "strftime("%Y%m%d")"00 -- /var/named/"$1)'}
@mdunham
mdunham / bash-cheatsheet.sh
Created November 11, 2017 22:20 — forked from hnq90/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@mdunham
mdunham / angular.io-service-worker.js
Last active November 28, 2017 04:44
This is a very interesting piece of obfuscation that I found as Angular.IO's service worker.
!function() {
"use strict";
function t(t) {}
function e(t, e, n, r) {
void 0 === r && (r = !0);
var i = 3
, o = function(e) {
if (0 === i--)
return Promise.reject("Hit redirect limit when attempting to fetch " + e + ".");
var n = t.adapter.newRequest(e);
@mdunham
mdunham / Delete-All-LinkedIn-Messages.js
Created January 4, 2018 04:07
I got tired of manually deleting messages on LinkedIn so I created this little gem. It adds a delete all messages button for your LinkedIn inbox. Just like my delete all Facebook messages script. :-) Enjoy!
/**
* Delete all LinkedIn Messages Bookmark
* Create a new bookmark in your bookmark bar named: Clean LinkedIn Inbox
* Set the url of the bookmark to everything the code below on line 7
*/
javascript:(function(b,c){var d=0,f=function(){var k=b('a[href^="/messaging/thread/"]',!0);k[d]?(k[d].click(),setTimeout(g,c)):(console.log('All Done :)'),location.reload())},g=function(){var k=h,l=b('a[title="Show conversation details"]');l?l.click():(d++,k=f),setTimeout(()=>k(),c)},h=function(){var k=b('[data-control-name="clear_conversation"]');k&&k.click(),setTimeout(j,c)},j=function(){var k=b('[data-control-name="clear_conversation_confirm"]');k&&k.click(),setTimeout(f,c)};f()})(function(b,c){return c?document.querySelectorAll(b):document.querySelector(b)},1000);
// Now you can navigate to your linkedin.com inbox and then
// click your new bookmark to begin cleaning your inbox.
@mdunham
mdunham / Google-Hmmm.js
Last active July 19, 2019 22:55
Who wants to know what Google is up to? X-D
/* _GlobalPrefix_ */
this.gbar_ = this.gbar_ || {};
(function(_) {
var window = this;
/* _Module_:syf */
try {
var Gk = function(a) {
if (a instanceof _.ue)
return a;
if ("function" == typeof a.oc)