Skip to content

Instantly share code, notes, and snippets.

pid t pid;
pid = fork();
if (pid == 0) {
/* child process */
fork();
thread create( . . .);
}
fork();
@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
<?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 / 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
@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 / 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 / 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
# ---------------