• ngrok
    Linux

    How to use ngrok to test telegram api locally?

    The easiest way to test the telegram api integration is through the webhook return. But developing locally, we have no way of testing this return, unless we had a valid IP, or deploying the application and testing remotely, right? It would be, if there was no ngrok The easiest way to install it is via snap (for more options visit the website) With ngrok installed, type the command (substitute the 80 if it’s not your default web port) If everything goes well, the screen above should open in your terminal. Notice the forwarding line, this is the address you should point the telegram webhook to, as it refers to your…

  • json
    Ubuntu,  Uncategorized

    Displaying json output in linux terminal

    Many times when I’m testing an api, I like to go into chrome, copy the output to CURL, and use the terminal to see what that API will return. To copy curl, just follow the following gif steps In order not to have to type the input data repeatedly in chrome, we can play curl in the terminal, and run it concatenating in jq (install it here) So when running curl in the terminal, include the jq at the end of the command, like this To transform

  • git

    Using git patch

    Sometimes in the rush of the day, it’s much easier to share code with other devs without having to create a commit, push and pull, simply because that code will not make to the repository. In this case, the patch comes at hand. Creating the patch In this way, a file will be generated, with the .patch extension such as file.patch Voilà

  • Api,  Postman

    Calling an Api inside Postman

    For a recent test of a system, I had to use a different CNPJ (Brazilian company unique identifier) for each postman call for each registration, so as not to conflict with what had already been registered in the database. Of course I could have deleted the data on every call, but I wanted to do something different. In the tutorial we did on scrapping, I taught how to get the data from a common API, so I had, in a sqlite, 3000 records, which could be used. The basic idea would be, when you click send (at 1), it will already bring up the fetched_cnpj variable, at 2, filled in)…

  • git

    How to change the parent branch in git

    Imagine the scenario, you’ve created a branch from master, made all the changes you need, and find that instead of deploying those changes right away, you’ll need to push them to a server other than production. That is, you would need this branch to have its origin in another branch, maybe the develop branch ? The process is very simple and straightforward. imagine the situation. You are on master (git checkout master) and you create a branch, based on it (git checkout -b new-branch). Add the files, do your job and commit. If you’re going to see it in a visual program, like gitk you’ll see that its parent is…

  • Uncategorized

    How to install ffmpeg on a Amazon Linux AMI

    I recently had the need to create video thumbnails in a project, and to generate them I used the good old ffmpeg . No tutorial worked properly for installation on an Amazon EC2 instance, and that was the only way I could achieve that. This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters mkdir -v -p /usr/local/bin/ffmpeg cd /usr/local/bin/ffmpeg wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-i686-static.tar.xz tar -v -xf ffmpeg-release-i686-static.tar.xz --strip-components=1 rm -v -f ffmpeg-release-i686-static.tar.xz ln -snf /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg ln -snf /usr/local/bin/ffmpeg/ffpropbe /usr/bin/ffpropbe view raw…

  • Uncategorized

    Changing Laravel monolog timezone

    I recently worked on a project where laravel logs were being uploaded to amazon cloudwatch . The problem was that the server time was set to UTC (which is correct), but laravel was recording the logs using the timestamp that was in the settings (which for me is incorrect, I have seen several places complaining about this approach) . Well, to avoid having to rewrite the Log class, I changed it directly within the app/Providers/AppServiceProvider.php, changing the monolog timezone, as shown in the gist below. Don’t forget to `php artisan config:cache` to reload settings

  • Portfolio

    New homepage published!

    After 12 years, the site of the painter from Minas Gerais joferreira was remodeled, aiming the mobile first. Being developed with laravel 7 and vuejs the site his most recent works, with the possibility to quote them via website, and to contact the artist. Through the administrative panel, the artist has full control of his publications, being able to define the categories and pictures that will be listed as main on the home page.