title: Setting Up Laravel in Ubuntu / DigitalOcean keywords: servers, laravel, coderstape, coder's tape description: Let's take a look at settting up a server from scratch for Laravel. date: April 1, 2019 tags: servers, laravel permalink: setting-up-laravel-in-ubuntu-digitalocean img: https://coderstape.com/storage/uploads/GZTXUbyGum2xeUZM9qBD5aPv8EKLwG3C8RGcRon4.jpeg author: Victor Gonzalez authorlink: https://github.com/vicgonvt
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
wrap the text with like this "\033[colorcodemTEXT\033[0m" | |
Foreground Colors | |
Color Code | |
Black 0;30 | |
Dark Grey 1;30 | |
Red 0;31 | |
Light Red 1;31 | |
Green 0;32 | |
Light Green 1;32 |
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
func main() { | |
var line string | |
scanner := bufio.NewScanner(os.Stdin) | |
for scanner.Scan() { | |
line = scanner.Text() | |
fmt.Println("Got line:", line) | |
for _, x := range strings.Fields(line) { | |
fmt.Println("next field: ",x) | |
} | |
} |
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
const fs = require("fs"); | |
const path = require("path"); | |
const controllersDir = path.join(__dirname, "target_dir"); | |
const files = fs.readdirSync(controllersDir); | |
const getFiles = files => | |
files.reduce((acc, file) => { | |
const filePath = path.join(controllersDir, file); |
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
app.all('*', function (req, res) { | |
res.cookie('XSRF-TOKEN', req.csrfToken()) | |
res.render('index') | |
}) |
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
from flask import Flask, render_template, abort | |
from jinja2 import TemplateNotFound | |
@app.route('/', defaults={'path': ''}) | |
@app.route('/<path:path>') | |
def index(path): | |
try: | |
return render_template('index.html') | |
except TemplateNotFound: | |
abort(404) |
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
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin |
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
https://www.youtube.com/watch?v=HbgzrKJvDRw |
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
1. 'dev' refers to device. in my case i have a ssd and a hdd. so while installing linux it will show | |
one of them as 'dev/sda' and other as 'dev/sdb'. 'sd' refers to disk and adds an alphabet to it's end to alphabetically organize. | |
2. under each disk we will have partition of that disk. each partition will append a number to organize them. ex: sda1, sda2, sdb1, sdb2 ... | |
follow this link on Step 4: Partition Magic https://medium.com/@killyourfm/the-beginners-guide-to-installing-ubuntu-linux-18-04-lts-6c8230036d84 | |
The part which is the main focus of this gist: | |
Sidebar: Here’s how Linux identifies devices. “dev” simply means “a device that you can read from or write to.” Then we see “sda, sda1, |
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
[SSD] | |
/boot | |
/ | |
[HDD] | |
/usr | |
/tmp | |
/home | |
SWAP |
NewerOlder