Here's one possibility using the titlesec and xhfill packages:
\documentclass{article}
\usepackage[explicit]{titlesec}
\usepackage{xhfill}
\usepackage{lipsum}% just to generate text for the example
\titleformat{\section}
{\normalfont\Large\bfseries}{}{0em}{#1~\xrfill[0.3ex]{1.5pt}}
\begin{document}
\section{Education}
\lipsum[4]
\end{document}

And the other style:
\documentclass{article}
\usepackage[explicit]{titlesec}
\usepackage{xhfill}
\usepackage{lipsum}% just to generate text for the example
\titleformat{\section}
{\normalfont\Large\bfseries\filcenter}{}{0em}{\xrfill[0.3ex]{1.5pt}~#1~\xrfill[0.3ex]{1.5pt}}
\begin{document}
\section{Education}
\lipsum[4]
\end{document}

If titles are long, then one can use a minipage or variable width (through the varwidth) package, to produce something like:
\documentclass{article}
\usepackage[explicit]{titlesec}
\usepackage{xhfill}
\usepackage{varwidth}
\usepackage{lipsum}% just to generate text for the example
\newlength\mylen
\titleformat{\section}
{\normalfont\Large\bfseries}{}{0em}
{\begin{varwidth}{.7\linewidth}\raggedright#1\end{varwidth}~\xrfill[0.3ex]{1.5pt}}
\begin{document}
\section{Education}
\lipsum[4]
\section{Education and other extra activities}
\lipsum[4]
\end{document}

Something analogous can be done for the other style:
\documentclass{article}
\usepackage[explicit]{titlesec}
\usepackage{xhfill}
\usepackage{varwidth}
\usepackage{lipsum}% just to generate text for the example
\newlength\mylen
\titleformat{\section}
{\normalfont\Large\bfseries\filcenter}{}{0em}
{\xrfill[0.3ex]{1.5pt}~\begin{varwidth}{.75\linewidth}\centering#1\end{varwidth}~\xrfill[0.3ex]{1.5pt}}
\begin{document}
\section{Education}
\lipsum[4]
\section{Education and some other extra~activities}
\lipsum[4]
\end{document}

If both styles are to be applied in the same document, define commands for each style ans use them, as many times as required, to switch where needed:
\documentclass{article}
\usepackage[explicit]{titlesec}
\usepackage{xhfill}
\usepackage{varwidth}
\usepackage{lipsum}% just to generate text for the example
\newcommand\Ruled{%
\titleformat{\section}
{\normalfont\Large\bfseries}{}{0em}
{\begin{varwidth}{.7\linewidth}\raggedright##1\end{varwidth}~\xrfill[0.3ex]{1.5pt}}
}
\newcommand\Centered{%
\titleformat{\section}
{\normalfont\Large\bfseries\filcenter}{}{0em}
{\xrfill[0.3ex]{1.5pt}~\begin{varwidth}{.75\linewidth}\centering##1\end{varwidth}~\xrfill[0.3ex]{1.5pt}}
}
\begin{document}
\Ruled
\section{Education}
\lipsum[4]
\Centered
\section{Education and some other extra~activities}
\lipsum[4]
\end{document}

Adjust the settings according to your needs. I didn't use small capitals since some fonts don't support bold-faced small caps.
\hlinefillcan help you, in second — particular\leaders. – Eddy_Em Apr 08 '13 at 19:56mdframedpackage http://www.ctan.org/pkg/mdframed – karathan Apr 08 '13 at 20:07