Skip to content
Documentation

Using ShamashCyber

Start here if this is your first session. Every command on this page is meant to be run as written.

On this page

What ShamashCyber is#

ShamashCyber is a browser development workspace. After you sign in you are inside a Linux session that holds your project files and a terminal. You can use Git, start a local web server, and open that server through an HTTPS address.

It is not an online editor that runs your code somewhere else, and it is not a tutorial sandbox. The commands you type run in your session.

The only entry point is workspace.shamashcyber.com. Everything else on this site is documentation.

Your first five minutes#

Open a workspace, then use the terminal to confirm where you are and which tools are available. These checks change nothing and they make later troubleshooting much shorter.

terminal
pwd
whoami
git --version
python3 --version

mkdir -p ~/projects/first-session
cd ~/projects/first-session
If a command is not found

That means the workspace image does not include that tool. It does not mean the workspace is broken. Ask whoever set up the image, or use a tool that is present.

Where to keep your work#

Keep projects in a normal directory under your home directory, such as ~/projects. Storage is separate from the session, so stopping the workspace does not remove those files.

terminal
mkdir -p ~/projects/persistence-test
cd ~/projects/persistence-test
date > created.txt
printf 'persistence test\n' >> created.txt
cat created.txt

Stop the workspace the normal way, start it again, then read the file back. If it is still there, persistence is working as expected.

terminal
cat ~/projects/persistence-test/created.txt
Do not keep work in /tmp

Temporary directories are for temporary data. Anything you need next week belongs under your home directory, and anything you cannot afford to lose belongs in a Git remote as well.

Terminal commands you will use daily#

The terminal is an ordinary Linux shell. These are enough for navigation and file checks during most lab sessions.

pwdPrint the directory you are currently in.
ls -laList files, including hidden files, with permissions.
cd ~/projectsMove into your projects directory.
mkdir demoCreate a directory named demo.
cp -r src destCopy a file, or a directory with -r.
mv old newMove or rename a file.
cat filePrint the contents of a file.
Be careful with rm

Deleting from the shell is immediate and there is no recycle bin. Read the path before you press enter, and be especially careful with -r and -f together.

Using Git from the workspace#

The usual workflow is to clone a repository, create a branch for your work, check what changed, then commit when the result is ready.

git
cd ~/projects
git clone <repository-url>
cd <repository-directory>

git switch -c feature/my-work
git status
git add .
git commit -m "finish lab work"
Authentication

Use the sign-in or Git integration your workspace provides. Do not paste an access token into a source file, a README or a shell script, because those get committed.

How previews work#

Your application runs inside the workspace. When it listens on a port, the workspace can expose it through an HTTPS address in your browser.

terminal
mkdir -p ~/projects/preview-test
cd ~/projects/preview-test
printf '<!doctype html><meta charset="utf-8"><h1>Preview works</h1>' > index.html
python3 -m http.server 3000 --bind 0.0.0.0
Why 0.0.0.0 matters

A process bound only to 127.0.0.1 can be unreachable from the preview router. Listen on 0.0.0.0 unless your framework documents something else.

Leave the process running, then use the ports control in the workspace interface to open port 3000. Do not open port 3000 on the server firewall.

A working Python example#

This uses only the standard library. It serves one page on port 3000, which is enough to confirm that previews work end to end.

app.py
cat > app.py <<'PY'
from http.server import BaseHTTPRequestHandler, HTTPServer

class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        body = b"<h1>Hello from ShamashCyber</h1>"
        self.send_response(200)
        self.send_header("Content-Type", "text/html; charset=utf-8")
        self.send_header("Content-Length", str(len(body)))
        self.end_headers()
        self.wfile.write(body)

HTTPServer(("0.0.0.0", 3000), Handler).serve_forever()
PY

python3 app.py

Leave it running and open port 3000 from the workspace interface.

A working Node.js example#

Use this if Node.js is available in your workspace. It needs no npm packages.

server.js
node --version

cat > server.js <<'JS'
const http = require("http");

http.createServer((req, res) => {
  res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
  res.end("<h1>Hello from ShamashCyber</h1>");
}).listen(3000, "0.0.0.0");
JS

node server.js

Reading a preview address#

A preview address is built from your session. Each part before the domain identifies something concrete.

https://3000--main--web-lab--student.shamashcyber.com

  1. port3000
  2. branchmain
  3. workspaceweb-lab
  4. userstudent
Do not guess the address

The workspace and user parts come from the real session. Opening the port from the workspace interface is the reliable way to get a working address.

When something does not work#

Most problems in a lab session are one of these five.

The preview address does not load

Check that the process is still running and that it is bound to 0.0.0.0 rather than 127.0.0.1. Then confirm the port number matches the one you opened.

The port is already in use

Another process from an earlier run is still listening. Find it and stop it, or start on a different port.

terminal
ss -ltnp | grep 3000
My files are missing after a restart

Check whether the work was under /tmp or another temporary path. Files under your home directory should still be present.

A command is not found

The workspace image does not include that tool. Confirm with --version, and use an alternative that is installed rather than assuming the session is broken.

Git rejects my push

Usually authentication, or the branch has moved on the remote. Read the error text, then fetch and rebase or merge before pushing again.

terminal
git fetch origin
git status

Open a workspace and put something on a port.

The fastest way to understand it is to run one small project end to end. The docs walk through it in about five minutes.