Tag: unique

Cross-Platform, Java

Generating unique IDs in Java

With the UUID class you can generate unique ids. The identifiers generated by UUID are universally unique identifiers. UUID is the fastest and easiest way to generate a unique ID in Java. import java.util.UUID; .. .. public String generateID(){ return String.valueOf(UUID.randomUUID()); } ..import java.util.UUID; .. .. public String generateID(){ return String.valueOf(UUID.randomUUID()); } ..

Apache, Linux

Retrieve useful information from Apache logs

Common locations where you can find Apache logs are /var/log/apache2 and /var/log/httpd/. You can extract valuable information from your apache logs. Here are some useful examples! Extract unique IP addresses: cat /var/log/apache2/access.log | awk ‘{print $1}’ | sort | uniqcat /var/log/apache2/access.log | awk ‘{print $1}’ | sort | uniq   Extract unique IP addresses with …