10 posts in total

Bash

Posts tagged

Grep with context

by Etienne Marais

Whether you are debugging an issue or monitoring a workload, log files are invaluable to your efforts. A normal strategy to look for a specific error or to find a certain piece of output is to cat <file> | grep something. This will output the lines of text that matches your ...

How to recover from a git reset --hard

by Etienne Marais

Today I was tired after writing pretty complex code without getting up for a break. I added some Log::info statements in a file that I didn't want to commit and I hopped over to the console to reset the file but instead I did I swore pretty loudly :D Can I even recover after res ...

How to check the timezone and update it

by Etienne Marais

When you spin up a new virtual machine on the cloud, you might be confused when you try run a cronjob at a certain time and it doesn't. You might want to back up some data or to rotate logs but it runs later than you expected. Check the timezone details on your ubuntu instance: ...

How to post a file and form data using curl

by Etienne Marais

There will be times where you need to test an API file upload or just play around with sending data. curl supports this very well by making a Content-Type: multipart/form-data request along with you can send data and also the contents of a file. curl is used in command lines or ...

How to see what curl is sending without a server

by Etienne Marais

Being part of an awesome developer community is probably the one thing that keeps me learning more and more every day. I am thankful for being part of ZATech on Slack and I get to learn and see a great deal of cool things. nc Today I saw how to see what data gets sent via curl wi ...