How Do You Troubleshoot Weebly Blog Editor Not Updating Posts after You Make Changes to Them?

Problem scenario
You are using Weebly website editor. You make changes to a post, then click "Update."  You then click "Publish."  But the changes to your website are not updating.  What do you do?

Solution
Log out of the Weebly editor.  Close all of the instances of the web browser you were using.  Then reopen the web browser.  Clear the cache, history and cookies.  Now the problem should be gone.  Go back into the Weebly website editor and update your website as normal.

How Do You Troubleshoot the Error “VpcLimitExceeded” When Running an Ansible Playbook in AWS?

Problem scenario
You are running an Ansible playbook in AWS, and you get this message:

TASK [metron-test:  Create virtual private cloud] ******************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "VpcLimitExceeded: The maximum number of VPCs has been reached."}
        to retry, use: --limit @/usr/bin/metron/metron-deployment/amazon-ec2/playbook.retry

Solution
You must have an AWS account with a special maximum of VPCs.  The default number of VPCs one can create is five according to AWS documentation.  While we know you can create more than five without a special request, we have found this limit to be enforced on occasion.  

If you are willing to take the risk of being billed for numerous EC-2 servers, we recommend you go to this link and request your account have a new limit of VPCs in west-2.  If you are trying to deploy Apache Metron, you will want need 10 EC-2 instances for a typical configuration.  If you want the region to support servers beyond this purpose, you may need a limit value greater than 10.  

​The form should be filled out like this:

This request may take a 30 minutes or so.  Depending on various factors (e.g., how busy Amazon is and time for the changes to take effect), the time you wait will vary.

How Do You Connect to a Specific Database in Postgres Using PHP?

Problem scenario
Using PHP you want to connect to a specific database to run SQL queries.  How do you do this?

Solution
Assuming you have installed PHP and Postgres on the same Ubuntu Linux server, install the php-pgsql package.  Follow this link if you need assistance.  

1.  Create a file like this named contint.php:

<?php
   $host        = "host=127.0.0.1";
   $port        = "port=5432";
   $dbname      = "dbname=contintdb";
   $credentials = 'user=jdoe password=abcd1234';

   $db = pg_connect( "$host $port $dbname $credentials"  );

   pg_query("insert into contintTable values(511);");
?>

2.  Change the $dbname variable assignment in the code below.  This is how you specify a database. You will need to change the credentials and the pg_query code too. Change the IP address if the Postgres server is on a different server from the server with PHP.

​3.  Run it with this command: php contint.php

How Do You Create a Web Page That Issues Customized SQL Commands to a Database Behind-The-Scenes?

Problem scenario
You want a web page with a text field to enter a single line of SQL code.  You want this code (as opposed to some fixed, pre-written code) to execute.  How do you do this?

Solution
This is more dangerous because SQL injection attacks are a serious problem.  This link is how to have a PHP page execute fixed code.   This solution below is not a best practice but designed for illustrative purposes.

This solution below is a rudimentary example and nothing more.  It assumes you have installed LAPP (Linux, Apache, PHP and Postgres) and the PHP plugin for Postgres; for directions on deploying LAPP using Ubuntu see this link.  The solution below assumes that the database service (for Ubuntu, the command would be sudo service postgresql start) and web service are running (for Ubuntu, the command would be sudo service apache2 start).  It also assumes you have created a Postgres role (e.g., a database user) for which you have a username and password.

This web page will challenge the user for credentials. On this very login page, you can enter SQL code.  When you click submit, the code will run.

1.  Create a file named page1.php in /var/www/html.  Have this as the content:

<html>
<body>

<form action="page2.php" method="post">
UserName: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
SQLquery: <input type="text" name="sqlQuery"<br>
<input type="submit">
</form>

</body>
</html>

2.  In /var/www/html/ create a second file named page2.php.  Have this as the content:

<html>
<body>

Username entered: <?php echo $_POST["username"]; ?><br>

<?php $part1 = $_POST["username"]; ?>
<?php $part2 = $_POST["password"]; ?>
<?php $part3 = $_POST["sqlQuery"]; ?>
<?php $comp = 'user='.$part1.' password='.$part2 ; ?>

</body>
</html>

<?php // echo "Hello world!";
   $host        = "host=127.0.0.1"; 
   $port        = "port=5432";
   $dbname      = "dbname=cooldb";
   $credentials = $comp;

   $db = pg_connect( "$host $port $dbname $credentials"  );
   pg_query("$part3");

?> //end of file

3.  Browse to page1.php (e.g., http://x.x.x.x/page1.php where x.x.x.x is the external IP address of the LAPP server).  Enter the credentials and SQL statement.  Please note that you will not see the results of the SQL command with this example.  You can see the results by accessing the database directly (e.g., through a SQL front-end GUI application).

A Long List of Computer Forensics Books

5 Important Facts You Need to Know About Computer Forensics by Trisha Halfacre
The Art of Memory Forensics: Detecting Malware and Threats in Windows, Linux, and Mac Memory by Michael Hale Ligh, Andrew Case, Jamie Levy and  AAron Walters
The Basics of Digital Forensics, Second Edition: The Primer for Getting Started in Digital Forensics by John Sammons
Computer Forensics by Marie-Helen Maras
Computer Forensics and Cyber Crime: An Introduction (3rd Edition) by Marjie T. Britz
Computer Forensics and Digital Evidence by Margherita Lori
Computer Forensics and Digital Investigation with EnCase Forensic v7 by Suzanne Widup
Computer Forensic Bible: The Ultimate Guide to Computer Forensic and Cyber Crime by Robert Alleyne
Computer Forensics: An Essential Guide for Accountants, Lawyers, and Managers by Michael Sheetz
Computer Forensics: Evidence Collection and Management  by Robert C. Newman
Computer Forensics For Dummies by Linda Volonino and Reynaldo Anzaldua
Computer Forensics: Hard Disk and Operating Systems (EC-Council Press) by EC-Council
Computer Forensics: Incident Response Essentials by Warren G. Kruse II and Jay G. Heiser
Computer Forensics InfoSec Pro Guide by David Cowen
Computer Forensics: Investigation Procedures and Response (CHFI) by EC-Council
Computer Forensics: Investigating Data and Image Files (CHFI) by EC-Council
Computer Forensics: Investigating File and Operating Systems, Wireless Networks, and Storage (CHFI), 2nd Edition (Computer Hacking Forensic Investigator) by EC-Council
Computer Forensics: Investigating Network Intrusions and Cybercrime (CHFI), 2nd Edition by EC-Council
Computer Forensics JumpStart by Michael G. Solomon, K. Rudolph, Ed Tittel, Neil Broom and Diane Barrett
Computer Forensics: Investigating Wireless Networks and Devices (EC-Council Press) by EC-Council
Computer Forensics: Principles and Practices by Linda Volonino, Reynaldo Anzaldua and Jana Godwin
Computer Forensics with FTK by Fernando Carbone
Computer Fraud Casebook: The Bytes that Bite by Joseph T. Wells   
Computer Incident Response and Forensics Team Management: Conducting a Successful Incident Response by Leighton Johnson
Computer Security Fundamentals (3rd Edition) by William (Chuck) Easttom II
Cybercrime and Digital Forensics: An Introduction by Thomas J Holt, Adam M Bossler and Kathryn Seigfried-Spellar
Data Hiding Techniques in Windows OS: A Practical Approach to Investigation and Defense by Nihad Ahmad Hassan and Rami Hijazi
Digital Archaeology: The Art and Science of Digital Forensics by Michael W Graves
Digital Evidence and Computer Crime: Forensic Science, Computers and the Internet, 3rd Edition by Eoghan Casey
Digital Forensics with Open Source Tools by Cory Altheide and Harlan Carvey
Digital Forensics Workbook: Hands-on Activities in Digital Forensics by Michael K Robinson
EnCase Computer Forensics -- The Official EnCE: EnCase Certified Examiner Study Guide by Steve Bunting
File System Forensic Analysis by Brian Carrier
Forensic Examination of Windows-Supported File Systems by Doug Elrick
Guide to Computer Forensics and Investigations (with DVD) by Bill Nelson, Amelia Phillips  and Christopher Steuart
Hiding Behind the Keyboard: Uncovering Covert Communication Methods with Forensic Analysis by Brett Shavers and John Bair
How to start a Computer Forensics Business: A Small Business Success Guide by Ron McFarland  
Incident Response & Computer Forensics, Third Edition by Jason T. Luttgens, Matthew Pepe  and Kevin Mandia
Integrating Python with Leading Computer Forensics Platforms by Chet Hosmer
Introduction to Security and Network Forensics by William J. Buchanan
Lab Manual for Nelson/Phillips/Steuart's Guide to Computer Forensics and Investigations by Andrew Blitz
Learning Android Forensics by Rohit Tamma and Donnie Tindall
Learning iOS Forensics by Mattia Epifani and Pasquale Stirparo
Learning Python for Forensics by Preston Miller and Chapin Bryce
Linux Forensics by Philip Polstra
LM Guide to Computer Forensics & Investigations - Lab Manual by Course Technology
Malware Analyst's Cookbook: Tools and Techniques for Fighting Malicious Code by Michael Ligh, Steven Adair, Blake Hartstein and Matthew Richard
Malware Forensics Field Guide for Windows Systems: Digital Forensics Field Guides by Cameron H. Malin, Eoghan Casey and James M. Aquilina
Mastering Mobile Forensics by Soufiane Tahiri
Mastering Python Forensics by Dr. Michael Spreitzenbarth and Dr. Johann Uhrmann
Mastering Windows Network Forensics and Investigation  by Steven Anson, Steve Bunting, Ryan Johnson and Scott Pearson
Mechanisms: New Media and the Forensic Imagination (MIT Press) by Matthew G. Kirschenbaum
Network Forensics: Tracking Hackers through Cyberspace by Sherri Davidoff and Jonathan Ham 
Operating System Forensics by Ric Messier
Practical Forensic Imaging: Securing Digital Evidence with Linux Tools by Bruce Nikkel
A Practical Guide to Computer Forensics Investigations by Darren R. Hayes
Practical Windows Forensics by Ayman Shaaban and Konstantin Sapronov
Principles of Computer Security, Fourth Edition (Official Comptia Guide) by Wm. Arthur Conklin, Greg White, Chuck Cothren, Roger Davis and Dwayne Williams
Privacy Protection and Computer Forensics, Second Edition by Michael A. Caloyannides
Security in Computing (5th Edition) by Charles P. Pfleeger, Shari Lawrence Pfleeger and Jonathan Margulies
System Forensics, Investigation, And Response (Information Systems Security & Assurance) by John R. Vacca and K Rudolph
Violent Python: A Cookbook for Hackers, Forensic Analysts, Penetration Testers and Security Engineers by TJ O'Connor
Windows Forensic Analysis Toolkit: Advanced Analysis Techniques for Windows 8 by Harlan Carvey
Windows Forensics by Dr. Philip Polstra
Windows Registry Forensics, Second Edition: Advanced Digital Forensic Analysis of the Windows Registry by Harlan Carvey
X-Ways Forensics Practitioner's Guide by Brett Shavers and Eric Zimmerman   

How Can You Accept User Input with PHP and Use It in a SQL Command?

Problem scenario
You want to read in user input via a web page.  You then want that user input to participate in an invocation of a SQL command. How do you get user input to be a variable in the construction of a SQL command that is automatically executed when a web-page button is clicked?

Solution
Warning
This does not prevent against SQL injection attacks. This is a proof-of-concept or learning article. It is not meant to be used in production. SQL injection attacks are serious.

Procedures

This example uses the LAPP stack (Linux, Apache, Postgres, and PHP).  It assumes that you have installed the correct package for PHP to integrate with Postgresql; to find out how to do this, see this link.  There are two PHP files that are used.  A SQL command is composed dynamically.  This assumes Apache is running with a standard /var/www/html/ directory for browser-accessible web pages.

#1 Create the website page to accept user input.  We suggest you name this file good.php.  Unless you have a non-standard directory for files for your Apache web server, in /var/www/html/ place this file (e.g., good.php):

<html>
<body>

<form action="good2.php" method="post">
DatabaseName: <input type="text" name="databasename"><br>
Posterity: <input type="text" name="posterity"><br>
<input type="submit">
</form>

</body>
</html>

#2  Create the website page that users will see and behind-the-scenes perform the SQL action. You may or may not need to modify the $host or $port assignments.  On a typical LAPP deployment, you would not need to modify them.  You will need to modify the $dbname and $credentials variable assignments below.  The $credentials must have the privilege to log into the database.

Modify the inside of the quotes in the pg_query stanza to perform the SQL command you want.  If you do not change the SQL comand, this .php file will create a database with a name that the user inputted when he/she goes to the .php web page in step #1.  This file below (with its first line being <html>) must be called good2.php and be in the same directory as the file in step #1.

<html>
<body>

The table name will be <?php echo $_POST["databasename"]; ?><br>
Posterity: <?php echo $_POST["posterity"]; ?>
<?php $newvar = $_POST["databasename"]; ?>
<!--- The posterity variable is if you want to build on this example. --->

</body>
</html>

<?php // echo "Hello world!";
   $host        = "host=127.0.0.1"; 
   $port        = "port=5432";
   $dbname      = "dbname=fundb";
   $credentials = "user=jdoe password=neatPassword";

   $db = pg_connect( "$host $port $dbname $credentials"  );
   pg_query("CREATE DATABASE $newvar");

?>  //end of file

WARNING: The above content as a PHP file is for educational purposes.  For security reasons you may not want to place sensitive credentials hard-coded in a file that is accessible from the internet.  

3.  Browse to the .php file created in step #1 with a web browser (e.g., go to http://x.x.x.x/good.php).  A user can enter a name of database and click the "Submit" button.  You are done.  Please do not expect the web page to reflect success or failure.  This is a rudimentary example.

For executing PHP back-end scripts with no web page or front-end component, see this link.  For seeing if your SQL commands worked, connect to the database directly and bypass PHP.  If you need directions for configuring HeidiSQL, see this link.

A List of E-Discovery Books

Cloud Computing and Electronic Discovery (Wiley CIO) by James P. Martin and Harry Cendrowski
E-Discovery and Data Privacy: A Practical Guide by Catrien Noorda and Stefan Hanloser
E-Discovery and the Federal Rules of Civil Procedure: A Pocket Guide by Bradley Schaufenbuel
E-discovery: Creating and Managing an Enterprisewide Program - A Technical Guide to Digital Investigation and Litigation Support by Karen A. Schuler
e-Discovery: Current Trends and Cases by Ralph C. Losey
e-Discovery For Dummies by Linda Volonino  and Ian Redpath
E-Discovery: An Introduction to Digital Evidence (with DVD) by Amelia Phillips, Ronald Godfrey, Christopher Steuart  and Christine Brown
E-Discovery Nuts and Bolts: The Essentials of E-Discovery That Every Lawyer Needs to Know by Anthony Johnson LL.M
An Introduction to e-Discovery: New Cases, Ideas, and Techniques by Ralph C. Losey
Litigation Practice: E-Discovery and Technology by Thomas F. Goldman
Techno Security's Guide to E-Discovery and Digital Forensics: A Comprehensive Handbook by Jack Wiles
Transforming Infoglut! A Pragmatic Strategy for Oracle Enterprise Content Management (Oracle Press) by Andy MacMillan and Brian Huff

How Do You Get a Web Page to Invoke a Postgres Command (e.g., for a RESTful API)?

Problem scenario
You want a REST call to invoke some SQL code on a Postgres database.  How do you do this?

Solution
Install Apache web server, PHP, and the PHP-pgsql package on your Postgresql database server.  This example assumes you have PHP, Apache web server, Postgres, and the php-pgsql package installed on your server.  Assuming the web server is running and the default directory for web pages is still /var/www/html/ do the following.

#1
Create a .php file like this in your /var/www/html/ directory:

<html>
<body>

HELLO!

</body>
</html>

<?php
   $host        = "host=127.0.0.1";
   $port        = "port=5432";
   $dbname      = "dbname=goodone";
   $credentials = "user=jdoe password=contintpass";

   $db = pg_connect( "$host $port $dbname $credentials"  );
   pg_query("DROP DATABASE foobar");

?>

#2
You will have to change the dbname, user, and password in the PHP code above.  The user must be a role that has the LOGIN privilege with the Postgresql instance.  

Assuming you call the file above contint.php, browse to the web page (where x.x.x.x is the external IP address of the Postgres server):  http://x.x.x.x/contint.php 

Browsing to the above web page (contint.php with the code above) would invoke the SQL code in the pg_query parentheses.  In the example above, it would drop the database named "foobar."

This article above is for web-based invocation (e.g., RESTful commands).  To have PHP code invoke SQL commands in a Postgresql database without a web server, read this link.

A List of Squid (the Web Proxy) Books

CentOS 6.2 Configuring Squid By Example (CentOS 6 By Example Book 5) by Mike Dittmeier
Squid: The Definitive Guide by Duane Wessels
Squid Proxy Server 3.1: Beginner's Guide by Kulbir Saini
Web Proxy Cache Replacement Strategies: Simulation, Implementation, and Performance Evaluation (SpringerBriefs in Computer Science) by Hala ElAarag