Category Ubuntu

self deleting bash script

How to create a bash script that deletes itself This script will delete itself via the shred command (secure deletion) when it exits #!/bin/bash # # Author: Steve Stonebraker # Date: August 20, 2013 # Name: shred_self.sh # Purpose: securely…

Bash Cheat Sheet

Here’s my bash cheat sheet: Tests Combining [ condition ] && action; # action executes if condition is true. [ condition ] || action; # action executes if condition is false. Filesystem related tests We can test different filesystem related…

restart service over ssh

I recently ran in to trouble restarting neo4j over ssh here’s the fix: From machine calling neo4j host ssh -f $USER@$HOST ‘sh -c “( (nohup sudo restart 2>&1 >output.file </dev/null) & )”‘ Target Machine Sudoers Replace “someuser” with whatever…

Testing SSL Chaining Issues

Recently I needed to debug an issue by testing SSL chaining issues My old standby tools (curl and openssl were not reporting any errors) The exception javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of…