L | |
lbrace, Erlang | |
lbrack, Erlang | |
lbracket, Sep | |
ldap_dn, Nslcd | |
ldap_filter, Nslcd | |
ldap_rdn, Nslcd | |
ldap_scope, Nslcd | |
ldapoid_re, Ldif | |
lglob, Erlang | |
list_empty, Test_Up2date | |
list_nocomment_test, Test_IniFile | |
list_one, Test_Up2date | |
list_test, Test_IniFile | |
list_two, Test_Up2date | |
list_two_trailing, Test_Up2date | |
lns, FAI_DiskConfig | |
lns_ace, Test_IniFile | |
lns_acf, Test_IniFile | |
lns_ade, Test_IniFile | |
lns_adf, Test_IniFile | |
lns_bce, Test_IniFile | |
lns_bcf, Test_IniFile | |
lns_bde, Test_IniFile | |
lns_bdf, Test_IniFile | |
local_flags, Chrony | |
local_options, Chrony | |
log_flags, Chrony | |
loghost_r, Syslog | |
lvmoption, FAI_DiskConfig | |
M | |
map_names, Nslcd | |
meta_release, Test_Apt_Update_Manager | |
misc_check, Test_Keepalived | |
mode3, Test_Tmpfiles | |
mode3_tree, Test_Tmpfiles | |
mount_option, FAI_DiskConfig | |
mount_option_value, FAI_DiskConfig | |
mount_options, FAI_DiskConfig | |
mountpoint, FAI_DiskConfig | |
mountpoint_kw, FAI_DiskConfig | |
multi, Test_Systemd | |
multiline_ace, Test_IniFile | |
multiline_nl, Test_IniFile | |
multiline_test, Test_IniFile | |
N | |
name | |
neg1, Rx | |
new_conf | |
no_space, Chrony | |
no_spaces, Rx | |
nocomma, Test_Aliases | |
ntp_source, Chrony | |
num, Cron | |
number, Chrony | |
number_re, Postgresql | |
O | |
octal, Rx | |
opt_hash, Syslog | |
opt_plus, Syslog | |
opt_space | |
opt_tab, Sep | |
option, FAI_DiskConfig | |
option_kw, Hosts_Access | |
options, Test_Authorized_Keys | |
optval, Crypttab |
let ldap_dn = ldap_rdn . (/(,)?/ . ldap_rdn)*
let ldap_filter = /\(.*\)/
let ldap_rdn = /[A-Za-z][A-Za-z]+=[A-Za-z0-9_.-]+/
let ldap_scope = /sub(tree)?|one(level)?|base/
Format of an LDAP OID from RFC 2251
let ldapoid_re = /[0-9][0-9\.]*/
let list_empty = "keyword=; " test Up2date.lns get list_empty = { "1" = "keyword" { "values" } }
let list_nocomment_test = "test_ace = val1,val2,val3 \n"
let list_one = "keyword=foo; " test Up2date.lns get list_one = { "1" = "keyword" { "values" { "1" = "foo" } } }
let list_test = "test_ace = val1,val2,val3 # a comment\n"
Probably not useful, up2date throws “bar” away
let list_two = "keyword=foo;bar " test Up2date.lns get list_two = { "1" = "keyword" { "values" { "1" = "foo" } { "2" = "bar" } } }
let list_two_trailing = "keyword=foo;bar; " test Up2date.lns get list_two_trailing = { "1" = "keyword" { "values" { "1" = "foo" } { "2" = "bar" } } }
The disk_config lens
let lns = (disk_config|comment|empty)*
let lns_ace = IniFile.lns record_ace comment_ace
let lns_acf = IniFile.lns_noempty record_acf comment_acf
let lns_ade = IniFile.lns record_ade comment_ade
let lns_adf = IniFile.lns_noempty record_adf comment_adf
let lns_bce = IniFile.lns record_bce comment_bce
let lns_bcf = IniFile.lns_noempty record_bce comment_bcf
let lns_bde = IniFile.lns record_bde comment_bde
let lns_bdf = IniFile.lns_noempty record_bdf comment_bdf
local options without values
let local_flags = "orphan"
local options with values
let local_options = "stratum"|"distance"
log has a specific options list
let log_flags = "measurements"|"rawmeasurements"|"refclocks"|"rtc" |"statistics"|"tempcomp"|"tracking"
Matches a hostname, that is labels speparated by dots, labels can’t start or end with a “-”.
let loghost_r = /[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*/ | "[" . Rx.ipv6 . "]"
let lvmoption =
let map_names = /alias(es)?/ | /ether(s)?/ | /group/ | /host(s)?/ | /netgroup/ | /network(s)?/ | /passwd/ | /protocol(s)?/ | /rpc/ | /service(s)?/ | /shadow/
let meta_release = "# default location for the meta-release file [METARELEASE] URI = http://changelogs.ubuntu.com/meta-release URI_LTS = http://changelogs.ubuntu.com/meta-release-lts URI_UNSTABLE_POSTFIX = -development URI_PROPOSED_POSTFIX = -proposed "
An example of a MISC health checker
let misc_check = "virtual_server 192.168.1.11 22 { real_server 10.20.40.10 22 { MISC_CHECK { misc_path /usr/local/bin/server_test misc_timeout 3 misc_dynamic } } } " test Keepalived.lns get misc_check = { "virtual_server" { "ip" = "192.168.1.11" } { "port" = "22" } { "real_server" { "ip" = "10.20.40.10" } { "port" = "22" } { "MISC_CHECK" { "misc_path" = "/usr/local/bin/server_test" } { "misc_timeout" = "3" } { "misc_dynamic" } } } }
Mode field example with only three digits
let mode3 = "c+! /tmp/foo 755\n"
Tree for mode3
let mode3_tree = { "1" { "type" = "c+!" } { "path" = "/tmp/foo" } { "mode" = "755" } }
Counting options
let mount_option = [ seq "mount_option" . store /[^,= \t\n]+/ . mount_option_value? ]
let mount_option_value = [ label "value" . Util.del_str "=" . store /[^,= \t\n]+/ ]
An array of mount_options
let mount_options = [ label "mount_options" . counter "mount_option" . Build.opt_list mount_option Sep.comma ]
let mountpoint_kw = "-" (* do not mount *) | "swap" (* swap space *)
let multi = "[Unit] After=syslog.target network.target Also=canberra-system-shutdown.service canberra-system-shutdown-reboot.service Before=sysinit.target shutdown.target CapabilityBoundingSet=CAP_SYS_ADMIN CAP_SETUID CAP_SETGID Conflicts=emergency.service emergency.target ControlGroup=%R/user/%I/shared cpu:/ ListenNetlink=kobject-uevent 1 Requires=shutdown.target umount.target final.target Sockets=udev-control.socket udev-kernel.socket WantedBy=halt.target poweroff.target Wants=local-fs.target swap.target Wants=local-fs.target \ swap.target Wants=local-fs.target\ swap.target Wants= local-fs.target "
let multiline_ace = IniFile.entry_multiline IniFile.entry_re sep_ace comment_ace
let multiline_nl = "test_ace =\n val2\n val3\n"
let multiline_test = "test_ace = val1\n val2\n val3\n"
let name = /([^ \t\n#:|@]+|"[^"|\n]*")/ (* " make emacs calm down *)
let name = /[^@%# \t\n][^ \t\n]*/
LVM volume group name
let name = [ label "name" . store /[^\/ \t\n]+/ ]
Anything but a space, a comma or a comment sign
let neg1 = /[^,# \n\t]+/
let new_conf = " ACTIVEMQ_HOME=/usr/local/share/activemq ACTIVEMQ_BASE=${ACTIVEMQ_HOME} "
let new_conf = "<beans> <broker xmlns=\"http://activemq.apache.org/schema/core\" brokerName=\"localhost\" dataDirectory=\"${activemq.data}\"> <transportConnectors> <transportConnector name=\"openwire\" uri=\"tcp://127.0.0.1:61616\"/> </transportConnectors> </broker> </beans> "
let new_conf = "### Comment admin: password, admin "
let new_conf = "# Comment admin readonly "
let new_conf = "# Comment admin password "
let new_conf = "CLOUD_DOMAIN=\"rhcloud.com\" VALID_GEAR_SIZES=\"small,medium\" DEFAULT_MAX_GEARS=\"100\" DEFAULT_GEAR_CAPABILITIES=\"small\" DEFAULT_GEAR_SIZE=\"small\" MONGO_HOST_PORT=\"localhost:27017\" MONGO_USER=\"openshift\" MONGO_PASSWORD=\"mooo\" MONGO_DB=\"openshift_broker_dev\" MONGO_SSL=\"false\" ENABLE_USAGE_TRACKING_DATASTORE=\"false\" ENABLE_USAGE_TRACKING_AUDIT_LOG=\"false\" USAGE_TRACKING_AUDIT_LOG_FILE=\"/var/log/openshift/broker/usage.log\" ENABLE_ANALYTICS=\"false\" ENABLE_USER_ACTION_LOG=\"true\" USER_ACTION_LOG_FILE=\"/var/log/openshift/broker/user_action.log\" AUTH_PRIVKEYFILE=\"/etc/openshift/server_priv.pem\" AUTH_PRIVKEYPASS=\"\" AUTH_PUBKEYFILE=\"/etc/openshift/server_pub.pem\" AUTH_RSYNC_KEY_FILE=\"/etc/openshift/rsync_id_rsa\" AUTH_SCOPE_TIMEOUTS=\"session=1.days|7.days, *=1.months|6.months\" ENABLE_MAINTENANCE_MODE=\"false\" MAINTENANCE_NOTIFICATION_FILE=\"/etc/openshift/outage_notification.txt\" DOWNLOAD_CARTRIDGES_ENABLED=\"false\" "
let new_conf = "Listen 127.0.0.1:8080 User nobody Group apache include /etc/httpd/conf.d/ruby193-passenger.conf PassengerUser apache PassengerMaxPoolSize 80 PassengerMinInstances 2 PassengerPreStart http://127.0.0.1:8080/ PassengerUseGlobalQueue off RackBaseURI /broker PassengerRuby /var/www/openshift/broker/script/broker_ruby <Directory /var/www/openshift/broker/httpd/root/broker> Options -MultiViews </Directory> "
let new_conf = "[ {\"quickstart\": { \"id\": \"1\", \"name\":\"CakePHP\", \"website\":\"http://cakephp.org/\", \"initial_git_url\":\"git://github.com/openshift/cakephp-example.git\", \"cartridges\":[\"php-5.4\",\"mysql-5.1\"], \"summary\":\"CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.\", \"tags\":[\"php\",\"cakephp\",\"framework\"], \"admin_tags\":[] }}, {\"quickstart\": { \"id\": \"2\", \"name\":\"Django\", \"website\":\"https://www.djangoproject.com/\", \"initial_git_url\":\"git://github.com/openshift/django-example.git\", \"cartridges\":[\"python-2.7\"], \"summary\":\"A high-level Python web framework that encourages rapid development and clean, pragmatic design. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\", \"tags\":[\"python\",\"django\",\"framework\"], \"admin_tags\":[] }}, {\"quickstart\":{ \"id\": \"4\", \"name\":\"Drupal\", \"website\":\"http://drupal.org/\", \"initial_git_url\":\"git://github.com/openshift/drupal-example.git\", \"cartridges\":[\"php-5.4\",\"mysql-5.1\"], \"summary\":\"An open source content management platform written in PHP powering millions of websites and applications. It is built, used, and supported by an active and diverse community of people around the world. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\", \"tags\":[\"php\",\"drupal\",\"wiki\",\"framework\",\"instant_app\"], \"admin_tags\":[] }}, {\"quickstart\":{ \"id\": \"6\", \"name\":\"Ruby on Rails\", \"website\":\"http://rubyonrails.org/\", \"initial_git_url\":\"git://github.com/openshift/rails-example.git\", \"cartridges\":[\"ruby-1.9\",\"mysql-5.1\"], \"summary\":\"An open source web framework for Ruby that is optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.\", \"tags\":[\"ruby\",\"rails\",\"framework\"], \"admin_tags\":[] }}, {\"quickstart\":{ \"id\": \"8\", \"name\":\"WordPress\", \"website\":\"https://wordpress.org\", \"initial_git_url\":\"git://github.com/openshift/wordpress-example.git\", \"cartridges\":[\"php-5.4\",\"mysql-5.1\"], \"summary\":\"A semantic personal publishing platform written in PHP with a MySQL back end, focusing on aesthetics, web standards, and usability. Administrator user name and password are written to $OPENSHIFT_DATA_DIR/CREDENTIALS.\", \"tags\":[\"php\",\"wordpress\",\"blog\",\"framework\",\"instant_app\"], \"admin_tags\":[] }} ]"
No spaces or comment characters
let no_space = /[^ \t\r\n!;#%]+/
A string with no spaces
let no_spaces = /[^ \t\r\n]+/
Don’t have to have whitespace after a comma
let nocomma = "alias: target1,target2\n"
Server/Peer/Pool key names
let ntp_source = "server"|"peer"|"pool"
let num = /[0-9*][0-9\/,*-]*/
let number = integer | decimal | decimal . /[eE]/ . integer
A relative decimal number, optionally with unit
let number_re = Rx.reldecimal . /[kMG]?B|[m]?s|min|h|d/?
An octal value
let octal = /0[0-7]+/
deletes an optional # sign
let opt_hash = del /#?/ ""
deletes an optional + sign
let opt_plus = del /\+?/ ""
An optional space or tab
let opt_space = /[ \t]*/
Deletes a Rx.opt_space and default to an empty string
let opt_space = del Rx.opt_space ""
Deletes a Rx.opt_space and default to a tab
let opt_tab = del Rx.opt_space "\t"
let option =
Since either an option or a shell command can be given, use an explicit list of known options to avoid misinterpreting a command as an option
let option_kw = "severity" | "spawn" | "twist" | "keepalive" | "linger" | "rfc931" | "banners" | "nice" | "setenv" | "umask" | "user" | /allow/i | /deny/i
let options = "# Example options no-pty ssh-dsa AAAA no-pty ssh-ed25519 AAAA no-pty,command=\"foo\" ssh-dsa AAAA no-pty,command=\"foo bar\" ssh-dsa AAAA no-pty,from=\"example.com,10.1.1.0/16\" ssh-dsa AAAA no-pty,environment=\"LANG=en_GB.UTF8\" ssh-dsa AAAA "
let optval = /[A-Za-z0-9_.:-]+/