-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathweb_dev.php
More file actions
79 lines (70 loc) · 2.32 KB
/
Copy pathweb_dev.php
File metadata and controls
79 lines (70 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
$theme = 'Web Dev';
$theme_c = '#000';
require_once('_templates/head.php');
?>
<body>
<div class="header">
<h1><?= $theme; ?></h1>
<p>Commands & settings</p>
<h2>Commands</h2>
</div>
<dl>
<dt>
<input value="openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privkey.pem -out fullchain.pem" type="text" readonly>
</dt>
<dd>Create self-signed certificate for local use</dd>
<dt>
<input value="ssh user@server -L LOCAL_PORT:localhost:REMOTE_PORT" type="text" readonly>
</dt>
<dd>Port forward a remote port to a local one</dd>
<dd>Very handy for using local software with remote data</dd>
<dd><span class="note">MySQL example:</span> <code>ssh user@server -L 3307:localhost:3306</code></dd>
<dd><code>localhost:3307</code> now works locally as <code>localhost:3306</code> works on the server</dd>
<dt>
<input value="chmod -R +a '_www allow read,write,append,readattr,writeattr,readextattr,readsecurity,file_inherit' ~/Dev/Web" type="text" readonly>
</dt>
<dd><span class="note">Mac OS:</span> Give _www (apache group) permissions to ~/Dev/Web</dd>
<dt>
<textarea rows="16">
const form = document.querySelector('form');
const data = new FormData(form);
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
let response = null;
try {
response = JSON.parse(xhr.responseText);
} catch (e) {
console.error(e);
}
handleSuccess(input, response);
}
};
xhr.open("POST", form.action, true);
xhr.send(data);
</textarea>
</dt>
<dd>Extensions</dd>
</dl>
<div class="header">
<h2>Settings</h2>
</div>
<dl>
<dt>
<textarea rows="12" readonly>
<VirtualHost *:80>
DocumentRoot "/Dir"
ServerName domain.local
ServerAlias *.domain.local
<Directory "/Dir">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
</textarea>
</dt>
<dd>Apache virtual host example</dd>
</dl>
<?php require_once('_templates/footer.php'); ?>