Find the equation of a plane given point, parallel line and angle between plane and line 
Find the equation of a plane that crosses point $P(-1,2,1)$, that is parallel to the line $p: x=0,y=-z$ and its angle with line $q: x=y, z=0$ is $\frac{\pi}{4}$.

First lets write those two lines in canonical form.
Lets observe normal vectors of two $p$ planes: $\vec{n_{p_1}}=(1,0,0)$ and  $\vec{n_{p_2}}=(0,1,1)$. Their cross product will give direction vector of $p$. So, $\vec{n_{p_1}}\times\vec{n_{p_2}}=(0,-1,1).$ Lets take a point now thats on $p$ and satisfies both planes of $p$, e.g.: $A(0,2,-2)$. Now we have the canonical form of $p$: $\frac{x-0}{0}=\frac{y-2}{-1}=\frac{z+2}{1}$.
Same for $q$: $\vec{n_{q_1}}=(1,-1,0)$ and  $\vec{n_{q_2}}=(0,0,1)$ and their cross product: $\vec{n_{q_1}}\times\vec{n_{q_2}}=(-1,-1,0).$ Lets take a point that satisfies both planes of $q$, e.g.: $B(1,1,0)$. Now we have the canonical form for $q$: $\frac{x-1}{-1}\frac{y-1}{-1}\frac{z-0}{0}$.
$\sin\alpha=\frac{\vec{n_\pi}\vec{q}}{|\vec{n_\pi}||\vec{q}|}$ where $\vec{n_\pi}$ is normal to the plane we're looking for.     $\alpha=\frac{\pi}{4}$ so $\frac{\vec{n_\pi}\vec{q}}{|\vec{n_\pi}||\vec{q}|}=\frac{\sqrt{2}}{2}$. If $(k,l,m)$ is normal vector to the plane we're looking for then it's perpendicular to the direction vector of $p$ because we know that the line and plane are parallel:  $\vec{p}(k,l,m)=0$ -> $(0,-1,1)(k,l,m)=0$ -> $-l+m=0$ -> $m=l$. Now I have another equation from the angle condition.
$\frac{(k,l,m)(-1,-1,0)}{\sqrt{k^2+l^2+m^2}\sqrt{2}}=\frac{\sqrt{2}}{2}$.
This is where I'm stuck. If I somehow manage to get normal vector, I have the point $P(-1,2,1)$ and with the normal vector I have the equation of my plane. What should I do next? Any tips would be appreciated!
 A: Let $\hat{n} = (n_1,n_2,n_3)$ be the normal vector of the plane with $|\hat{n}| = 1$ and let the equation of the plane be $$n_1x+ n_2y+n_3z+D=0$$
for some $D\in\Bbb{R}$.
Line $p$ is the set of points $\alpha(0,1,-1)$ for $\alpha\in\Bbb{R}$. It is parallel to the plane so $(0,1,-1) \perp \hat{n}$, which implies
$$0 = (0,1,-1) \cdot \hat{n} = n_2-n_3.$$
On the other hand, line $q$ is the set of points $\alpha(1,1,0)$ for $\alpha\in\Bbb{R}$. It punctures the plane at an angle $\frac\pi4$ which means that the angle of $(1,1,0)$ and $\hat{n}$ is the complementary angle which is again $\frac\pi4$. Therefore
$$\frac{\sqrt{2}}2 = \cos \measuredangle((1,1,0),\hat{n}) = \frac{(1,1,0)\cdot \hat{n}}{|(1,1,0)|\cdot|\hat{n}|} = \frac{n_1+n_2}{\sqrt2}$$
so $n_1+n_2=1$. Now combine equations
$$\begin{cases}
n_1+n_2=1\\
n_2-n_3=0\\
n_1^2+n_2^2+n_3^2=0\\
\end{cases}$$
to obtain two solutions for $\hat{n}$:
$$\hat{n} = \frac13(1,2,2), \quad \hat{n}=(1,0,0).$$
Finally use that $P = (-1,2,1)$ is contained in the plane so $(-1,2,1)\cdot\hat{n}+D = 0$ which gives you $D$. The resulting two planes are
$$x+2y+2x-5=0, \quad x+1=0.$$
