using rot13 and tr command for having an encrypted email address

Not sure exactly how you want to use this, but here’s a basic example to get you started: echo ‘fooman@example.com’ | tr ‘A-Za-z’ ‘N-ZA-Mn-za-m’ To make it easier, you can alias the tr command in your .bashrc file thusly: alias rot13=”tr ‘A-Za-z’ ‘N-ZA-Mn-za-m'” Now you can just call: echo ‘fooman@example.com’ | rot13

How to download the latest artifact from Artifactory repository?

Something like the following bash script will retrieve the lastest com.company:artifact snapshot from the snapshot repo: # Artifactory location server=http://artifactory.company.com/artifactory repo=snapshot # Maven artifact location name=artifact artifact=com/company/$name path=$server/$repo/$artifact version=$(curl -s $path/maven-metadata.xml | grep latest | sed “s/.*<latest>\([^<]*\)<\/latest>.*/\1/”) build=$(curl -s $path/$version/maven-metadata.xml | grep ‘<value>’ | head -1 | sed “s/.*<value>\([^<]*\)<\/value>.*/\1/”) jar=$name-$build.jar url=$path/$version/$jar # Download echo $url … Read more

Command to clear shell while using emacs shell

Update February 2015 Just noticed that Emacs now (version 25+) has the command comint-clear-buffer, bound to C-c M-o by default, that does what we need here, and probably is preferable to the answers I originally posted below. Options to consider: C-l will recenter the buffer. Pressing it repeatedly cycles the buffer, so that point appears … Read more

Write output to a file after piped to jq

Just calling jq without a filter will throw errors if stdout isn’t a terminal $ curl https://jsonplaceholder.typicode.com/posts/1 | jq > test.txt jq – commandline JSON processor [version 1.5-1-a5b5cbe] Usage: jq [options] <jq filter> [file…] jq is a tool for processing JSON inputs, applying the given filter to its JSON text inputs and producing the […] … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)