Not today...

Filed under cli...

comments

Snippet

direnv

I recently discovered the direnv project. Which helped me a lot for setting up my development environments. I will share a bit of things I use in my daily basis. Python projects This is well documented but here is what I use in python projects to set up a default virtualenv. layout python That’s it! It sets up a virtualenv in your .direnv directory, and load the updated PATH. Golang projects This one is a bit trickier. Read More...

Tagged bash , cli , dev

comments

OS

Bash Shortcuts

Here is just a small reminder of common bash shortcuts for everyday use: Ctrl + A Go to the beginning of the line you are currently typing on Ctrl + E Go to the end of the line you are currently typing on Ctrl + L Clears the Screen, similar to the clear command Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line. Read More...

Tagged bash , cli

comments

Snippet

Pytest command line

I have recently dug into pytest documentation, and moreover into the command line arguments and I finally found a better workflow for running tests while I develop. Here is the command I run when I just made some devs: py.test -xvvvs --tb=line --pdb -x will stop execution on first failue, useful when debugging tests in order of appearance (recommended) -vvv will display current test path (reuasable in py.test), the path will avoid to rerun all the previous tests before going to the one you are currently working on. Read More...

Tagged tests , python , cli

comments

Ansible

I have a home media server, and I spent a lot of time configuring, testing and installing on it. But I was never really satisfied by the way I had to perform the installation (which happens way too often). And I recently discovered Ansible, which is a tool for doing a lot of stuff with a server (configuration, run repetitive command, installation) over ssh. I really loved experienced with it, it does not require a lot of dependencies on the targeted server, and can be easily run. Read More...

Tagged admin , cli

comments

Snippet

Bash Expansion

A small post just to share a useful bashism the Brace Expansion. It is really simple to make it works: for i in {1..50} do echo "Hello World $i" done It will print fifty “Hello World”. Ok it seems cool but not amazing? Ok, now the second feature echo something/{foo,bar} > something/foo something/bar Still not amazed, ok now type this one: cp some_file{,.old} It will copy your file adding a . Read More...

Tagged bash , cli

comments

tuto

Curl for REST

It has been a long time since the last post. But today, I will just show two tools I use for debugging my REST APIs. First one is the well known curl and the second one is jq. One important feature of curl is its hability to load external files for datas with @ before file name: curl -X POST -H "Content-Type: application/json" -d @filepath Then you can remove the progress bar by adding -s in the options Read More...

Tagged admin , cli , bash