Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
lucee.runtime.exp.NativeException: mac os x is not a supported OS platform.# Jar installs to lib/jline-3.0.0.M1/jline-3.0.0.M1.jar
install "jar:https://search.maven.org/remotecontent?filepath=jline/jline/3.0.0.M1/jline-3.0.0.M1.jar"
# Load up the jar when the server starts
server set app.libDirs=lib# array of structs
printTable [{a:1,b:2},{a:3,b:4},{a:5,b:6}]
╔═══╤═══╗
║ a │ b ║
╠═══╪═══╣
║ 1 │ 2 ║
╟───┼───╢
║ 3 │ 4 ║
╟───┼───╢
║ 5 │ 6 ║
╚═══╧═══╝
# array of arrays
printTable data=[[1,2],[3,4],[5,6]] headerNames=foo,bar
╔═════╤═════╗
║ foo │ bar ║
╠═════╪═════╣
║ 1 │ 2 ║
╟─────┼─────╢
║ 3 │ 4 ║
╟─────┼─────╢
║ 5 │ 6 ║
╚═════╧═════╝
# Query object
#extensionlist | printTable name,version
╔═════════════════════════════════════════╤═══════════════════╗
║ name │ version ║
╠═════════════════════════════════════════╪═══════════════════╣
║ MySQL │ 8.0.19 ║
╟─────────────────────────────────────────┼───────────────────╢
║ Microsoft SQL Server (Vendor Microsoft) │ 6.5.4 ║
╟─────────────────────────────────────────┼───────────────────╢
║ PostgreSQL │ 9.4.1212 ║
╟─────────────────────────────────────────┼───────────────────╢
║ Ajax Extension │ 1.0.0.3 ║
╚═════════════════════════════════════════╧═══════════════════╝
# JSON list of all servers
server list --json | printTable name,host,port,status
╔══════════════════════════════╤═════════════════════════════╤═══════╤═════════╗
║ name │ host │ port │ status ║
╠══════════════════════════════╪═════════════════════════════╪═══════╪═════════╣
║ servicetest │ 127.0.0.1 │ 54427 │ stopped ║
╟──────────────────────────────┼─────────────────────────────┼───────┼─────────╢
║ servicetest2 │ 127.0.0.1 │ 52919 │ stopped ║
╟──────────────────────────────┼─────────────────────────────┼───────┼─────────╢
║ FRDemos │ 127.0.0.1 │ 50458 │ stopped ║
╚══════════════════════════════╧═════════════════════════════╧═══════╧═════════╝# filter, sort, limit, and select extensions installed into the CLI (output as table)
#extensionlist | sql select=id,name where="name like '%sql%'" orderby=name limit=3 | printTable
# order and select JSON data from a file (output as JSON)
cat myfile.json | sql select=col1,col2 orderby=col2
# limit JSON (output as table)
sql data=[{a:1,b:2},{a:3,b:4},{a:5,b:6}] where="a > 1" | printTable
public string function print(
required any headers,
array data=[],
string includeHeaders
) {public string function print(
required any data=[],
any includedHeaders="",
any headerNames="",
boolean debug=false
) {❯ repl "XMLParse( '<root><brad>wood</brad></root>' )"
<?xml version="1.0" encoding="utf-8"?><root>
<brad>wood</brad>
</root># Logout one user
forgebox logout username
# logout all users
forgebox logoutconfig set tabCompleteInline=true|------------------------------
| √ | Setting Server Profile to [development]
| |------------------------------------------------------
| | Profile set from "environment" env var
| | Block CF Admin disabled
| | Block Sensitive Paths enabled
| | Block Flash Remoting enabled
| | Directory Browsing enabled
| |------------------------------------------------------{
"app" : {
"webXMLOverride" : "path/to/web-override.xml"
}
}# quoted string
package set foo."bar.baz"=bum
# bracketed string
package set foo[bar.baz]=bum
# quoted, bracketed string
package set foo["bar.baz"]=bumset color=`ask "favorite Color? "`
echo "you said ${Setting: color not found}"ask question="Who is cool? " defaultResponse="Balbino!"ask question="What is your password? " mask=*ask "Secret phrase: " | assertEqual "mockingbird" || echo "access denied!" && exit 1confirm "do you want to update your packages? " && updateserver prune days=30
# Skip the confirmation check
server prune --forceserver start cfengine=nonebox -cliworkingDir=C:/my/path/here/{
"trayOptions" : [
{
"label" : "Does the Internet work?",
"action" : "run",
"command" : "ping google.com"
},
{
"label" : "Math is math!",
"action" : "runAsync",
"command" : "calc.exe"
},
{
"label" : "Update dependencies",
"action" : "runTerminal",
"command" : "box update"
}
]
}
box_config_endpoints_forgebox_APIToken=my-token-here
# JSON which will be parsed
box_config_proxy={ "server" : "localhost", "port": 80 }
# dot-delimited keys (windows only)
box_config_endpoints.forgebox.APIToken=my-token-here
# array indexes too (windows only)
box_config_foo.bar[baz].bum[1]=testbox_server_profile=production
box_server_web_http_port=8080
# JSON which will be parsed
box_server_web_ssl={ "enabled" : true, "port": 443 }
# dot-delimited keys (Windows only)
box_server_web.http.port=8080
# array indexes too (Windows only)
box_server_web_rules[1]=path-suffix(/box.json) -> set-error(404)
box_server_web_rules[2]=disallowed-methods(trace)server set web.http2.enable=true/false# Return array of dependency names
package show | jq keys(dependencies)
# Find dependencies with "cb" in their name
package show | jq key_contains(dependencies,'cb')config show jq:endpoints.forgebox.apiToken
# .. is the same as ...
config show endpoints.forgebox.apiToken
# or you can get fancy...
config show 'jq:keys(modules)'
# Impress your friends
package show "jq:[name,version]"
# Be the life of the party
package show "jq:contributors|split(@,' ')" server set web.AJP.secret=mySecret// Parallel Executions
async().all(
() => hyper.post( "/somewhere" ),
() => hyper.post( "/somewhereElse" ),
() => hyper.post( "/another" )
).then( (results)=> logResults( results ) );print.table(
[ 'First Name', 'Last Name' ],
[
[ 'Brad', 'Wood' ],
[ 'Luis', 'Majano' ],
[ 'Gavin', 'Pickin' ]
]
);coldbox create handler --restserver set runwar.args="--resource-manager-logging=true"server set runwar.args="--case-sensitive-web-server=true"server set runwar.args="--case-sensitive-web-server=false"server set runwar.args="--cache-servlet-paths=true"server set web.SSL.forceSSLRedirect=trueserver set web.SSL.HSTS.enable=true
server set web.SSL.HSTS.maxAge=31536000
server set web.SSL.HSTS.includeSubDomains=trueconfig set colorInDumbTerminal=trueserver start [email protected]+48server start [email protected]server set web.host=mySite.localhostcommandbox_home=../customHomebox_server_web_http_port=0The parameter [name] to function [get] is required but was not passed in.~/.CommandBox/cfml/modules/commandbox-dotenvinstall commandbox-dotenvinstall git+https://username:[email protected]/user/repo.git
or
install git+https://[email protected]/user/repo.gitinstall lex:https://downloads.ortussolutions.com/ortussolutions/lucee-extensions/ortus-redis-cache/1.4.0/ortus-redis-cache-1.4.0.lex// ForgeBox slug for Ortus Redis Extension
install 5C558CC6-1E67-4776-96A60F9726D580F1server set web.maxRequests=200{
"web" : {
"maxRequests" : 200
}
}server set runwar.undertowOptions.ALLOW_UNESCAPED_CHARACTERS_IN_URL=true
server set runwar.XNIOOptions.WORKER_NAME=myWorkerserver start --console --dryRun startScript=bash startScriptFile=startmebaby.sh
// Later directly from bash...
./startmebaby.shdir **.cfc,*.cfm
dir paths=modules excludePath=**.md --recurse
dir paths=samples sort="directory asc, name desc"cat names.txt | unique
cat names.txt | unique --countcat names.txt | sort
cat names.txt | sort type=text
cat names.txt | sort type=numeric
cat names.txt | sort direction=descdir **.cfc | grep --count
dir | grep .*\.md --count
server set profile=productionserver start profile=productionserver set web.blockCFAdmin=true
server set web.blockCFAdmin=false
server set web.blockCFAdmin=external
server set web.blockSensitivePaths=true
server set web.blockSensitivePaths=false
server set web.blockFlashRemoting=true
server set web.blockFlashRemoting=falsepath-suffix(/box.json) -> set-error(404){
"web" : {
"rules" : [
"path-suffix(/box.json) -> set-error(404)",
"path-suffix(hidden.js) -> set-error(404)",
"path-prefix(/admin/) -> ip-access-control(192.168.0.* allow)",
"path(/sitemap.xml) -> rewrite(/sitemap.cfm)",
"disallowed-methods(trace)"
],
"rulesFile" : "../secure-rules.json"
// Or...
"rulesFile" : ["../security.json","../rewrites.txt","../app-headers.json"]
// Or...
"rulesFile" : "../rules/*.json"
}
}// Block all CF admin access
cf-admin() -> set-error( 404 );
// Shortcut for the previous rule
block-cf-admin()
// Block external CF admin access
cf-admin() -> block-external() // Reference box.json file in this directory
$ {boxjson.slug}
// Reference server.json file in this directory
$ serverjson.web.http.port:80}
// Reference local server details
$ {serverinfo.serverHomeDirectory}
// Reference arbitrary JSON file
$ {[email protected]}
// Reference CLI's config settings
$ {configsetting.endpoints.forgebox.apitoken}
// Local reference to a JSON property in the same file
{
"appFileGlobs" : "models/**/*.cfc,tests/specs/**/*.cfc",
"scripts":{
"format":"cfformat run $ {@appFileGlobs} --overwrite",
"format:check":"cfformat check $ {@appFileGlobs} --verbose"
}
}$ {AWSSecretStore.mySecretKey}server set web.gzipEnable=true
server set web.gzipPredicate="not path-prefix( admin ) and regex( '(.*).css' ) and request-larger-than(500)"watch *.json "echo 'config file updated!'"set command = "echo 'You added \$ {item}!'"
watch command="foreach '\$ {watcher_added}' \$ {command}" --verbose// use Chrome
config set preferredBrowser=chrome
// use FireFox
config set preferredBrowser=frefox
// Just kidding, no one is going to use this!!
config set preferredBrowser=ieserver open browser=operaRewriteRule ^/login.cfm$ /condworks.html [R=301]// current directory
cd . -> ./
// back 1 directory
cd .. -> ../
// back 2 directories
cd ... -> cd ../../
// back 3 directories
cd .... -> cd ../../../ #createguid | !clip
or
#createguid | run clipserver set web.blockCFAdmin=false3gp,3gpp,7z,ai,aif,aiff,asf,asx,atom,au,avi,bin,bmp,btm,cco,crt,css,csv,deb,der,dmg,doc,docx,eot,eps,flv,font,gif,hqx,htc,htm,html,ico,img,ini,iso,jad,jng,jnlp,jpeg,jpg,js,json,kar,kml,kmz,m3u8,m4a,m4v,map,mid,midi,mml,mng,mov,mp3,mp4,mpeg,mpeg4,mpg,msi,msm,msp,ogg,otf,pdb,pdf,pem,pl,pm,png,ppt,pptx,prc,ps,psd,ra,rar,rpm,rss,rtf,run,sea,shtml,sit,svg,svgz,swf,tar,tcl,tif,tiff,tk,ts,ttf,txt,wav,wbmp,webm,webp,wmf,wml,wmlc,wmv,woff,woff2,xhtml,xls,xlsx,xml,xpi,xspf,zip,aifc,aac,apk,bak,bk,bz2,cdr,cmx,dat,dtd,eml,fla,gz,gzip,ipa,ia,indd,hey,lz,maf,markdown,md,mkv,mp1,mp2,mpe,odt,ott,odg,odf,ots,pps,pot,pmd,pub,raw,sdd,tsv,xcf,yml,yamlserver set web.allowedExt=jar,exe,dll