If you want to measure the spin projection of a spin-$\tfrac12$ particle along a particular direction $\vec n$ in space (where $\|\vec n\|^2=1$), the most convenient way is to define the Pauli matrices in some specific coordinate system - so, conventionally,
$$
\sigma_x=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad
\sigma_y=\begin{pmatrix}0&-i\\i&0\end{pmatrix}\quad\text{and}\quad
\sigma_z=\begin{pmatrix}1&0\\0&-1\end{pmatrix},
$$
normalized to $[\sigma_i,\sigma_j]=2i\varepsilon_{ijk}\sigma_k$, in the $\sigma_z$ eigenbasis - and to take the dot product of your vector $\vec n=(n_x,n_y,n_z)$ with the Pauli matrix vector $\vec\sigma=(\sigma_x,\sigma_y,\sigma_z)$ (i.e. a vector whose components are operators, same as momentum) to get
$$
\sigma_\vec n=\vec n\cdot\vec\sigma=n_x\sigma_x+n_y\sigma_y+n_z\sigma_z=\begin{pmatrix}
n_z&n_x-in_y\\n_x+in_y & -n_z
\end{pmatrix}.
$$
This operator represents the angular momentum projection along the $\vec n$ axis. It has two eigenvectors, which I'll denote $|\vec n\rangle$ and $|-\vec n\rangle$, with well defined positive and negative spin along this axis, respectively.
If your vector has spherical coordinates $(\theta, \phi)$, then these eigenvectors will have those exact same coordinates, and its antipode, on the Bloch sphere. In the $\sigma_z$ basis they can be represented as
$$|\vec n\rangle=\cos(\theta/2)|\uparrow\rangle+e^{i\phi}\sin(\theta/2)|\downarrow\rangle$$
and its orthogonal complement, where $\vec n=(\sin(\theta)\cos(\phi),\sin(\theta)\sin(\phi),\cos(\phi))$. It is a good exercise to prove that these are indeed eigenvectors.
In terms of the eigenvectors, then, the projectors - which give the probabilities a measurement will yield the $+\vec n$ or $-\vec n$ directions, are $|\vec n\rangle\langle\vec n|$ and $|-\vec n\rangle\langle-\vec n|$, respectively.
If this looks a bit complicated, don't worry too much and just plunge into the calculations. If $\vec n$ is simple - like your 45° polarizations - so will your operators, projectors and eigenvectors.
I'm less clear about what you're really asking in your second question. If you're choosing measurements randomly, you need to be really careful about what you mean. If for each run I randomly choose the measurement axis to be $x$ or $z$, then the corresponding operator will be $\sigma_x$ or $\sigma_z$.
In my ledger I will (or at least I can, in principle) record the measurement axis and the outcome. The probabilities for each outcome will be the expectation values of the corresponding projectors: getting $+$ on a $z$ measurement has probability $\langle\psi|\uparrow\rangle\langle\uparrow{}|\psi\rangle$, getting $-$ on an $x$ measurement has probability $\langle\psi|-\rangle\langle-|\psi\rangle$, and so on.
The situation does change, or course, if you start "forgetting" some of those values. You might, for example, point your measurement along the positive $x$ or positive $z$ axes (randomly, with probabilities $p_x$ and $p_z$), but only record the outcome. In this case you can only ask for the probability of getting a $+$ or a $-$ outcome. The first, for example, is given by
$$
p(+)=p_z\langle\psi|\uparrow\rangle\langle\uparrow|\psi\rangle+p_x\langle\psi|+\rangle\langle+|\psi\rangle.
$$
You can then consider a single measurement operator by factorizing the state as
$$
p(+)=\langle\psi|\left(\vphantom{\sum}p_z|\uparrow\rangle\langle\uparrow|+p_x|+\rangle\langle+|\right)|\psi\rangle
=\langle\psi|\hat P|\psi\rangle.
$$
However, $\hat P$ is not a well-behaved measurement projector, as it does not obey $\hat P^2=\hat P$. This can meaningfully be used to describe, for example, imperfect measurements, but I would advise you to leave such matters alone for now.