Newest Post
Tampilkan postingan dengan label Tricks. Tampilkan semua postingan
Tampilkan postingan dengan label Tricks. Tampilkan semua postingan

Kamis, 02 Mei 2019

Docker and Laradock Setup Successful Notes (MAC)(WIN)

Docker and Laradock Setup Successful Notes for MAC (tested)(8 GB RAM)
- For windows you might need extra memory more than 4 GB RAM.
My PC Test Specs :
- iMac (21.5-inch, 2017) i5 - 8GB RAM DDR4
- macOS (High Sierra) v10.13.6

Before starting with laradock, make sure you are creating 1 directory

example setup :

+ laraveldocker
+ + laradock (put laradock inside laraveldocker folder)
+ + yourproject_1
+ + yourproject_2
+ + yourproject_3
+ + yourproject_......

// register that laravel folder in docker preferences
right click docker
> Preferences
> File Sharing
> click "+" / Add
> add that folder (laraveldocker)
- - - in my dir is : /Applications/XAMPP/xamppfiles/htdocs/laravel
> Apply & Restart

// install docker
// error notes ? vm cannot be create
// make sure your memory is big enough
// # # and read this notes : https://sharezone47.blogspot.com/2019/05/docker-unable-to-create-ErrorActionPreference.html

// docker compose build (this is the most fatal things in docker)
$> docker-compose 

// docker compose up
$> docker-compose up -d nginx mysql phpmyadmin redis workspace
$> docker-compose up apache2 php-fpm mysql phpmyadmin
$> docker-compose up nginx php-fpm mariadb adminer

// restart every edit laradock
$> docker-compose restart nginx
$> docker-compose restart apache2

// shutdown all docker laradock instance
$> docker-compose down

// to stop docker // example
docker-compose stop nginx


// see running container (docker and docker-compose)
docker ps
docker-compose ps

// edit host os /etc/hosts and add IP/Hostname mapping
127.0.0.1  laravel.test
127.0.0.1  sheezy.local
127.0.0.1  nonlaravelapp.local

// sites nginx
$> cp laravel.conf.example yoursites.conf

// go inside mysql
docker-compose exec mysql bash
docker-compose exec mysql mysql -u homestead -psecret

// go inside

$> docker-compose exec workspace bash

// reference
# https://sharezone47.blogspot.com/2019/05/docker-unable-to-create-ErrorActionPreference.html
# https://sudonull.com/posts/332-Laravel-Docker-Our-Successful-Experience

Rabu, 01 Mei 2019

Docker Unable to create "ErrorActionPreference" (Solved)(Windows)

Come to the New Docker, I get a new error Unable to create: The running command stopped because the preference variable "ErrorActionPreference", and here is the solution (2 solution).
First of all, don't lazy to read the error :
Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The computer 'AKPC-DESKTOP' could not be resolved. Make sure you typed the machine name correctly and that you have network access.
at New-MobyLinuxVM, <No file>: line 218
at <ScriptBlock>, <No file>: line 375
   at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters)
   at Docker.Backend.ContainerEngine.Linux.Start(Settings settings)
   at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.<Register>b__0(Object[] parameters)
   at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)
1. If you are seeing "Make sure you typed the machine name correctly and that you have network access"

Solution: you need internet. please turn on your network.

2. After That, Oops we got another error, hahaha. no need to worry.
Unable to execute Start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to create the virtual hard disk.

The system failed to create 'C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx'.
at Ensure-VHD-Path, <No file>: line 306
at New-MobyLinuxVM, <No file>: line 208
at <ScriptBlock>, <No file>: line 411    at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV.cs:line 195
   at Docker.Backend.HyperV.Create(Settings settings) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV.cs:line 125
   at Docker.Backend.ContainerEngine.Linux.Start(Settings settings, String daemonOptions) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 117
[13:43:17.016][NamedPipeClient][Error  ] Unable to send Start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to create the virtual hard disk.

The system failed to create 'C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx'.
at Ensure-VHD-Path, <No file>: line 306
at New-MobyLinuxVM, <No file>: line 208
at <ScriptBlock>, <No file>: line 411
[13:43:17.016][Notifications  ][Error  ] Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to create the virtual hard disk.

The system failed to create 'C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx'.
at Ensure-VHD-Path, <No file>: line 306
at New-MobyLinuxVM, <No file>: line 208
at <ScriptBlock>, <No file>: line 411

If you are seeing 'Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Failed to create the virtual hard disk.'

Solution :
- open Command Prompt, run as Administrator, then type this one.
MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof

- Then go to this folder : ( in my place The system failed to create 'C:\Users\Public\Documents\Hyper..... so in your side maybe different. ).
C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\....
You will see an administrator prompt there. (i forget what, but Windows will show you a Windows to prompt), just allowed that, so all content there can be seen public.

- Finally, run your docker like usual.

- Case Solved

More info  :
- Docker not starting on windows 10 #214
- Unable to create: The running command stopped because the preference variable "ErrorActionPreference" #1538
- Can't run Docker for Windows after install for the first time #1177

Happy Wednesday
KG




Selasa, 06 November 2018

Wordpress - Debug.log is not working (SOLVED)


Have you guys ever experience this level when your wordpress debug log is not showing correctly @@"

As i go with Wordpress Framework, here what i found

First Write the files debug.log
in path /wp-content/debug.log
Then Check wp-config.php
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
// @ini_set('display_errors',1);
and if debug still not working, try to check in server side :
<?php phpinfo(); ?>
make sure track_errors is ON

if this still not working, then your only choice is move the error.log to shared folder,
Example : This server is old and does not have the latest configuration. By default, you do not have access to the nginx logs.
So moved the logs to share/logs/<yourwebsites>/* 
and also if you have time , take a look at this gist
https://gist.github.com/franz-josef-kaiser/4063197
Bonus : to track php error in your case directly
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

references :
https://wordpress.stackexchange.com/questions/296942/debug-log-file-is-never-created/301298#301298
https://www.elegantthemes.com/blog/tips-tricks/using-the-wordpress-debug-log

Feeling Helped ? Comment below

Sabtu, 03 November 2018

Apa itu .nomedia pada Android


Sering kita temukan file pada beberapa android ada file namanya .nomedia, terutama pada folder thumbnail atau pada folder data di android. tapi apa  kegunaan file ini ?

Apa itu .nomedia ? 

.nomedia atau no media adalah file kosong yang berguna untuk memberitahu sistem kalau folder ini tidak boleh di ditampilkan pada gallery foto, video player, ataupun music player.

Bagaimana Cara membuat file .nomedia ini ? 
untuk gampangnya sih kita tinggal copy/salin saja file .nomedia yang sudah ada pada folder sistem /Android atau pada folder sistem /Data, lalu paste/tempel pada folder yang kita inginkan. 

Kita juga bisa membuat file ini dengan bantuan notepad editor, seperti ES File Explorer dsb.
kita cukup lakukan penamaan/rename ulang menjadi .nomedia. lalu meletakannya pada folder yang kita inginkan.

~ cukup mudah bukan.


common tags :
.nomedia, cara agar folder tidak terlihat pada gallery foto, video player, ataupun music player, sistem android.

Rabu, 13 September 2017

Cold Fusion : Starter Pack and Review

Talk about Cold Fusion, CF is really a nice product IF ONLY Adobe make it FREE for public use.

Unfortunately, this CF things are so rare right now and all about Business Oriented, so you might not find any alternate to make this stuff open source, You will only find 30 Days trial and after that only get free production test only and limited usage.

alternative (FREE)
after browse some , i found LUCEE, 
Recommended for those who seek like CF in free way.


Now lets talk more about CF

To be Honest , i am new to this CF things. So get some brave hearts and here we go.

First impression :
  • CF looks like javascript in front end nowadays. if you are Angular or React developer, u might see this almost the same. (but ya cf cf cf everywhere ya will go).
  • There less issue within the developer forums, so its a bit hard to find some references.
    the stackoverflow tag for cf
  • Cause its adobe, its a safe language to learn. (idk the future, just make sure CF survive its good to hear).
  • you must have an adobe id, so just create one. (for forums and download stuff).

Here is what they call to login in localhost.
Try to compile this online at : 
This some sites that i found useful, actually for starter like myself.
Have nice day, keep learning till ya bored and need rest for a while.

#work issues
~KG

Selasa, 04 Juli 2017

Error Code 10 (This Device Cannot Start) (SOLVED)

Today i am facing this weird issue, my PC suddenly disconnected from the internet.

Case : This Device Cannot Start - Error Code 10

in my testing here i'm using windows 10.



How to solve this issue ? :
  • First , click windows + R , it will open "run.exe" interface, 
  • Then type there : ncpa.cpl 
  • you will get redirected to your network connection.
  • You will see other internet connection that you dont use is being activated and your normal internet connection is shutdown/disable/ removed from there. 
  • Just turn it to disable (other internet connection that you dont use).
  • Next, go to control panel, and search device manager.
  • see your "network adapters" division
  • disable every network that you dont use ( do not uninstall , just disable it ).
  • click your usual network adapter there, and re-enable it. (if it's fail, then restart your PC ).
  • case solved.

    have a nice day. ~KG

    Minggu, 21 Mei 2017

    Sublime text 3 ( laravel artisan not found ) (SOLVED)

      As sublime user facing this laravel issue :
      "Artisan not found"

      that almost scared me to death.

      i'm using sublime text 3, and use laravel version 5,
      tested with laravel 4 too.


    luckly , i solve this one : 

    you can find sublime settings here : ( preferences > Package settings )

    > go to your sublime settings :
    > (choose whether "laravel 4 artisan" or "laravel 5 artisan")
    > select "Settings - default"
    > copy that text (it will be like this)

    {
        "php_path": "php",
        "artisan_path": "artisan"
    }

    >  go to your sublime settings
    > (choose whether "laravel 4 artisan" or "laravel 5 artisan")
    > select "Settings - users"
    > now paste the text here and modify the "php_path" and "artisan_path"

    {
        "php_path": "C:/xampp/php/php.exe",
        "artisan_path": "C:\\xampp\\htdocs\\myfirstapp\\artisan"
    }

    > restart your sublime
    > finish, wish you luck.

    NOTES

    > if you are using my trick you must change "artisan_path" if you use different project.

    ===================
    ===================

    for more info you can see this one : 

    https://github.com/gnarula/sublime-laravelgenerator/issues/30