Skip to content

Instantly share code, notes, and snippets.

View njxqlus's full-sized avatar

Mikael Ahabalyants njxqlus

  • New Zealand
  • 08:28 (UTC +12:00)
View GitHub Profile
@njxqlus
njxqlus / Dockerfile
Created November 1, 2018 08:59
PHP + Oracle instantclient dockerfile
FROM php:fpm
# Install packages
RUN apt-get update
RUN apt-get install -y unzip
RUN apt-get install -y libaio1
# Oracle instantclient
ADD instantclient-basic-linux.x64-11.2.0.4.0.zip /tmp/
ADD instantclient-sdk-linux.x64-11.2.0.4.0.zip /tmp/
@njxqlus
njxqlus / Readme.md
Last active July 24, 2020 14:36
GitLab SSH Windows 10 with Putty
  1. Install Putty and related utilities

  2. Set system environment variable in Windows(Control Panel\System and Security\System --> and clicking on "Advanced system settings" in the left pane. Then click on "Environment Variables") GIT_SSH=%path_to_plink.exe% (Note plink.exe goes into wherever you installed Putty)

  3. Generate a ssh key using puttygen.exe (ssh2-rsa, 4096, comment=GitLab, and set a passphrase)

  4. Add key to pageant.exe and the public key to your GitLab profile

  5. Ensure you start a new command shell so that git recognizes the GIT_SSH value

  6. Try these two commands to check connection first. This should give you a popup window that authenticates connection

  7. set Git putty git@gitlab.com:%user%/%repo.git%

@njxqlus
njxqlus / web.php
Last active June 6, 2021 11:59
Laravel Voyager + Laravel Passport Routes
<?php
Route::group(['prefix' => 'admin'], function ()
{
Voyager::routes();
Route::post('logout', ['uses' => 'Auth\LoginController@logout'])->name('voyager.logout');
Route::post('login', ['uses' => 'Auth\LoginController@login'])->name('voyager.postlogin');
Route::get('login', ['uses' => 'Auth\LoginController@showLoginForm'])->name('voyager.login');
});
@njxqlus
njxqlus / LoginController.php
Last active July 24, 2017 06:38
Laravel Auth by email and username for web and api routes
<?php
/**
* Get the needed authorization credentials from the request.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
protected function credentials(Request $request)
{
$field = filter_var($request->get($this->username()), FILTER_VALIDATE_EMAIL)
@njxqlus
njxqlus / OauthTablesReservation.php
Last active June 27, 2017 16:01
Laravel Passport Oauth tables reservation (saver)
<?php
use Illuminate\Database\Seeder;
class OauthTablesReservation extends Seeder
{
/**
* Run the database seeds.
*
* @return void