My work is being used without acknowledgement So I was helping a friend of mine out with his master thesis, as he had no idea about a specific topic in which I had a few years of industrial experience. However, he had no idea about what I was talking about, so I coded a lot of his solutions for him (this is in the field of signal processing, so the programming part is quite important). 

Now I find out that he has directly used my code in his thesis and plans publications with this code, all without acknowledging or crediting my contribution in any way. Talking to him yielded no results, as he is convinced that he is right, and since he edited and rewrote my code he doesn't need to acknowledge me. Is this ethical? Is there anything I can/should do?
If as you report, it is a clear ethical breach. It should be mentioned to his professor. But you will want proof of the case, such as your old codes or emails via which you corresponded. 

The reasons for not doing this are largely political, if you need a relationship with this prof (or the student) and think this will jeopardize it. 

But if  you want acknowledgement only, perhaps telling the other student that you plans to make a class for plagiarism with his professor may be enough to get him to behave better - at least this time. You could even send him the paragraph of acknowledgement that you would expect him to include. 

However, be careful here to avoid any claim that might be construed as slander. In making the case talk/write about what you contributed without characterizing his behavior. Just the facts, not accusations. If he refuses to do the right thing you could, perhaps, simultaneously send a case file to him and the professor.