  The outflows from gamma ray bursts, active galactic nuclei and relativistic
jets in general interact with the surrounding media through collisionless
shocks. With three dimensional relativistic particle-in-cell simulations we
investigate such shocks. The results from these experiments show that
small--scale magnetic filaments with strengths of up to percents of
equipartition are generated and that electrons are accelerated to power law
distributions N(E)~E^{-p} in the vicinity of the filaments through a new
acceleration mechanism. The acceleration is locally confined, instantaneous and
differs from recursive acceleration processes such as Fermi acceleration. We
find that the proposed acceleration mechanism competes with thermalization and
becomes important at high Lorentz factors.
