Skip to content

Instantly share code, notes, and snippets.

View SmugZombie's full-sized avatar

Ron Egli SmugZombie

View GitHub Profile
#!/bin/bash
echo
echo "# arguments called with ----> ${@} "
echo "# \$1 ----------------------> $1 "
echo "# \$2 ----------------------> $2 "
echo "# path to me ---------------> ${0} "
echo "# parent path --------------> ${0%/*} "
echo "# my name ------------------> ${0##*/} "
echo "# path to me ---------------> " $(basename $0)
@ECHO OFF
FOR /F "tokens=3 delims=: " %%H IN ('SC QUERY "ServiceName" ^| FINDSTR " STATE"') DO (
IF /I "%%H" NEQ "RUNNING" (
NET START "ServiceName"
)
)
; A system-wide mute toggle for Zoom Meetings.
$F9::
; Zoom appears not to accept ControlSend when in the background, so
; we isolate the Zoom and current windows, switch over to Zoom, send
; its own mute-toggle hotkey, and then switch back.
;
; Get the current window
WinGet, active_window, ID, A
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Include, WinRun.ahk
# Base64 String Handling Taking Advantage of Powershell
# Ron Egli - Github.com/SmugZombie
# Download the DMG
curl -o ringcentral.dmg http://downloads.ringcentral.com/sp/RingCentralPhone-10.2.1.dmg
# Mount the DMG
hdiutil attach ringcentral.dmg
# Move the app to the applications directory
cp -R /Volumes/RingCentral\ Phone/RingCentral\ for\ Mac.app /Applications/
# Change Perms
chown -R root:admin RingCentral\ for\ Mac.app/
# Eject DMG
hdiutil eject /Volumes/RingCentral\ Phone/
def strtr(strng, replace):
buf, i = [], 0
while i < len(strng):
for s, r in replace.items():
if strng[i:len(s)+i] == s:
buf.append(r)
i += len(s)
break
else:
buf.append(strng[i])

Open RegEdit.exe and Navigate to:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters

Create new DWORD32, Named AutoShareWks, Do not modify its value - Should equal: 0

Reboot

@SmugZombie
SmugZombie / encoded_local_storage_expiration.js
Last active July 9, 2018 21:26
Uses base64 to encode both local storage names and contents.
function getLocalStorage(name){
name = btoa(name);
var now = parseInt(new Date() / 1000);
var expires = localStorage.getItem(name+"_expire");
if(localStorage.getItem(name) === null){ return ""; }
if(!expires){ try { return atob(localStorage.getItem(name)); } catch(err){ return localStorage.getItem(name); } }
else if(now >= expires){ localStorage.removeItem(name+"_expire"); localStorage.removeItem(name); return ""; }
else{ try {return atob(localStorage.getItem(name));} catch(err){return localStorage.getItem(name);} }
}
@SmugZombie
SmugZombie / function.php
Created June 19, 2018 23:15 — forked from swapnilshrikhande/function.php
Send mail with mailgun api by PHP CURL.
<?php
define('MAILGUN_URL', 'https://api.mailgun.net/v3/DOMAIN_NAME');
define('MAILGUN_KEY', 'KEY');
function sendmailbymailgun($to,$toname,$mailfromnane,$mailfrom,$subject,$html,$text,$tag,$replyto){
$array_data = array(
'from'=> $mailfromname .'<'.$mailfrom.'>',
'to'=>$toname.'<'.$to.'>',
'subject'=>$subject,
'html'=>$html,
@SmugZombie
SmugZombie / linked_in_browser.js
Created February 27, 2018 23:40
Browse linked in without needing to login.
// ==UserScript==
// @name Linked In Browser (No Login)
// @namespace http://egli.me/
// @version 0.1
// @description Allows you to browse linked in without being logged in.
// @author Smugzombie
// @match https://www.linkedin.com/in/*
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==