Drill two ¼-inch holes through the sides of a half-inch-diameter galvanized metal pipe that is 4 inches long. Position the holes 1 inch down from the top and 1 inch up from the bottom. Repeat the same process on another half-inch-diameter metal pipe that is also 4 inches long.
Place a washer inside the pipe over the first hole and hold it in place with your fingers. Push a quarter-inch-by-3-inch stainless steel wood screw through the outside hole in the side of the pipe, through the washer and into the hole on the other side of the pipe.
Hold the pipe in a vertical position against the middle of the fencepost at chest level. Use an electric drill to drive the screw through the hole in the pipe into the fencepost. Then repeat the Step 2 process on the bottom hole: pushing in the screw and threading it through the washer and into the hole on the other side of the pipe. Drive the screw into the fencepost. The metal washers bend to the shape of the pipe as the screw tightens into the fencepost.
Position the other length of pipe vertically on the gatepost so that it is 1 inch below, in line with and directly underneath the first pipe. Install it on the gatepost in the same manner as you installed the first pipe on the fencepost.
Use a pipe bender to bend the end of a 1-foot long-section of three-eights-inch rebar into a U shape, so that the rebar ultimately has a J shape. Latch the gate by closing it so the two pipes are in alignment. Drop the heavy rebar into the top pipe and through the bottom pipe. Drape the U-shaped end of the rebar over the end of the top pipe. The gate is effectively latched.