Useful commands – often overlooked

Linux/Unix etc


htop :: Shows process information in an interactive display from the command line on a *nix box


lsof :: This lists “Open Files” on a *nix system – the common arguments are: -i -P and -n
The -i option means show IP sockets -P means do NOT show port names but only port numbers ( ie not https but 443) and the -n means no DNS lookup (do not show hostnames)

see: https://www.howtoforge.com/linux-lsof-command/


Powershell

Powershell has a Grep type command which I find very useful:

Select-String -Path C:\temp\*.log -Pattern “Dichotomy Larder”

See: https://www.thomasmaurer.ch/2011/03/powershell-search-for-string-or-grep-for-powershell/

Accessing by SSH Public Key Authentication

Quick notes for an already well documented method. From a *nix based machine (my iMac while writing this).

ssh-keygen -t rsa -b 4096 -C “me@emailaddress.com”

Choose an id filename – on this instance I set: id_rsademo

ssh-copy-id -i ~/.ssh/id_rsademo me@192.168.0.1

The connection is to the machine on its ip address – this simply has to be able to resolve so it can use DNS

A good write-up is available here: https://www.ssh.com/ssh/copy-id

Gotchas with deploying Grails apps

Some things to check when deploying Grails packages:

Ensure tomcat is stopped if running under Tomcat
Run grails clean – always
Remove $CATALINA_HOME/work/Catalina/localhost/my.website.com directory
Remove $CATALINA_HOME/webapps/ROOT.war
Remove (rm -rf) $CATALINA_HOME/webapps/ROOT/
If necessary – increase cache size in $CATALINA_HOME/conf/context.xml
If deploying to SSL (https) ensure that a valid SSL crtificate is in place – or you will most likely get a Deployment error which is virtually impossible to trace

ALSO: rm /opt/tomcat/webapps/ROOT/WEB-INF/lib/bcprov-jdk14-136.jar

Copy the new package to $CATALINA_HOME/webapps/ as ROOT.war if it is to be a base URL based site

Restart tomcat

Test!