This file contains hidden or 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
server { | |
listen 69; | |
location / { | |
proxy_pass http://localhost:8545; # The address of the app you are proxying to | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
# Basic Authentication | |
auth_basic "Restricted Content"; |
This file contains hidden or 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
server { | |
listen 96; | |
location / { | |
proxy_pass http://localhost:8545; # The address of the app you are proxying to | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
# Basic Authentication | |
auth_basic "Restricted Content"; |
This file contains hidden or 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
sudo apt-get update | |
sudo apt-get install zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k | |
mkdir ./.config | |
git clone https://github.com/syahrul12345/neovim ${HOME}/.config/nvim | |
mv ${HOME}/.config/neovim ${HOME}/.config/nvim | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
sudo apt update |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"path/filepath" | |
"github.com/gorilla/mux" |
This file contains hidden or 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
package utils | |
import ( | |
"encoding/json" | |
"net/http" | |
) | |
//Message outputs the message to be sent to the client | |
func Message(status bool, message string) map[string]interface{} { | |
return map[string]interface{}{ |
This file contains hidden or 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
#name of the domain by the user | |
echo Please enter the domain name, without 'www' | |
read domain | |
echo The Doamin is $domain | |
echo Please enter the port where the website will be served: | |
read port | |
echo The website will be served at $domain:$port | |
# Next lets create the appropraite file | |
sudo touch /etc/nginx/sites-available/$domain |
This file contains hidden or 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
package app | |
import ( | |
"backend/models" | |
"backend/utils" | |
"context" | |
"fmt" | |
"net/http" | |
"os" | |
"strings" |
This file contains hidden or 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
router.PathPrefix("/").Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
const staticPath = "../dist" | |
const indexPath = "index.html" | |
fileServer := http.FileServer(http.Dir(staticPath)) | |
path, err := filepath.Abs(r.URL.Path) | |
if err != nil { | |
http.Error(w, err.Error(), http.StatusBadRequest) | |
return | |
} | |
path = filepath.Join(staticPath, path) |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am syahrul12345 on github. | |
* I am syahrulnizam (https://keybase.io/syahrulnizam) on keybase. | |
* I have a public key ASC3i7NEcX-WjBZUVooDRm99iq8AIl7m6WQ1mQdCzjf88wo | |
To claim this, I am signing this object: |
This file contains hidden or 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
0x998823c4d9676E33c0DD3599DbceF2d8B31B1c86 |