BASH – Automating SCP/SSH/RSYNC connections with EXPECT

Published on Author gryzliLeave a comment

Very often I need to automate some task which requires user input, most of the times this input is some type of credentials (user + password) or sometime some more. I have find that expect is very useful in such cases.   Before trying any of the scripts below, make sure you have expect installed on… Continue reading BASH – Automating SCP/SSH/RSYNC connections with EXPECT

BASH – Tips and tricks

Published on Author gryzliLeave a comment

BASH tips and tricks, which I use in my daily bash programming. You might find some of them really usefull….   1. String substitution

  Front Match These are the examples of a front matching Front is meant to be “left to right” matching

  Rear Match These are the examples of a… Continue reading BASH – Tips and tricks

Strace buggy php script running as cgi – Strace daemon

Published on Author gryzliLeave a comment

Very often I need to strace a script which is not “constantly” running, and must be “catch” during it’s execution. Today I had to debug some bad behaving php script, but because php was running as CGI (mod_suphp) it was hard a task. I had 3 choices in order to successfully attach the strace to the php… Continue reading Strace buggy php script running as cgi – Strace daemon

Change user password through BASH script

Published on Author gryzliLeave a comment

Very often I need to automate some bulk user password change. In the following examples we have: $user as username $pass as password in plain text Currently these are the methods I use to change user passwords: chpasswd method

The old passwd method

  Also I use the following to GENERATE RANDOM passwords:… Continue reading Change user password through BASH script