Skip to content

Instantly share code, notes, and snippets.

@webspectyler
webspectyler / allowrootlogin.sh
Created May 13, 2019 23:05
Forge loses connection to Digital Ocean droplet
su root
vi /etc/ssh/sshd_config
#uncomment the line below:
PermitRootLogin yes
systemctl restart ssh
@webspectyler
webspectyler / resolve_504_gateway_timeout_in_nginx.md
Last active May 28, 2019 15:38
Resolve 504 Gateway timeout in nginx

It may not be possible to disable it at all, yet a feasible workaround is to increase the execution time. On a nginx tutorial site, it was written:

If you want to increase time-limit for all-sites on your server, you can edit main nginx.conf file:

sudo vim /etc/nginx/nginx.conf Add following in http{..} section

http {
     fastcgi_read_timeout 3000;
 proxy_read_timeout 3000;
>>> $user->password = Hash::make('thanhnd123');
=> "$2y$10$At6GpoCsB.BQOacms87fAubGRMtu2UqJ44f53IN2EdT43IGDI.5oO"
>>> $user->save()
@webspectyler
webspectyler / HandleExceptions.php
Created June 4, 2019 14:17
Countable error in Laravel with PHP 7.2
<?php
// vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:56
public function handleError($level, $message, $file = '', $line = 0, $context = [])
{
if (error_reporting() & $level) {
if (strpos($message, 'Parameter must be an array or an object that implements Countable') !== false)
return;
@webspectyler
webspectyler / updateDudaManifest.php
Last active May 10, 2021 13:34
Run in Tinker to make changes to the Duda manifest.
<?php
use \Webspec\Duda\Duda;
$duda = new Duda;
$manifest = $duda->getAppManifest();
//dd($manifest);
$manifest['wl_app_profile']['en']['app_name'] = $manifest['app_profile']['en']['app_name'];
$manifest['wl_app_profile']['en']['app_logo'] = $manifest['app_profile']['en']['app_logo'];