Skip to content

Instantly share code, notes, and snippets.

View khaidir's full-sized avatar

Khaidir Hasan khaidir

  • Banda Aceh
View GitHub Profile
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
type CreateParams struct {
package main
import (
"fmt"
)
func main() {
var one int
fmt.Println("Inputan deret pertama:")
package main
import (
"fmt"
"sort"
)
func main() {
data := []float64{4, -7, -5, 3, 3.3, 9, 0, 10, 0.2}
// Develop by Khaidir Hasan for Test Case Majoo
// dibuat dalam 1 file untuk jawaban 3 dan 4
// masukkan nomor jawaban setelah eksekusi file untuk menjalan masing-masing jawaban
// ikuti perintah program
package main
import (
"fmt"
"sort"
@khaidir
khaidir / instal-php-di-ubuntu.md
Created October 28, 2018 23:35 — forked from ianmustafa/instal-php-di-ubuntu.md
Instal PHP di Ubuntu dan keluarganya? Tak perlu bingung lagi!

Instal PHP di Ubuntu dan Keluarganya? Tak perlu bingung lagi!

Thanks to Ondřej Surý, semua jadi lebih mudah. Instal berbagai versi PHP secara bersamaan pun bisa.

@khaidir
khaidir / create_subdomain_cpanel.php
Created September 27, 2018 07:38 — forked from hsali/create_subdomain_cpanel.php
PHP Script to create subdomain on cpanel .
function create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain) {
// $buildRequest = "/frontend/x3/subdomain/doadddomain.html?rootdomain=" . $rootDomain . "&domain=" . $subDomain;
$buildRequest = "/frontend/x3/subdomain/doadddomain.html?rootdomain=" . $rootDomain . "&domain=" . $subDomain . "&dir=public_html/subdomains/" . $subDomain;
$openSocket = fsockopen('localhost',2082);
if(!$openSocket) {
return "Socket error";
exit();
@khaidir
khaidir / gist:d8463da0f92633978cc8cfac8146402b
Created September 19, 2018 03:05 — forked from khaidirh/gist:1c302edd6574b0eedde302ddbcfc9ac9
How to install Nginx stabel with HTTP2, PHP5.6-fpm PHP7.0, PHPMyadmin, MySQL-Server
============================================= NGINX ==================================================
1) Installing Nginx 1.9.5
First we need to update source.list, so that we can download the latest version of nginx. After connecting to the server through ssh, open the sources.list file
sudo nano /etc/apt/sources.list
and add the following lines:
deb http://nginx.org/packages/mainline/debian/ jessie nginx
@khaidir
khaidir / letsencrypt_2018.md
Created July 30, 2018 14:53 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

##Docker Installation
$ wget -qO- https://get.docker.com/ | sh
###user to the “docker” group execute the following command:
$ sudo usermod -aG docker user
$ sudo reboot
###Verify Docker Installation
@khaidir
khaidir / nginx.conf
Created August 7, 2017 05:39 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048