Skip to content

Instantly share code, notes, and snippets.

@sniper7kills
sniper7kills / sendmail-aws
Last active January 30, 2023 16:39 — forked from tony722/sendmail-gcloud
Freepbx Voicemail Transcription Script: AWS Transcribe API
#!/bin/sh
# sendmail-aws
#
# Installation instructions
# Copy the content of this file to /usr/sbin/sendmail-aws
# Modify line #69 with your S3 bucket name
#
# AWS
# ---------------
@sniper7kills
sniper7kills / Contracts-HasPublicClassName.php
Created March 21, 2020 04:25
Laravel Model Public Names
<?php
declare(strict_types=1);
namespace App\Contracts;
interface HasPublicClassName
{
/**
* @return string
@sniper7kills
sniper7kills / AuthGuard.php
Last active June 5, 2019 06:14
Laravel Simple Multi-Model Authentication
<?php
namespace App\Http\Middleware;
use App\Admin;
use Closure;
use Illuminate\Support\Facades\Auth;
class AuthGuard
{
@sniper7kills
sniper7kills / win-updates.ps1
Last active May 17, 2017 01:30 — forked from joefitzgerald/win-updates.ps1
Install All Windows Updates, Rebooting As Many Times As Required
param($global:RestartRequired=0,
$global:MoreUpdates=0,
$global:MaxCycles=10)
function Check-ContinueRestartOrEnd() {
$RegistryKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
$RegistryEntry = "InstallWindowsUpdates"
switch ($global:RestartRequired) {
0 {
$prop = (Get-ItemProperty $RegistryKey).$RegistryEntry
<?php
$ec = Bitcoin::getEcAdapter();
$key = PrivateKeyFactory::fromWif('YOUR_WIF');
$outpoint = new OutPoint(Buffer::hex('YOUR_TRANSACTION', 32), 0);
$scriptPubKey = ScriptFactory::scriptPubKey()->payToPubKeyHash($key->getPublicKey());
$value = 0;
@sniper7kills
sniper7kills / ELK-install.sh
Last active February 7, 2020 02:13
ELK-Install-Ubuntu-16.04
#/bin/bash
#Ask some info
echo -n "Enter ELK Server IP or FQDN: "
read eip
echo -n "Enter Admin Web Password: "
read adpwd
#Update System
sudo apt-get update
sudo apt-get upgrade -y
pid t pid;
pid = fork();
if (pid == 0) {
/* child process */
fork();
thread create( . . .);
}
fork();
/* ThreadEx1.java:A simple program creating and invoking a thread object by extending the standard Thread class. */
class MyThread extends Thread {
public void run() {
System.out.println(“ this thread is running ... ”);
}
}
class MAINPROGRAM {
public static void main(String [] args ) {
@sniper7kills
sniper7kills / gist:4193d559889a53ac9692
Last active August 29, 2015 15:46
Group Policy Layout
-Example.com
--Users
---Default Domain GPO - Runs script `domain.bat` at login
---Users OU
----Default Users GPO - Runs script `users.bat` at login
----Admins
-----Default Admins GPO - Runs script `admin.bat` at login
-----Admin Account 1
-----Admin Account 2
-----Admin Account 3
@sniper7kills
sniper7kills / gist:76b735add84dcda39450
Last active August 29, 2015 14:23
L5 Auth Middleware Pseudocode
<?php

namespace App\Auth\Middleware

class TwoFactor
{
    //Store the page route/url where we retrieve the input from
    $inputPage;