Browse Source

add envs.net - help page

master
cremesk 1 month ago
parent
commit
2e39124da2
Signed by: cremesk <ennik@envs.net> GPG Key ID: C147C3B7FBDF08D0
4 changed files with 245 additions and 0 deletions
  1. 4
    0
      .gitignore
  2. BIN
      docs/favicon.ico
  3. 238
    0
      docs/index.md
  4. 3
    0
      mkdocs.yml

+ 4
- 0
.gitignore View File

@@ -0,0 +1,4 @@
*~
/site
*.sublime-project
*.sublime-workspace

BIN
docs/favicon.ico View File


+ 238
- 0
docs/index.md View File

@@ -0,0 +1,238 @@
# envs.net - help

> *write in irc (#envs) or*<br />
> *contact [sudoers@envs.net](mailto:sudoers@envs.net) for any other help requests.*

## &#35; show public ip
`curl ip.envs.net`

## &#35; the null pointer - aliases
add the following lines to you're aliases file `~/.bash_aliases`
```bash
0file() {} curl -F"file=@$1" https://envs.sh ; }
0url() { curl -F"url=$1" https://envs.sh ; }
0short() { curl -F"shorten=$1" https://envs.sh ; }
```
HTTP POST files here:<br />
&nbsp;&nbsp;`0file "yourfile.png"`<br />
you can also POST remote URLs:<br />
&nbsp;&nbsp;`0url "https://example.com/image.jpg"`<br />
or you can shorten URLs:<br />
&nbsp;&nbsp;`0short "https://example.com/some/long/url"`<br />
<br /><br />
*if you want a nice wrapper, try [~tomasino's pb](https://tildegit.org/tomasino/pb)*

## &#35; termbin - aliases
`echo 'alias tb="nc tb.envs.net 9999"' >> ~/.bash_aliases`

you can POST a text:<br />
&nbsp;&nbsp;`echo less typing now! | tb`<br />
or Content of a file:<br />
&nbsp;&nbsp;`cat ~/some_file.txt | tb`<br />

## &#35; user page
you're user page is available under<br />

*https://envs.net/~username*, *https://envs.net/u/username*,<br />
*https://username.envs.net/* and *https://username.envs.sh/*.<br />

the index file location for our page is `~/public_html/` and<br />
a template for the page can you found in `~/public_html/your_index_template`.<br />

static files are served normally, along with the following dynamic options:

- php - name the file with a php extension or use index.php
- perl - name the file with a pl extension and make it executable
- cgi-bin - name it whatever you want and place it in `~/public_html/cgi-bin/`<br />*don't forget to make the cgi-bin script executable*

if you're having trouble with .pl or cgi-bin scripts,<br />
make sure that you're sending the content-type header as the first thing.

## &#35; user blog
you're blog is available under *https://envs.net/~username/blog* and *https://username.envs.net/blog*.<br />
and you can also use any other blogging software. ;)

### with [ttbp](https://envs.net/ttbp). available system-wide as `feels` and `ttbp`
just log in to you're envs.net account and enter: `feels`<br />
ttbp will ask you a few questions to get you started. after that,<br />
writing and reading entries all happen within the program.<br />
that's it!<br />
please see for more informations on the envs.net [ttbp](https://envs.net/ttbp) page.

### with [twtxt](https://github.com/buckket/twtxt). available system-wide as `twtxt`
to set up your twtxt it takes the following steps

1. `twtxt quickstart` - this wizard will generate a basic configuration file for twtxt<br /> in `~/.config/twtxt/config`. *for more config option see: [twtxt - configuration](https://twtxt.readthedocs.io/en/latest/user/configuration.html).<br />*note your public twtxt location is ~/public_html/twtxt.txt*
2. now you can use `twtxt tweet "Hello, this is twtxt!"` to post a status and<br />`twtxt timeline` to view your timeline.

for more feature see `twtxt --help` and [twtxt - usage](https://twtxt.readthedocs.io/en/latest/user/usage.html).

### with [bashblog](https://github.com/envs-net/bashblog). available system-wide as `bb`

#### usage
- `bb post` or `bb post --html` - to use html
- write a post
- save, close and then select from the bashblog menu choices

#### config
to change the name and url and other settings for you're blog edit<br />
the `config` file in `~/public_html/blog/` see for an example [here](https://github.com/envs-net/bashblog/blob/master/.config_example).<br />

## &#35; user mail
we used [modoboa](https://modoboa.org/) - made multidomain email hosting simple

| | |
| ------------------------- |:---:|
| webmail: | [https://mail.envs.net](https://mail.envs.net) |
| username: | username@envs.net |
| | |
| smtp server-address: | mail.envs.net |
| smtp server-address: | 587 |
| smtp connection-security: | STARTTLS |
| | |
| imap server-address: | mail.envs.net |
| imap server-port: | 993 |
| imap connection-security: | SSL/TLS |

you can find more mail settings directly in you're [webmail](https://mail.envs.net/user/#profile/).<br />
(*an secondary e-mail address, can be used for recovery needs*)<br />
<br />
we also have managesieve support. managesieve is available on the default port (4190)<br />
if you want to use an external managesieve client (like the [thunderbird add-on](https://github.com/thsmi/sieve)).<br />
you can also set up your filter in the [webmailer](https://mail.envs.net/sfilters/).

## &#35; user gopher
main gopher page: `gopher://envs.net`<br />

envs.net serves user gopherholes from your `~/public_gopher` directory.<br />
if a file called `gophermap` exists in the directory you're currently browsing to in gopher, it will get processed and displayed.<br />
see [this example](https://github.com/gophernicus/gophernicus/blob/master/README.Gophermap) for more information on file types and special chars.

### browse gophersites
if you're currently connected from a envs.net shell, you can use the [`lynx`](https://lynx.browser.org/) browser.<br />
&nbsp;&nbsp;`lynx gopher://envs.net`<br />
if you want to access the gophersite in your public_gopher dir, use the following
link structure: `gopher://envs.net/1/~username`<br />
<br />
otherwise, you can use our [http proxy](https://gopher.envs.net/envs.net) to browse the gophernet.

## &#35; ssh
### ssh details and usage
ports 22, 80, 443, 2222 and 2223 are available for ssh.<br />
use ssh.envs.net to reach the secondary ip and use 80 and 443 for ssh.<br />
so, for example, you can do:<br />
&nbsp;&nbsp;`ssh user@envs.net`<br />
&nbsp;&nbsp;`ssh -p2223 user@envs.net`<br />
or for the secondary ip:<br />
&nbsp;&nbsp;`ssh -p443 user@ssh.envs.net`<br />
<br />
if you have a slightly shaky connection then you can also use `mosh`.

### create a ssh-key
make sure you have a ~/.ssh directory<br />
&nbsp;&nbsp;`mkdir -m 700 ~/.ssh`<br />
create your key<br />
&nbsp;&nbsp;`ssh-keygen -t rsa -b 4096`<br />
your public and private key will be located at<br />
&nbsp;&nbsp;`cat ~/.ssh/id_rsa.pub`

### ssh config
define ssh host aliase in `~/.ssh/config`
```bash
Host envs.net
HostName envs.net
Port 2223
User user
LocalForward localhost:6667 localhost:6667
```

now you can use a simple `ssh envs.net` to connect.<br />
there are tons of other options, including this `LocalForward` line to automatically set up the tunnel as show below.<br />
for more available options, see the man page: `man ssh_config`

### ssh tunnels
for example, you want to get into znc with your local client (weechat, etc),<br />
but your local network blocks znc ports. you can connect to envs.net, and use port forwarding to get on.<br />
<br />
if you are connecting from a linux machine, you can do this:<br />
`ssh -L 6667:localhost:6667 envs.net`<br />
after being logged in, open your local irc client, and use `127.0.0.1:6667`<br />
for your server setting. voila! you're now on envs.net znc server.<br />

what that ssh command did was open a local port tunnel (-L), using local port 6667 (6667:)<br />
pointed at localhost (from the remote's point of view), on remote port 6667 (default irc port).

putty has the same ability (for windows and mac users), under connection &gt; ssh &gt; tunnels.

you can do this for any arbitrary port.

### import &amp; authorize a public ssh-key
from URL (on remote machine)<br />
&nbsp;&nbsp;`echo &#36;(curl -sL https://example.com/id_rsa.pub) &#124; tee -a ~/.ssh/authorized_keys`<br />
over ssh (on local machine)<br />
&nbsp;&nbsp;`ssh-copy-id -i ~/.ssh/id_rsa.pub -p2223 user@envs.net;`

### ssh remote execution
`ssh envs.net ping google.de`<br />
or<br />
&nbsp;&nbsp;`ssh envs.net bash -c "'uname -a'"`<br />
exec a local script<br />
&nbsp;&nbsp;`ssh envs.net 'bash -s' < local_script.sh`

## &#35; scp usage
copy ssh pub key to remote:<br />
&nbsp;&nbsp;`scp -P 2223 ~/.ssh/authorized_keys user@envs.net:~/.ssh/authorized_keys`<br />
copy website index.html from remote:<br />
&nbsp;&nbsp;`scp -P 2223 user@envs.net:~/public_www/index.html ~/public_www/`<br />

## &#35; rsync usage
sync website to remote:<br />
&nbsp;&nbsp;`rsync -avz -e "ssh -p 2223" ~/public_www user@envs.net:~`<br />
sync website from remote:<br />
&nbsp;&nbsp;`rsync -avz -e "ssh -p 2223" user@envs.net:~/public_www ~/`<br />

## &#35; sftp usage
connect: `sftp -oPort=2223 user@envs.net`

### commands:
&nbsp;&nbsp;exit: `exit`<br />
&nbsp;&nbsp;print help: `help`

### transferring
files to remote:<br />
&nbsp;&nbsp;`put localfile remotefile`<br />
dir to remote:<br />
&nbsp;&nbsp;`put -r localdir remotedir`<br />
files from remote:<br />
&nbsp;&nbsp;`get remotefile localfile`<br />
dir from remote:<br />
&nbsp;&nbsp;`get -r remotedir localdir`

### example:
add index.html to public_www Dir:<br />
&nbsp;&nbsp;`put public_www/index.html public_www`<br />
add ~/.ssh/authorized_keys:<br />
&nbsp;&nbsp;`put .ssh/authorized_keys .ssh/authorized_keys`

### single line usage (on local machine)
&nbsp;&nbsp;to remote: `sftp -P 2223 user@envs.net:remotedir &lt;&lt;&lt; &#36;'put localfile_path'`<br />
&nbsp;&nbsp;from remote: `sftp -P 2223 user@envs.net:remotefile localfile`

## &#35; daemonize processes
so you've got a process that you want to keep running. you might have it in a<br />
tmux or screen session. let's use systemd user units to manage it!

- ensure that your user unit loadpath is set up:<br />`mkdir -p ~/.config/systemd/user/`
- create a basic service. save something like this<br />in `~/.config/systemd/user/my-new-service.service` (adjusting where necessary)
```bash
[Unit]
Description=my script description
[Service]
ExecStart=/bin/bash -c "while true do; echo hi; done"
[Install] WantedBy=default.target
```
- enable it:<br>`systemctl --user enable --now my-new-service.service`
- enable-linger for your user account:<br />`loginctl enable-linger`<br />this allows your user units to run even when you're not logged in.

done!<br />
you can now use `systemctl --user` to manage your daemonized process.

+ 3
- 0
mkdocs.yml View File

@@ -0,0 +1,3 @@
site_name: envs.net - help
repo_url: https://github.com/envs-net/help
theme: cyborg

Loading…
Cancel
Save