Skip to content

Instantly share code, notes, and snippets.

View alphaolomi's full-sized avatar
🎯
Focusing

Alpha Olomi alphaolomi

🎯
Focusing
View GitHub Profile

Basic SSH Commands

The following are fundamental SSH commands. Commit as many to memory as you can.

COMMAND DESCRIPTION
ssh Connect to a remote server
ssh pi@raspberry Connect to the device raspberry on the default SSH port 22 as user pi
ssh pi@raspberry -p 3344 Connect to the device raspberry on a specific port 3344 as user pi
@alphaolomi
alphaolomi / flutter.md
Created January 14, 2024 14:38
Testing Matrix: Comparative Characteristics of Testing Categories
Unit Widget Integration
Confidence Low Higher Highest
Maintenance cost Low Higher Highest
Dependencies Few More Most
Execution speed Quick Quick Slow
@alphaolomi
alphaolomi / db_ssh_tunneling.md
Created September 14, 2023 09:09
DB SSH Tunneling for Laravel

1. Generate SSH Key Pair on the Laravel Server:

On your new server (with the Laravel application), run the following commands to generate an SSH key pair:

ssh-keygen -t rsa -b 4096

By default, this will create two files in the ~/.ssh directory:

  • id_rsa: your private key. Keep it secret!

Diagram 2

sequenceDiagram
    actor Buyer as Buyer (A User using Online Payments)
    participant eCommercePlatform as eCommerce Platform
    participant PSP as Payment Service Provider
    participant MNO as Mobile Network Operator

    activate Buyer
@alphaolomi
alphaolomi / low_fail_rate_dep.md
Created July 20, 2023 01:52
Successful deployment with a low failure rate

Successful deployment with a low failure rate can be achieved through careful planning, rigorous testing, and continuous monitoring. Here are some key strategies to ensure a successful deployment with minimal failures:

  1. Define Clear Objectives: Clearly outline the goals and expectations of the deployment. This includes understanding the desired outcomes, specific functionalities, and performance metrics.

  2. Thorough Testing: Conduct extensive testing throughout the development process. This includes unit testing, integration testing, system testing, and user acceptance testing. Automated testing frameworks can help ensure comprehensive coverage and minimize human error.

  3. Incremental Deployment: Consider implementing a phased or incremental deployment strategy instead of a big-bang approach. By releasing the solution in smaller increments, it allows for early detection and mitigation of issues before they become widespread.

  4. Continuous Integration and Deployment: Adopt a continuous integratio

<?php
namespace Alphaolomi\Cellulant;
use GuzzleHttp\Client;
use InvalidArgumentException;
use GuzzleHttp\Middleware;
/**
* Class CellulantService
@alphaolomi
alphaolomi / bad_oop.php
Created January 19, 2023 08:27
Don't Try this
<?php
// https://twitter.com/timacdonald87/status/1615918480976662529/photo/1
class Foo
{
static function bar()
{
return Bar::class;
}
}
@alphaolomi
alphaolomi / Pdf.php
Created January 18, 2023 12:59
Extending spatie/pdf-to-text Pdf Class
<?php
namespace App\Services;
class Pdf extends \Spatie\PdfToText\Pdf
{
public function __construct(?string $binPath = '/usr/bin/pdftotext')
{
if (!file_exists($binPath)) {
$binPath = '/usr/local/bin/pdftotext';
@alphaolomi
alphaolomi / pint.json
Created January 17, 2023 13:46 — forked from JustSteveKing/pint.json
Laravel Pint configuration
{
"preset": "psr12",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
@alphaolomi
alphaolomi / pest_make_tests.php
Created November 3, 2022 21:36
Make PestPHP Tests for all files in src/
<?php
//
// Generate tests according to files in src/
// usefull on writin tests for packages
//
// Author: Alpha Olomi
// Date: 4 Nov 2022
//