Category Archives: Scripting

Passbox

usage: passbox [action]

Passbox – command line password manager utility

ACTIONS

add-field Update an existing entry to add additional fields to
delete Remove an entry from the password database
get Get a particular password entry by it’s name
generate Generate a new random password
new Prompt to create a new passbox entry
remove-field Update an existing entry to remove additional fields
search Search the password database for a particular string, returns all matching entries
update Update an existing entry in the password database

nginx+observium configuration

Update to index.php in observium to work with nginx.

Change from:

$_SERVER[‘PATH_INFO’] = (isset($_SERVER[‘PATH_INFO’]) ? $_SERVER[‘PATH_INFO’] : $_SERVER[‘ORIG_PATH_INFO’]);

Change to:

$_SERVER[‘PATH_INFO’] = $_SERVER[‘REQUEST_URI’];

nginx site configuration:

server {
listen 80;
server_name hostname.kulish.com;

access_log /var/log/nginx/hostname.kulish.com.acc.log;
error_log /var/log/nginx/hostname.kulish.com.err.log;

root /www/observium/html;
index index.php;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}

location / {
try_files $uri $uri/ @observium;
}

location @observium {
rewrite ^(.+)$ /index.php/$1/ last;
}

}

# General php settings
include php.conf;

# We need to exclude robots.txt specifically
include drop.conf;

irc.diff.05142011.2.txt


Index: irc.php
===================================================================
--- irc.php (revision 2317)
+++ irc.php (working copy)
@@ -1,10 +1,6 @@
#!/usr/bin/env php

-# status
-# reboot
-# log
-# help
-# down
+# port_info is broken. always reports same values no matter host selected

message(SMARTIRC_TYPE_CHANNEL, $data->channel, "Commands: !help, !log, !status, !version, !down, !port, !device, !listdevices");
+
+echo date("m-d-y H:i:s ");
+echo "HELP\n";
+
+mysql_close();
+
+ }
+
+
+###
# Get status on !version
###
function version_info(&$irc, &$data)
@@ -40,6 +55,7 @@

$irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, "Observium Version " . $config['version']);

+echo date("m-d-y H:i:s ");
echo "VERSION\t\t". $config['version'] . "\n";

mysql_close();
@@ -47,6 +63,31 @@
}

irc.diff.05142011.1.txt


Index: irc.php
===================================================================
--- irc.php (revision 2317)
+++ irc.php (working copy)
@@ -1,11 +1,5 @@
#!/usr/bin/env php

-# status
-# reboot
-# log
-# help
-# down
-
message(SMARTIRC_TYPE_CHANNEL, $data->channel, "Commands: !help, !log, !status, !version, !down, !port, !device, !listdevices");
+
+echo date("m-d-y H:i:s ");
+echo "HELP\n";
+
+mysql_close();
+
+ }
+
+
+###
# Get status on !version
###
function version_info(&$irc, &$data)
@@ -40,6 +53,7 @@

$irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, "Observium Version " . $config['version']);

+echo date("m-d-y H:i:s ");
echo "VERSION\t\t". $config['version'] . "\n";

mysql_close();
@@ -47,6 +61,31 @@
}