Categories
General Technical

How to mage Immutable File Unix ?

lsattr /etc/pgbouncer/users.txt
 ----i--------e- /etc/pgbouncer/users.txt

lsattr /etc/pgbouncer/users.txt
----i--------e- /etc/pgbouncer/users.txt
 
sudo chattr -i /etc/pgbouncer/users.txt
lsattr /etc/pgbouncer/users.txt
 -------------e- /etc/pgbouncer/users.txt
 
vim /etc/pgbouncer/users.txt
sudo chattr +i /etc/pgbouncer/users.txt
lsattr /etc/pgbouncer/users.txt
----i--------e- /etc/pgbouncer/users.txt
Categories
Continuous Integration/Development

How to setup Continuous Integration ?

Developers practicing continuous integration merge their changes back to the main branch as often as possible. The developer’s changes are validated by creating a build and running automated tests against the build. By doing so, you avoid the integration hell that usually happens when people wait for release day to merge their changes into the release branch.

Continuous integration puts a great emphasis on testing automation to check that the application is not broken whenever new commits are integrated into the main branch.

see diagram here

See steps by step implementation here

Categories
Technical

What are the Benefits of pull requests ?

  • Use this collaborative platform to discuss potential modifications to the code.
  • Improve code quality.
  • Simplify the process of receiving feedback from the reviewer.
  • Address feedback easily in-line near the relevant code.
  • Provide better stability for the code.
Categories
Technical

Where to find a Continuous Integration Deployment Process Diagram ?

CI/CD contiuous integration
code review continuous integration continuous deployment
Categories
Technical

Good Practice Programming with David Raleche

Categories
Laravel

Install Laravel Nova

1 - composer create-project --prefer-dist laravel/laravel admin "5.8.*"


2 - add/update in composer.json the following item
"repositories": [
     {
         "type": "composer",
         "url": "https://nova.laravel.com"
     }
 ],

Next, you may add laravel/nova to your list of required packages in your composer.json file:

"require": {
     "php": "^7.1.3",
     "fideloper/proxy": "^4.0",
     "laravel/framework": "5.8.*",
     "laravel/nova": "~2.0"
 },
3 - php artisan nova:install
4 - php artisan migrate
5- Authorizing Nova in non-local Environment
/**
 Register the Nova gate.
 *
 This gate determines who can access Nova in non-local environments.
 *
 @return void
 */
 protected function gate()
 {
 Gate::define('viewNova', function ($user) {
     return in_array($user->email, [
         '[email protected]',
     ]);
 });
 } 
#6 - Deploy with credentials
composer config http-basic.nova.laravel.com [email protected] mxxxxxxxxxxxxxxxxg
Categories
Git

Git got to a particular hash version

Use git checkout <sha1> to check out a particular commit.

Categories
PHPUnit

phpUnit Debug Technics Guzzle

$body = json_decode($response->getBody());

 fwrite(STDERR, json_encode($json));
 fwrite(STDERR, $body->message);
 public function testSuccesssfulJobCancel()
{

    $this->postOrderSuccesful();

    $headers = [
        'Authorization' => QATemplate::$deleteKey,
    ];
    $url = '/v1/jobId/M111111123-001';

    $response = QATemplate::$http->request(
        'DELETE',
        $url,
        [
            'verify' =>false,
            'http_errors' => false,
            'headers' =>$headers
        ]
    );

    $body = json_decode($response->getBody());

    fwrite(STDERR, json_encode($json));
    fwrite(STDERR, $body->message);


    $this->assertEquals(200, $response->getStatusCode());
    $this->assertContains("Success Job Deleted", $body->message);
}

Categories
Technical

New Keyboard Das X50Q Soft Tactile

Enjoying my new Keyboard ! Volume control is awesome !

Categories
Git

How to easily copy one git branch to another local branch ?

git checkout local-branch-i-want-to-revert
git reset --hard origin/branch-i-want-to-copy