Posts with tag: Linux

16 Apr 2010

Bash script: recursive diff between remote hosts

This script will generate a recursive, unified diff between the same path on two remote servers. You set the CONNECT1 and CONNECT2 variables as necessary to point to your hosts/paths. Of course, the users you connect as must have read access to the files/directories you’re accessing. #!/bin/bash # USAGE: ./sshdiff DIRECTORY # # E.g. ./sshdiff

[...read the post]
15 Feb 2010

Bash: unbom (to remove UTF-8 BOMs)

Tests for and removes UTF8 BOMs. #!/bin/bash for F in $1 do if [[ -f $F && `head -c 3 $F` == $'\xef\xbb\xbf' ]]; then # file exists and has UTF-8 BOM mv $F $F.bak tail -c +4 $F.bak > $F echo “removed BOM from $F” fi done USAGE: ./unbom *.txt The magic is tail

[...read the post]
12 Feb 2010

Could this be an OpenSSH bug?

Last week I tried to SSH into my webhost account (on Site5) from work and—forgetting my password—it locked me out after several failed attempts. SSHd would just close the connection without asking my password. work:~$ ssh user@example.com Connection closed by xx.xx.xx.xx I could log in from any other location, so I figured it was an

[...read the post]
28 Jan 2010

SQL Server 2008, Domain Auth, PHP5, Ubuntu Server

May this save you pain.

[...read the post]
15 Jan 2010

Configuring Sendmail for UF’s SMTP

Our Ubuntu web host, hosted with OSG, was not able to send mail (using PHP mail) outside of UF. An OSG tech said our From: header should be a valid address at UF (check) and that the logs at smtp.ufl.edu showed those messages never made it there. The solution was to configure sendmail to use

[...read the post]