Skip to content

Instantly share code, notes, and snippets.

View krab7191's full-sized avatar
🖥️
Reacting positively to testing...

Karsten Rabe krab7191

🖥️
Reacting positively to testing...
View GitHub Profile
@krab7191
krab7191 / pi-ssh.sh
Created September 30, 2023 21:21
Shell script to SSH to raspberry pi wherever I am
#!/bin/bash
network=$(iwgetid -r)
echo "Connected to network: "
echo $network
if [ "$network" = "<Your home wifi SSID>" ]; then
echo "At home, SSH to pi on local network"
ssh username@pi-local-ip
else
echo "Not at home, SSH to pi at home public IP"

Keybase proof

I hereby claim:

  • I am krab7191 on github.
  • I am karstenrabe (https://keybase.io/karstenrabe) on keybase.
  • I have a public key ASCse6MZr8tO98mwPN8iv4BfqZ0yaSarg2aL-pO8-1g77Ao

To claim this, I am signing this object:

@krab7191
krab7191 / README-Template.md
Created October 19, 2019 18:38 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@krab7191
krab7191 / guess.js
Created February 7, 2014 20:43
guess.js
/*Write a JS guessing game that picks a random, secret number between 1 and 100, lets the user take up to 5 guesses, and states if the secret number is equal to, higher, lower than a guess. Read input from stdin and print to stdout.*/
var correct = Math.floor(Math.random()*100)+1;
//console.log(correct);
var MAX_TRIES = 5;
var readline = require('readline');
var rl = readline.createInterface(process.stdin, process.stdout);
var guesses = 0;
config.vm.network "forwarded_port", host: 8080, guest: 8080
targeting localhost:8080 in the browser brings up the same 'Not found' message, and displays the same GET requests to the http-server in the VM.
Running http-server on localhost:8080
browser window displays 'Not found', and command prompt diplays a GET request from windows 64 bit machine at specific date and time. Refreshing the page prints another request in command prompt.
This looks like a virtual server is created in the VM, which can be accessed through the computer's IP address at port 8080 which is for http and web traffic. There are no files on the server which is why it prints 'Not found'.
TotTbox has 2 processors, (range 1-4?)
Base memory: 2048 MB per, 4096 total
Video Memory: 8MB
Tottbox disc 1: 9.9 GB virtual memory, 1.88 GB actual size
Halt attempts a "graceful shutdown" of the VM
reload starts at clearing forwarded ports and network interfaces, skips default and import base box then re-ups vagrant
destroy completely nukes VM and associated drives
up creates the VM from defaults, importing base box
suspend saves the VM state and suspends execution