This file contains 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 | |
require '/path/to/markdown-extra.php'; | |
$db = mysql_connect('localhost', 'root', 'password') or die(mysql_error()); | |
mysql_select_db('tylerio', $db) or die(mysql_error()); | |
$files = scandir('posts'); | |
array_shift($files); // . | |
array_shift($files); // .. |
This file contains 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 | |
$journal_fn = $argv[1]; | |
$entries_dir = $journal_fn . '/entries/'; | |
$entries = scandir($entries_dir); | |
print_r($entries); | |
$total_words = 0; | |
This file contains 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 | |
$journal_fn = $argv[1]; | |
$entries_dir = $journal_fn . '/entries/'; | |
$entries = scandir($entries_dir); | |
print_r($entries); | |
$total_words = 0; | |
This file contains 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
#requires -Modules Configuration, Pester, PSScriptAnalyzer | |
[CmdletBinding()] | |
[OutputType()] | |
$ErrorActionPreference = "Stop" | |
try { | |
# Setup environment. | |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Confirm:$false -Force | |
This file contains 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
// A Reactor Management Script by quill18 (http://quill18.com) | |
// Latest Version: https://gist.github.com/quill18/c4b71d81f9202db11455 | |
// | |
// | |
// Developed for: | |
// Kerbal Space Program 1.04 | |
// kOS 0.17.3 | |
// Near Future Electrical 0.5.3 | |
// | |
// |
This file contains 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
import org.apache.avro.Schema; | |
import org.apache.avro.generic.GenericData; | |
import org.apache.avro.generic.GenericDatumWriter; | |
import org.apache.avro.generic.GenericRecord; | |
import org.apache.avro.io.Encoder; | |
import org.apache.avro.io.EncoderFactory; | |
import org.apache.kafka.clients.producer.KafkaProducer; | |
import org.apache.kafka.clients.producer.ProducerRecord; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
This file contains 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
import org.apache.avro.Schema; | |
import org.apache.avro.generic.GenericData; | |
import org.apache.avro.generic.GenericDatumWriter; | |
import org.apache.avro.generic.GenericRecord; | |
import org.apache.avro.io.Encoder; | |
import org.apache.avro.io.EncoderFactory; | |
import org.apache.kafka.clients.producer.KafkaProducer; | |
import org.apache.kafka.clients.producer.ProducerRecord; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
This file contains 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
servers="server1 server2 server3" | |
for osdserver in ${servers} ; do | |
j=1 | |
for disk in {a..p} ; do | |
echo ceph-deploy disk zap ${osdserver}:sd${disk} | |
echo ceph-deploy disk prepare ${osdserver}:sd${disk}:/dev/nvme0n1p${j} | |
echo ceph-deploy disk activate ${osdserver}:sd${disk}:/dev/nvmen1p${j} | |
let j=j+1 | |
done | |
done |
This file contains 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 unzip_file($file, $destination) { | |
// create object | |
$zip = new ZipArchive() ; | |
// open archive | |
if ($zip->open($file) !== TRUE) { | |
die ('Could not open archive'); | |
} | |
// extract contents to destination directory | |
$zip->extractTo($destination); | |
// close archive |
OlderNewer