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
root@drudge:/etc/libvirt/qemu# cat monit.lyte.xml | |
<domain type='kvm'> | |
<name>monit.lyte</name> | |
<uuid>63001546-440a-f2d2-ebec-fdacb25b1d96</uuid> | |
<memory>524288</memory> | |
<currentMemory>524288</currentMemory> | |
<vcpu>1</vcpu> | |
<os> | |
<type arch='x86_64' machine='pc-0.14'>hvm</type> | |
<boot dev='hd'/> |
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
// Produces: | |
// Error: ECONNREFUSED, Connection refused | |
// at Client._onConnect (net.js:601:18) | |
// at IOWatcher.onWritable [as callback] (net.js:186:12) | |
var http = require('http') | |
var server = http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello world\n'); |
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
# cat /etc/logrotate.conf | |
# see "man logrotate" for details | |
# rotate log files weekly | |
weekly | |
# keep 4 weeks worth of backlogs | |
rotate 4 | |
# create new (empty) log files after rotating old ones | |
create |
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
dschoen@dave-xps 07 10:49:34 ~ 130 | |
$ type prompt_command_lyte | |
prompt_command_lyte is a function | |
prompt_command_lyte () | |
{ | |
EXIT_STATUS="$?"; | |
if [ $UID -eq 0 ]; then | |
FONT_USER=$FONT_RED; | |
else | |
FONT_USER=$FONT_GREEN; |
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 pp (o) | |
local typ = type(o) | |
if typ == "boolean" or typ == "number" then | |
return o | |
elseif typ == "string" then | |
return string.format( "%q", o) | |
elseif typ == "table" then | |
local t = { "{"} | |
for k, v in pairs ( o ) do | |
local nice = "[" .. pp(k) .. "]" .. " = " .. pp(v) .. ";" |
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
require 'guard' | |
require 'guard/guard' | |
require 'guard/jasmine-node' | |
module ::Guard | |
class Guard | |
def vagrant_run_prefix() | |
prep_ssh_config | |
"ssh -F #{ssh_conf_file} default -- cd /vagrant\\;" | |
end |
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 | |
function docurl($url) { | |
$opts = array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_URL => $url, | |
CURLOPT_HEADER => true, | |
); | |
$ch = curl_init(); | |
curl_setopt_array($ch, $opts); |
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 | |
$dbh = new PDO("pgsql:dbname=test;user=postgres"); | |
if (pcntl_fork()) { | |
// give child a moment to shutdown | |
usleep(200000); | |
// do anything with the db... segfault! | |
$dbh->query("select version();"); | |
} |
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 | |
function docurl($url) { | |
$opts = array( | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_URL => $url, | |
CURLOPT_HEADER => true, | |
); | |
$ch = curl_init(); | |
curl_setopt_array($ch, $opts); |
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
#!/bin/bash -e | |
# vssh - significantly faster Vagrant SSHing | |
# Usage: vssh [vagrant host] [regular ssh arguments] | |
# find the .vagrant directory scanning up from $PWD | |
find_vagrant_dir() { | |
cdir="$PWD" | |
while ! [[ -d "$cdir/.vagrant" ]] && [[ "$cdir" != "/" ]]; do | |
cdir="$(dirname "$cdir")" |
OlderNewer