phpUnit Debug Technics Guzzle

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

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


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

    $response = QATemplate::$http->request(
            '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);


New Keyboard Das X50Q Soft Tactile

Enjoying my new Keyboard ! Volume control is awesome !


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

DBeaver Configuration : Postgres and MacOs

1 . Install postgres

2. Find path to pg_dump


3. configure client (Dbeaver)

to add hidden files -> command + shift + G

paste /Applications/

and select the folder

4. Voila !


How to Laravel Nova? Postgres

Create Resource

 php artisan nova:resource DirectMailing

Create Model

 php artisan make:model DirectMailing -m


How to deal multiple schema ?

Connection variable is critical

protected $connection = 'pgsql-api';

How to deal with Schema and uuids ?

file location : app/LoyaltyLevels.php

class LoyaltyLevels extends Model
    protected $connection = 'pgsql-api';
    protected $table = 'api.loyalty_levels';
     * The primary key associated with the table.
     * @var string
    protected $primaryKey = 'loyalty_level_uuid';
    protected $keyType = 'string';

File location app/Nova/LoyaltyLevels.php

 public function fields(Request $request)
        return [

SSL ImportError: No module named cryptography

Problem – Let’s Encrypt

[[email protected] ec2-user]# /usr/local/bin/certbot-auto --no-bootstrap
 Creating virtual environment…
 Installing Python packages…
 Installation succeeded.
 Traceback (most recent call last):
   File "/opt/", line 7, in 
     from certbot.main import main
   File "/opt/", line 2, in 
     from certbot._internal import main as internal_main
   File "/opt/", line 10, in 
     import josepy as jose
   File "/opt/", line 41, in 
     from josepy.interfaces import JSONDeSerializable
   File "/opt/", line 7, in 
     from josepy import errors, util
   File "/opt/", line 7, in 
     import OpenSSL
   File "/opt/", line 8, in 
     from OpenSSL import crypto, SSL
   File "/opt/", line 12, in 
     from cryptography import x509
 ImportError: No module named cryptography


rm -rf /opt/*
pip install -U certbot
certbot renew --debug

How to Compress files tar bz2 ?

Compress bz2

tar -cjvf archive.tar.bz2 stuff

Decompress bz2

tar -jxvf filename.tbz2


Laravel BackPack – Tutorial

   745  composer require backpack/crud:"4.0.*"
   746  composer require backpack/generators --dev
   747  composer require laracasts/generators --dev
   748  php artisan backpack:install
   749  php artisan make:migration:schema create_tags_table --model=0 --schema="name:string:unique"
   750  php artisan migrate
   751  php artisan backpack:crud tag
   752  valet park
   753  valet link
   754  valet links
   755  hisory
   756  history
   757  vim .env
   758  php artisan backpack:crud building
   759  php artisan backpack:crud apartment
   760  php artisan backpack:crud apartment

Additionnal Feature

  830  composer require backpack/permissionmanager
  831  php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="migrations"
  832  php artisan migrate
  833  php artisan migrate
  834  php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="config"
  835  php artisan vendor:publish --provider="Backpack\PermissionManager\PermissionManagerServiceProvider"

BackPack links

  853  php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('setting') }}'><i class='nav-icon fa fa-cog'></i> <span>Settings</span></a></li>"
  854  Discovered Package: creativeorange/gravatar
  855  composer require backpack/logmanager
  856  php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('log') }}'><i class='nav-icon fa fa-terminal'></i> Logs</a></li>"
  857  composer require backpack/backupmanager
  858  php artisan vendor:publish --provider="Backpack\BackupManager\BackupManagerServiceProvider"  --tag=config
  859  php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('backup') }}'><i class='nav-icon fa fa-hdd-o'></i> Backups</a></li>"
  860  composer require seandowney/backpackgallerycrud

Best File compression

First, we installed Bastion and compressed its folder — about 863 MB in size of music, graphics, executable files, and various different types of documents:

  • Zip (Windows 8.1): 746 MB (86.4% of the original size)
  • Zip (WinZip): 745 MB (86.3% of the original size)
  • RAR (WinRAR): 746 MB (86.4% of the original size)
  • 7z (7-Zip): 734 MB (85% of the original size)

Next, we compressed Hotline Miami, which is 654 MB of data:

  • Zip (Windows 8.1): 316 MB (48.3% of the original size)
  • Zip (WinZip): 314 MB (48% of the original size)
  • RAR (WinRAR): 307 MB (46.9% of the original size)
  • 7z (7-Zip): 301 MB (46% of the original size)


Laravel Back pack tutorial

Install important package

  #1  composer require backpack/crud:"4.0.*"
  #2  composer require backpack/generators --dev
  #3  composer require laracasts/generators --dev
  #4  php artisan backpack:install

#5 php artisan make:migration:schema create_tags_table --model=0 --schema="name:string:unique"
#6 php artisan migrate
#7 php artisan backpack:crud tag