ldapsearch greater than

Problem You want to search for a field greater than a value, in your LDAP search. Solution To search for a field with a value greater than a given figure,...

phpdoc-msg

These pages have been retired, check out php docs

receive notification when file arrives

Problem You want to get notified when a file arrives. Maybe it is coming in from somewhere else, or just is the result of some processing.What ever the...

UNIX debugging

Problem You want to debug a running process on Solaris?You want to debug running process on Linux? Solution See the example for debugging processes on...

Smallest AJAX example in the world?

Problem Learn and demonstrate some simple AJAX.To produce a clear, clean example – as small as possible. Solution Can a smaller working AJAX example...

Shell Tips and Tricks

Problem You want to trace program execution on Solaris?You want to perform network tracing on Solaris?Perform a text dump of a binary file – or see...

undocument find secret

Problem You want to find a pattern in a file and have the line displayed. Solution I “discovered” this undocument (well in all the doco I’ve...

Optical Dump

Problem Ever need to look at a file, but have not been able to – due to hidden control characters, etc. Solution Or just needed to see spaces and...

Shell Utilities

Problem You want to compare 2 streams, with byte offset and line numbers?Pull off content with a byte offset?Display lines before or after a pattern?Send...

openssl many uses

Problem You want to generate a self-signed certificate?Encrypt a message with triple desView base 64 encoded dataGenerate and use random dataTest ciphersMonitor...

uuencode send attachments

Problem You want to send an attachment, from UNIX command line or from within a shell script Solution uuencode works a treat with Solaris. Not sure on...

tar many uses

Problem You want to make some backups with tar. Solution tar is very functional and has many uses. Example If you are lucky enough to have GNU tar (tar...

Port forwarding with SSH

Problem You want to forward all traffic from a port on your box, to another host/port combination. Solution The command in the example will port forward,...

Email upon cron failure

Problem You want to receive an email upon cron job failure. Solution The example code can be wrapped around a normal cronjob, to send an email if the cron...

awk line length and average

Problem You want to display line lengths – then average line length of file. Solution Snip using awk – see example. Example awk ' { thislen=length($0);...

Linux IPTables Open port range.

Problem Had to find out how to allow a range with iptables recently, whilst setting up Samba and NFS. Solution Always take a backup first, then vi /etc/sysconfig/iptables....

Encrypt TripleDES

Problem You want to encrypt some text, using the tripleDES Cipher. Solution Openssl is a beautiful command, that performs many functions. See example....

Generate self-signed cert openssl

Problem You want to generate a self-signed certificate, for use with a web server.This will allow you to communicate with your web server over HTTPS, effectively...

Testing Cipher Strength

Problem You want to be sure that your web site is only serving 128 bits! Solution Use openssl s_client – with specific ciphers – see the example....

SSL Certification Expiry Date Checker

Problem You want to automate checking expiry of SSL (HTTPS) Certificate expiry. Solution The link to the script is displayed in examples. It connects to...

Compare Java Certificate Stores – cacerts

Problem You want to compare two cacerts java certificate stores.Say comparing development server against prod, to ensure they both have same certs stored...

Generate Random Data with dd

Problem You want to generate 512 bytes of random data, using UNIX dd (disk to disk) command. Solution Using /dev/random blocks waiting for truly random...

While For Loops

Problem You want to loop around a number of times and perform an action. Solution Being able to loop around a given number of times, fully utilizes the...

Split output over columns

Problem Ever wanted to produce columns of output, rather than your output spilling off the screen. Solution Useful command for this is paste, see example...

Looping with For and While

Problem You want to loop a number of times in UNIX. Solution Being able to loop around a given number of times, fully utilizes the power of UNIX. See the...

Check var for pattern

Problem You want to check a variable for a given pattern. Solution This is my personal favorite way to check for values in vars. See examples. Example...

Detach proc from shell

Problem When you exit your shell, the processes you’ve kicked off die. Solution If you start a process with nohop (ignore the hup signal), it will...

Binary Calculator Hex

Problem You want to perform some arithmetic with UNIX. Solution The binary calculator, installed with pretty much all version of UNIX, can be used for...

VI Tips

Problem Started using vi probably 13 years ago and ever so often, still learn new tricks with it! 🙂Some of my favorites are: turning on control characters;...

AJAX Gotcha Browser caching

Problem Spent many hours debug my code on elizaclaire.darlingranges.com.I kept wondering why, whenever I updated the code – it did not get reflect...