Skip to content

basic help#

write on matrix
for any help requests and community support.

# show public ip#


# the null pointer - aliases#

add the following lines to your aliases file ~/.bash_aliases

0file() { curl -F"file=@$1" ; }
0pb() { curl -F"file=@-;" ; }
0url() { curl -F"url=$1" ; }
0short() { curl -F"shorten=$1" ; }

HTTP POST files here:
  0file "yourfile.png"

post your text directly:
  echo "text here" | 0pb

you can also POST remote URLs:
  0url ""

or you can shorten URLs:
  0short ""


if you want a nice wrapper, try ~tomasino's pb

# ssh#

your ssh directory is: ~/.ssh/, which includes the following files:

  • your ssh config file ~/.ssh/config (more below)
  • the authorized_keys, this file is a list of public keys (one per line) that are allowed to log in to your user account.
  • id_ed25519 or id_rsa are each private keys, and or are the corresponding pubkey.


Algorithm Fingerprint
RSA SHA256:7dB470mfzlyhhtqmjnXciIxp+jWLACiYKC3EE/Z0lFg
ED25519 SHA256:V+mXTsRJ+jfJMxxPlD/28dpWouuns3Wuqwppv6ykVC8

the key fingerprints are in dns as sshfp records as well, which you can check against
by setting VerifyHostKeyDNS to yes in your ~/.ssh/config.

you can check the records yourself with the dig tool like this:
  dig sshfp

ssh details and usage#

ports 22, 80, 443, 2222 and 2223 are available for ssh
use to reach the secondary ip and use 80 and 443 for ssh.
so, for example, you can do:
  ssh   ssh -p2223

or for the secondary ip:   ssh -p443


if you have a slightly shaky connection then you can also use mosh.

> ssh windows usage > ssh mac usage

create a ssh-key#

make sure you have a ~/.ssh directory
  mkdir -m 700 ~/.ssh

create your key
  ssh-keygen -t ed25519 -a 100

your public and private key will be located at
  cat ~/.ssh/

you can also use rsa:
  ssh-keygen -t rsa -b 4096
  cat ~/.ssh/

ssh config#

define ssh host aliase in ~/.ssh/config

  Port 2223
  User user
  LocalForward localhost:6667 localhost:6667

now you can use a simple ssh to connect.
there are tons of other options, including this LocalForward line to automatically set up the tunnel as show below.
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),
but your local network blocks znc ports. you can connect to, and use port forwarding to get on.

if you are connecting from a linux machine, you can do this:
  ssh -L 6667:localhost:6667

after being logged in, open your local irc client, and use
for your server setting. voila! you're now on znc server.

what that ssh command did was open a local port tunnel (-L), using local port 6667 (6667:)
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 > ssh > tunnels.

you can do this for any arbitrary port.

import & authorize a public ssh-key#

from URL (on remote machine)
  echo $(curl -sL | tee -a ~/.ssh/authorized_keys

over ssh (on local machine)
  ssh-copy-id -i ~/.ssh/ -p2223;

ssh remote execution#

ssh ping

  ssh bash -c "'uname -a'"

exec a local script
  ssh 'bash -s' <

# scp usage#

copy ssh pub key to remote:
  scp -P 2223 ~/.ssh/authorized_keys

copy website index.html from remote:
  scp -P 2223 ~/public_www/

# rsync usage#

sync website to remote:
  rsync -avz -e "ssh -p 2223" ~/public_www
sync website from remote:
  rsync -avz -e "ssh -p 2223" ~/

# sftp usage#

connect: sftp -oPort=2223


exit: exit
print help: help


files to remote:
  put localfile remotefile

dir to remote:
  put -r localdir remotedir

files from remote:
  get remotefile localfile

dir from remote:
  get -r remotedir localdir


add index.html to public_www Dir:
  put public_www/index.html public_www

add ~/.ssh/authorized_keys:   put .ssh/authorized_keys .ssh/authorized_keys

single line usage (on local machine)#

  to remote: sftp -P 2223 <<< $'put localfile_path'
  from remote: sftp -P 2223 localfile

# your shell#

avaliable shells: ash, bash, csh, dash, elvish, fish, ksh, mksh, sash, sh, tcsh, xonsh, yash, zsh
list all available shells: more /etc/shells

to change your shell use: chsh -s $(which <shell>)
or chsh -s <path_to_shell>

example: chsh -s $(which bash) or chsh -s /bin/bash

default byobu-session#

familiar with tmux, continue as normal, but with ctrl-a instead of ctrl-b
if you don't want to this happen by default when you log in, run byobu-disable.

man byobu for more info.

press shift-f1 for a full list of keybinds
f2 creates a new tab
f3 and f4 move you between tabs
f6 disconnects and leaves everything running
shift-f12 disable/enable byobu f-key bindings

# timezone#

The timezone by default on the server is UTC.

If you want to make it so that your shell prints out dates in localtime for you,
run tzselect to find the correct timezone name that you’ll need to export as the TZ environment variable.

for example, if you’re in eastern time, add something like this
export TZ="America/Detroit"
to your ~/.profile.

to get your timezone you can use date.

# scheduled activity#

the linux utilities cron and at are related commands. you might use crontab, for example, to perform a task each morning at 2 a.m., and use at to remind yourself of an appointment later in the day.


the cron utility allows you to schedule a repetitive task to take place at any regular interval desired.
for more information see the manual pages of crontab(5) and cron(8)

display current crontabs:
  crontab -l

add/edit crontabs:
  crontab -e

example: - backup your mysql db once per day

# NOTE: * To disable email notifications use:
#         - for single cronjobs use after the cmd: >/dev/null 2>&1
#         - comment out to disable all email alerts in the crontab:
# m h   dom mon dow command
0   0   *   *   *   /usr/local/bin/ backup


the at command lets you specify a one-time action to take place at some desired time.
for more information see the manual page of at.


# schedule task to execute just after 1 hour.
echo 'sh' | at now + 1 hour
# schedule task at 10:00 AM on coming sunday.
echo 'sh' | at 10:00 AM Sun
# schedule task to execute at midnight.
echo 'sh' | at midnight

view your at queue:
  at -l or atq
  2 Sun Dec 29 14:03:00 2019 a creme

delete at job id 2:
  at -r 2 or atrm 2

# daemonize processes#

so you've got a process that you want to keep running. you might have it in a
tmux or screen session. let's use systemd user units to manage it!

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

you can now use systemctl --user to manage your daemonized process.