Skip to content

Instantly share code, notes, and snippets.

@annagapuz
annagapuz / GrailsConfigLocations
Last active December 28, 2015 03:19
Grails externalized configuration files (grails.config.locations)
Grails externalized configuration files:
If you want to include a config groovy class, you have to include it as an object in the config location list.
Despite the comments saying this:
// grails.config.locations = [ "classpath:${appName}-config.properties",
// "classpath:${appName}-config.groovy",
// "file:${userHome}/.grails/${appName}-config.properties",
// "file:${userHome}/.grails/${appName}-config.groovy"]
@annagapuz
annagapuz / HelpfulNixCommands
Last active June 21, 2022 14:20
Helpful *nix Commands- truncate, delete file/directories based on age, df, du
# Number indicates size, in bytes, to leave. Can run on a file that is currently being written to, like server logs.
sudo truncate -s 4 server.log
# Deletes files and directories older than 7 days
sudo find <full path dir> -ctime +7 -exec rm -rf {} \;
# Disk space
df
df -h // human-readable
@annagapuz
annagapuz / OpenSSLCACreateAndSign
Last active December 10, 2015 23:49
OpenSSL Create Certificate Authority and sign certificate request
# Assumptions
- OpenSSL is installed
- base working directory is /usr/lib/ssl/misc
# Create new certificate authority, created in demoCA directory
sudo ./CA.pl -newca
# Sign a certificate request using CA created above
sudo openssl x509 -req -CA demoCA/cacert.pem -CAkey demoCA/private/cakey.pem -in newreq.pem -out localhost.cer -days 1460 -CAcreateserial