mkdir -p /opt/scripts
mkdir -p /var/log/custom
mkdir -p /var/root/Library/LaunchAgents
curl 'https://gist.githubusercontent.com/heywoodlh/0295135b9e24ec0729571497c9ab5a77/raw/b3032d9a563c956f574176c39cb2a5382f8c579c/auth-log.sh' -o /opt/scripts/auth-log.sh
chmod +x /opt/scripts/auth-log.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services; | |
use GuzzleHttp\Client; | |
class ChatGPTService | |
{ | |
private $apiKey; | |
private $baseUrl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace My\Namespace; | |
use DOMDocument; | |
use Parsedown; | |
use PhpOffice\PhpWord\TemplateProcessor as PhpWordTemplateProcessor; | |
class TemplateProcessor extends PhpWordTemplateProcessor | |
{ | |
/** | |
* Injects a markdown snippet as HTML into the word document. |
The following worked with Elastic Cloud, Elasticsearch & Kibana v7.6.0. It should be pretty close for other kinds of deployments. Before starting, make sure you have the right license level that allows SAML.
- Navigate to the SAML apps section of the admin console
- Click the Add button and choose to "SETUP MY OWN CUSTOM APP"
- Write down the Entity ID and download the Idp metadata file
- Choose application name, description and add logo
- In the "Service Provider Details" screen add the following:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set POST variables | |
$url = 'http://c.docverter.com/convert'; | |
$fields = array('from' => 'markdown', | |
'to' => 'pdf', | |
'input_files[]' => "@/".realpath('markdown.md').";type=text/x-markdown; charset=UTF-8" | |
); | |
//open connection | |
$ch = curl_init(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--current time in seconds since midnight | |
set currentTime to (time of (current date)) | |
## Morning | |
-- (04:00 - 10:30) | |
set morning to 37800 | |
set morningVolume to 80 | |
-- Happy: Wake Up in a Good Mood | |
set morningTrack to "spotify:user:116779154:playlist:5sYrf2RnhPY22meUSS5fUu" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [[ `id -u` != 0 ]]; then | |
echo "Must be root to run script" | |
exit | |
fi | |
read -p "Enter user name and press [ENTER]: " UserName | |
if [[ $UserName == `dscl . -list /Users UniqueID | awk '{print $1}' | grep -w $UserName` ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exportJSON() { | |
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets(); | |
var result = sheets.reduce(function(result, sheet) { | |
var id = sheet.getName().toLowerCase(); | |
var data = sheet.getDataRange(); | |
var values = data.getValues(); | |
result[id] = values.map(function(row) { | |
return row.map(function(column) { | |
return Math.round(column) || column; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen() { | |
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}]; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
ss.addMenu("Fitness Diaries", menuEntries); | |
} | |
function createDocFromSheet(){ | |
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id | |
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries | |
// get the data from an individual user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
username: vagrant | |
password: vagrant | |
sudo apt-get update | |
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev | |
sudo aptitude install mysql-server mysql-client | |
sudo nano /etc/mysql/my.cnf |
NewerOlder