Skip to content

Instantly share code, notes, and snippets.

View SmugZombie's full-sized avatar

Ron Egli SmugZombie

View GitHub Profile
#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==
function rotate () {
# minimum file size to rotate in MBi:
local MB="$1"
# filename to rotate (full path)
local F="$2"
local msize="$((1024*1024*${MB}))"
test -e "$F" || return 2
local D="$(dirname "$F")"
local E=${F##*.}
@SmugZombie
SmugZombie / getSSID.py
Created January 27, 2018 00:31
Gets the SSID for use with Python Scripts on Raspberry Pi
import subprocess
def getSSID():
return str(subprocess.check_output(["/sbin/iwgetid -r"], shell = True).rstrip())
def main():
print getSSID()
main()
@SmugZombie
SmugZombie / clicktime_monitor.js
Last active January 3, 2018 22:44
Simple script which checks every few seconds to see if an asset only a logged in user can see is available, if not refreshes the page to prevent confusion.
// ==UserScript==
// @name Clicktime Monitor
// @namespace gist.github.com/smugzombie/13d5f60899d7aa0ee33bf9614ebb8520
// @version 0.1
// @description Monitors Your Login Status Within Clicktime to prevent filling out a days worth of time and it not saving
// @author Ron Egli
// @match https://app.clicktime.com/App/DayView/*
// @grant none
// ==/UserScript==