\,'haproxy.cfg' : 'haproxy -c -f'
\,'haproxy' : 'haproxy -c -f'
\,'html' : 'xmllint --noout --html'
- \,'id' : 'cmd_check'
\,'init' : 'init-checkconf'
\,'json' : 'ruby -rjson -e ''puts JSON.parse(File.read(ARGV[0]))'''
\,'perl' : 'perl -c -w'
<?php
class Mime {
const Types = [
-#>SHELL_REPLACE nb_api '/pub/mime/ls/type,ext.php_hash?align=0&limit=5' | sed "s/^/$(printf '\t\t')/"
+#>SHELL_REPLACE nb_api '/pub/mime/ls/type,ext.php_hash' | sed "s/^/$(printf '\t\t')/"
"application/applixware" => "aw",
"application/atomcat+xml" => "atomcat",
"application/atomsvc+xml" => "atomsvc",
const NB_ROOT = NB_ROOT;
protected static $content_types_aliases = array(
- #>_SHELL_REPLACE dbq db=$NB_DB table="SELECT type,ext FROM mime_type WHERE ext IN ('json','csv','txt','yaml','xml','html','doc','xls')"
'text' => 'txt',
'human' => 'txt',
'table' => 'html',
'div' => 'html',
- #<_SHELL_REPLACE
);
- # NB 19.01.18: TODEL
-# NB 19.01.18 protected static $content_types = array(
-# NB 19.01.18 'json' => 'text/json',
-# NB 19.01.18 'doc' => 'application/msword',
-# NB 19.01.18 'xls' => 'application/vnd.ms-excel',
-# NB 19.01.18 'xml' => 'application/xml',
-# NB 19.01.18 'txt' => 'text/plain',
-# NB 19.01.18 'csv' => 'text/csv',
-# NB 19.01.18 'html' => 'text/html',
-# NB 19.01.18 'yaml' => 'text/yaml',
-# NB 19.01.18 'php' => 'text/x-php',
-# NB 19.01.18 );
-
public function __construct($opt = array()) {
# Deep merge of vars
FROM host_info
GROUP BY host
;
-GRANT ALL ON hostGRANT ALL ON ALL TABLES IN SCHEMA public TO TO nico,www;
CREATE INDEX IF NOT EXISTS host_info_key ON host_info USING btree (key);
CREATE INDEX IF NOT EXISTS host_info_val ON host_info USING btree (val);
CREATE INDEX IF NOT EXISTS host_info_updated ON host_info USING btree (updated);
-GRANT ALL ON host_info TO nico,www;
id char(3) PRIMARY KEY,
name varchar(60)
);
-GRANT ALL ON TABLE lang TO www;
-GRANT ALL ON TABLE lang TO nico;
-GRANT ALL ON TABLE lang TO root;
BEGIN TRANSACTION;
DELETE FROM lang;
COPY lang FROM PROGRAM 'curl -s http://download.geonames.org/export/dump/iso-languagecodes.txt \
--- /dev/null
+DROP TABLE IF EXISTS meta;
+CREATE TABLE meta (
+ cat VARCHAR(200),
+ key VARCHAR(100) NOT NULL,
+ val VARCHAR(500) NOT NULL,
+ updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ -- PRIMARY KEY (cat,key,updated)
+ PRIMARY KEY (cat,key)
+);
+CREATE INDEX IF NOT EXISTS meta_cat ON meta USING btree (cat);
+CREATE INDEX IF NOT EXISTS meta_key ON meta USING btree (key);
+CREATE INDEX IF NOT EXISTS meta_val ON meta USING btree (val);
+CREATE INDEX IF NOT EXISTS meta_updated ON meta USING btree (updated);
CREATE INDEX IF NOT EXISTS zipcode_country_idx ON zipcode (country);
CREATE INDEX IF NOT EXISTS zipcode_name_idx ON zipcode (name);
-GRANT ALL ON TABLE zipcode TO www;
-GRANT ALL ON TABLE zipcode TO nico;
-GRANT ALL ON TABLE zipcode TO root;
-
BEGIN TRANSACTION;
DELETE FROM zipcode;
COPY zipcode FROM PROGRAM 'curl -s http://download.geonames.org/export/zip/allCountries.zip | zcat | sed "s,\\\\,\\\\\\\\,g"' WITH (format 'text', NULL '');