Apache Hacker

Stopping “connect” attacks in apache (solution)

Then add the following right after it and restart apache to activate.

# Second, we configure the "default" Location to restrict the methods
# to stop CONNECT method attacks.
Order allow,deny Deny from all

I don’t like the idea of my server responding to requests for random hostnames, even if it serves local content. How can I deny these requests?

<VirtualHost *:80>
  ServerName default.only
  <Location />
    Order allow,deny
    Deny from all


untar linux compressed file

tar -zxvf yourfile.tar.gz
Queues REDIS

Redis Practical commands

Redis Command Line

redis-cli -h -p 6379

List keys

keys *

Show Value Key

mget "nameOfYourKey"

Show all Redis keys

$ redis-cli KEYS '*'

Queues REDIS

Flush keys in Redis

redis-cli FLUSHALL

Laravel Socialite

Laravel Socialite makes the experience painless and fast to implement. I highly recommend this package for quick development ! Here

laravel socialite raleche
laravel socialite raleche

Tutorial – Submit large files in GIT


  1. Install git >= 1.8.2
    • Recommended method for RHEL/CentOS 5 and 7 (not 6!)
      1. Install the epel repo link (For CentOS it’s just sudo yum install epel-release)
      2. sudo yum install git
    • Recommended method for RHEL/CentOS 6
      1. Install the IUS Community repo. curl -s | sudo bash or here
      2. sudo yum install git2u
    • You can also build git from source and install it. If you do that, you will need to either manually download the git-lfs rpm and install it with rpm -i --nodeps git-lfs*.rpm, or just use the Other instructions. The only other advanced way to fool yum is to create and install a fake/real git rpm to satisfy the git >= 1.8.2 requirement.
  2. To install the git-lfs repo, run curl -s | sudo bash from here
  3. sudo yum install git-lfs
  4. git lfs install

Install software on your Macbook MAC

brew install git-lfs

List type files to be tracked

git lfs track "*.psd"

git add .gitattributes


git add file.psd 

git commit -m "Add design file" 

git push origin master

Tutorial – How to do a search form with laravel pagination bootstrap ?

Define routes at routes/web.php

//All certificates
Route::post('/search-certificates', 'CertificatesController@search' );
Route::get('/search-certificates', 'CertificatesController@search' );
Route::any('/search-certificates', 'CertificatesController@search' );

Define Controller function Search

public function search(Request $request){
    $searchString = $request->input('searchString');
    $searchCertificates = DB::table('NAMEOFYOURBABLE')
        ->where('BOROUGH', 'like', "%$searchString%" )
        ->orwhere('STREET', 'like', "%$searchString%" )
        ->orwhere('POSTCODE', 'like', "%$searchString%" )
        ->orderBy('POSTCODE', 'asc')
        ->orderBy('NUMBER', 'asc')
        ->orderBy('JOB_NUMBER', 'asc')

    $searchCertificates->appends(['searchString' => $searchString]);

    return view('search-certificates', ['searchCertificates' => $searchCertificates]);

Most important line on the code above is the one below because it will allow search pagination

    $searchCertificates->appends(['searchString' => $searchString]);

Define View Laravel Blade Page


<form action="/search-certificates" method="POST" role="search">
    {{ csrf_field() }}
    <div class="input-group">
        <input type="text" class="form-control" name="searchString"
               placeholder="Search by Street or Postal Code " />
         <button type="submit" class="btn btn-primary">Submit</button>


<div class="row justify-content-center">
<table class="table table-striped">
<th>Number of Units</th>
@foreach ($searchCertificates as $oneCertificate)
<td>{{ $oneCertificate->POSTCODE }}</td>
<td>{{ $oneCertificate->ISSUE_TYPE }}</td>
<td>{{ $oneCertificate->C_O_ISSUE_DATE }}</td>
<td> {{ $oneCertificate->BOROUGH }}</td>
<td>{{ $oneCertificate->NUMBER }}</td>
<td>{{ $oneCertificate->STREET }}</td>
<td>{{ $oneCertificate->PR_DWELLING_UNIT }}</td>
<td>{{ $oneCertificate->NTA }}</td>

Blade Pagination Link

{{ $searchCertificates->links( "pagination::bootstrap-4") }}

Tutorial Install Oauth2 Server

Find below the steps to install an Oauth2 server with laravel Passport

Install the package

composer require laravel/passport
php artisan migrate
php artisan passport:install

Retrieve the keys from laravel passport

Personal access client created successfully.
 Client ID: 7
 Client secret: JfTAiRtvsdX2pZI1cBUShCrd2BU5pYYrX0lzHwRhBq
 Password grant client created successfully.
 Client ID: 8
 Client secret: Y3nUHg1xcaOPCsdsdsqbIjA3Ghj5CJnTf0pD1p3t2U5wN

Modify App\User.php file

<?php namespace App;
 use Laravel\Passport\HasApiTokens; 
use Illuminate\Notifications\Notifiable; 
use Illuminate\Foundation\Auth\User as Authenticatable; 

class User extends Authenticatable {    
 use HasApiTokens, Notifiable; 

Register the routes necessary to issue access tokens and revoke access tokens, clients, and personal access tokens:

<?php namespace App\Providers; 
use Laravel\Passport\Passport;
 use Illuminate\Support\Facades\Gate;
 use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; 

class AuthServiceProvider extends ServiceProvider {  
    * The policy mappings for the application.      
    * @var array      
     protected $policies = [  
       'App\Model' => 'App\Policies\ModelPolicy',   
   * Register any authentication / authorization services.      
   * @return void     
   public function boot()     

Configure config/auth.php

'guards' => [     
         'web' => [         
                   'driver' => 'session',
                   'provider' => 'users',
         'api' => [         
                   'driver' => 'passport',
                   'provider' => 'users',    

SET TO GO, now get access token to proceed

Use the generated key in initial step called Password grant client

Server Token Web Server

Rest Client