]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/functions
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 5 Dec 2017 18:50:21 +0000 (18:50 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 5 Dec 2017 18:50:21 +0000 (18:50 +0000)
etc/profile.d/functions
share/db/sys.sql

index 05f6f4b5b51bf83c07325ab81c098c0fd5b8e2f8..663283a4ebf8131e963e9f2c2128fc1a2019e60d 100644 (file)
@@ -757,6 +757,20 @@ while (@_) {
 ' "$t"
 }
 
+tab2space() {
+       local size=2
+       [ "$1" = "-size" ] && shift && size=$1 && shift
+       local space=$(eval "printf ' %.0s' {1..$size}")
+       perl -pe "1 while s/^\t/$space/" $@
+}
+
+space2tab() {
+       local size=2
+       [ "$1" = "-size" ] && shift && size=$1 && shift
+       local space=$(eval "printf ' %.0s' {1..$size}")
+       perl -pe "1 while s/^$space/\t/" $@
+}
+
 shell_replace() {
 
   local usage="Usage: shell_replace [-i[.BACKUP_EXTENSION]] [-find PAHT]"
index 0e707c12ec2c3cbecd8cce82a6a8f4cdfb7b23bc..d46cb976b4acc98f552e8d641ba4357ea56fde53 100644 (file)
@@ -1,4 +1,4 @@
-DROP TABLE IF EXISTS service;
+-- NB 05.12.17 DROP TABLE IF EXISTS service;
 -- NB 25.10.17 CREATE TABLE IF NOT EXISTS service (
 -- NB 25.10.17   name VARCHAR(100),
 -- NB 25.10.17   description VARCHAR(200),
@@ -38,3 +38,14 @@ CREATE TABLE shell_function (
 -- NB 25.10.17   option VARCHAR(100),
 -- NB 25.10.17   price float(5,2)
 -- NB 25.10.17 );
+CREATE TABLE IF NOT EXISTS mime (
+       id varchar(32) NOT NULL PRIMARY KEY,
+       name varchar(128),
+       cmd_check varchar(300)
+);
+CREATE TABLE IF NOT EXISTS mime_type (
+       name varchar(128),
+       type varchar(128) NOT NULL DEFAULT '' PRIMARY KEY,
+       ext varchar(128)
+);
+CREATE INDEX IF NOT EXISTS mime_type_ext_idx ON mime_type (ext);