log.Fatal() | log.Panic() | |
---|---|---|
When to Use | When something unexpected happened | When something really unexpected happened |
Use Case | - Not enough arguments - can not access file - etc. | - Not having enough disk space - Not being find file that previously accessed - etc. |
Terminate Behavior | Stops the program at the point where log.Fatal() called |
Immediately stops the Go program |
Similar function | Similar to call log.Print() followed by os.Exit(1) |
Similar to call log.Print() followed by panic() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUN cp wp-config-sample.php wp-config.php | |
# Replace configuration file with desired env | |
RUN sed -i 's/database_name_here/'"${DB_NAME}"'/g' wp-config.php; | |
RUN sed -i 's/username_here/'"${DB_USER}"'/g' wp-config.php; | |
RUN sed -i 's/password_here/'"${DB_PASSWORD}"'/g' wp-config.php; | |
RUN sed -i 's/localhost/db/g' wp-config.php; | |
RUN sed -i 's/'"'AUTH_KEY',".*"'put your unique phrase here'"'/'"'AUTH_KEY', '""$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1)""'"'/g' wp-config.php; | |
RUN sed -i 's/'"'SECURE_AUTH_KEY',".*"'put your unique phrase here'"'/'"'SECURE_AUTH_KEY', '""$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1)""'"'/g' wp-config.php; | |
RUN sed -i 's/'"'LOGGED_IN_KEY',".*"'put your unique phrase here'"'/'"'LOGGED_IN_KEY', '""$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1)""'"'/g' wp-config.php; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CONNECT_STATE=0 | |
PREVIOUS_STATE=0 | |
while true; do | |
if ping -c 1 google.com | grep "64 bytes from"; then | |
CONNECT_STATE=1 | |
else | |
CONNECT_STATE=0 |
+--------------------------------------------------------------------------+
| |
| Phisical Server |
| Host: 192.168.100.1 |
| |
| |
| |
| |
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Validator; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
use Auth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Validator; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
use Auth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function quizCheckAnswer($quiz_id, Request $request) { | |
$userdata = Cektoken::cek($request->token); | |
$data = []; | |
//Cek Quiz | |
$quiz = \App\Models\Quiz::find($quiz_id); | |
//Quiz tidak ditemukan | |
if (! $quiz) { | |
return response()->json(['status' => false, 'data' => $data, 'message' => 'Ups, Quiz tidak valid',404]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function surveyPlayStore($id, Request $request) | |
{ | |
$userdata = Cektoken::cek($request->token); | |
$data = []; | |
$survey = \App\Models\Survey::find($id); | |
if (!$survey OR $survey->is_active == 'n') { | |
return response()->json(['status' => false, 'data' => $data, 'message' => 'Survey tidak valid'], 404); | |
} |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── 1.env | |
├── LICENSE.md | |
├── README.md | |
├── _ide_helper.php | |
├── anu.md | |
├── app | |
│ ├── ApiToken.php | |
│ ├── Console | |
│ │ ├── Commands |