openssl rand -base64 756 > <path-to-keyfile>
chmod 400 <path-to-keyfile>
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
| queued %{date("yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ"):date} %{notSpace:hostname} %{notSpace:source}/%{notSpace:proc}\[%{integer:op}\]\: %{notSpace:procCode}\: %{data:attr:keyvalue} \(%{data:message}\) | |
| cleaned %{date("yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ"):date} %{notSpace:hostname} %{notSpace:source}/%{notSpace:proc}\[%{integer:op}\]\: %{notSpace:procCode}\: %{data:attr:keyvalue} | |
| daemon %{date("yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ"):date} %{notSpace:hostname} %{notSpace:source}/%{notSpace:proc}\[%{integer:op}\]\:\s+%{data:message} |
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/bash | |
| # Directory to fill with files | |
| DIR=$1 | |
| # Threshold for free space in KB | |
| THRESHOLD=${2:-104857} # Default is 100MB | |
| # Size of each file in KB | |
| FILESIZE=5120 # 5MB |
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/bash | |
| # Default values for source and output files | |
| env_example=".env.example" | |
| env_output=".env" | |
| # Flag to ask for confirmation for each variable (enabled by default) | |
| ask_each_var=1 | |
| # Function to display help message |
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
| var traverse = function(o, fn) { | |
| for (var i in o) { | |
| fn.apply(this,[i,o[i]]); | |
| if (o[i] !== null && typeof(o[i])=="object") { | |
| traverse(o[i], fn); | |
| } | |
| } | |
| } | |
| // usage |
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
| db.adminCommand( { getLog:'global'} ).log.forEach(x => { var l = JSON.parse(x); if(l.c === "REPL") {console.log(l)}}) |
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
| type AnyObject = Record<string, unknown>; | |
| export type Join<K, P> = K extends string | number | |
| ? P extends string | number | |
| ? `${K}${'' extends P ? '' : '.'}${P}` | |
| : never | |
| : never; | |
| export type Prev = [ | |
| never, |
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
| type AnyObject = Record<string, unknown>; | |
| export type Join<K, P> = K extends string | number | |
| ? P extends string | number | |
| ? `${K}${'' extends P ? '' : '.'}${P}` | |
| : never | |
| : never; | |
| export type Prev = [ | |
| never, |
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 | |
| function calcDays($daysToCalc, string $firstDay, string $lastDay) | |
| { | |
| $start = new \DateTime($firstDay); | |
| $oneDay = new \DateInterval('P1D'); | |
| $end = (new \DateTime($lastDay))->sub($oneDay); | |
| $day = $start; |
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 | |
| function tpl_replace_all(array $data, string $template, string $openDelimiter, string $closeDelimiter): string | |
| { | |
| $d = in_array('/', [$openDelimiter, $closeDelimiter], true) ? '#' : '/'; | |
| $do = preg_quote($openDelimiter, $d); | |
| $dc = preg_quote($closeDelimiter, $d); | |
| $pattern = $d.'(?<replace>'.$do.'(?<keys>.+?(?='.$dc.'))'.$dc.')'.$d; |