Find a linear Lie algebra isomorphic to the nonabelian two dimensional algebra with basis $x,y$ such that $[x,y]=x$. (Hint: Look at the adjoint representation.)
$\DeclareMathOperator{\ad}{ad}$The adjoint representation takes $a\in L$ to $\ad a$, which is the map from $L$ to itself taking $b\mapsto [a,b]$. So I'm looking at $\ad x$, which is represented by the matrix $$\phi(x)=\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}$$ (since $[x,x]=0, [x,y]=x$). On the other hand, $\ad y$ is represented by $$\phi(y)=\begin{pmatrix} -1 & 0 \\ 0 & 0 \end{pmatrix}$$ (since $[y,x]=-x, [y,y]=0$). So the element in the isomorphic linear Lie algebra corresponding to $z=cx+dy$ is $$\phi(z)=\begin{pmatrix} -d & c \\ 0 & 0 \end{pmatrix}.$$
I can verify by hand that $\phi([z_1,z_2])=[\phi(z_1),\phi(z_2)]$ by using $z_1=ax+by, z_2=cx+dy$ and expanding. (Is there an easier way to see?) Do I need to check that the linear algebra satisfies the Lie algebra axioms?
If $\def\g{\mathfrak{g}}\g$ is a Lie algebra and $\def\End{\mathfrak{end}}\End(\g)$ is its Lie algebra of $k$-linear endomorphisms, there is a map $\def\ad{\operatorname{ad}}\ad:\g\to\End(\g)$ such that $\ad(x)(y)=[x,y]$.
You can immediately check that $\ad$ is a $k$-linear map;
you can check that $\ad$ is a morphism of Lie algebras: indeed, the Jacobi identity for $\g$ says precisely this, once you arrange it properly; and, finally
the kernel of the map $\ad$ is precisely the center of $\g$.
Finally, you can check two additional facts:
The image of a morphism of Lie algebras $f:\mathfrak a\to\mathfrak b$ is always a Lie subalgebra of its codomain.
The center of your $2$-dimensional algebra $\mathfrak s$ is trivial.
Putting all this things together, we get that the map $\ad:\mathfrak s\to\End(\mathfrak s)$ is an injective morphism of Lie algebras, so an isomorphism of Lie algebras from its domain to its image. Since its image is obviously a linear Lie algebra, we get what you want.