-
Install Windows GIT
-
Start the bash shell
-
Get a login and password for the system using
curl -X POST https://SERVERNAME/adduser
-
Follow the instructions to generate your own key pair and configure your logon to using keys rather than password
-
Once logged in clone this repository
git clone [email protected]:teyc/b2b.git
-
Then go to the exercise directory
cd b2b/exercise
-
First commands
cal
echo Microsoft loves linux cat hello.txt more /usr/share/doc/adduser/examples/README man more pwd ls ~ ls -l /bin/net*
-
Identify the Read Write Executable bits when you list files in a directory. Observe that greet.sh is executable. Try running it.
./greet.sh
-
You can modify the executable bit by using
chmod
chmod uga-x greet.sh
-
Run tasks in the foreground
sleep 5; echo I have snoozed enough!
-
Run tasks in the background
bash -c "sleep 5; echo I have snoozed enough!" & cal cal
-
Use
history
to get your past commands, and use bang number e.g. !5 to run command number 5. -
Use bang and first few letters e.g. !ps works as well
-
Use arrow up and down, and CTRL+A and CTRL+E to move to start and end of line
-
Try
ifconfig find .. -iname '*.md' which docker
-
Write a telnet service!
echo "Microsoft <3 Linux" > hello.txt
nc -l 58016 < hello.txt &
telnet localhost 58016
-
Daemonize it
echo '#!/bin/bash nc -l 58016 < hello.txt ' > greet.sh
chmod a+x greet.sh
daemon -r -D
pwd
./greet.shnc localhost 58016
-
You can turn this into a HTTP service
echo 'HTTP/1.0 200 OK Content-Type: text/plain Microsoft Loves Linux' > hello.html
Then check it out using curl
curl http://localhost:58016/
-
Clear the screen using
CTRL+L
-
top
-
htop
-
dstat
-
strace ls strace python
-
netstat -ae
-
opensnoop
What's opening and closing the .txt files?
opensnoop '.txt$'
-
Enough Linux?
sudo docker run -it microsoft/dotnet cd ~ dotnet new dotnet restore dotnet build dotnet run ls -l
-
To log out from docker, use CTRL+D
-
To log out from your session, use CTRL+D
-
Note, this machine has 2GB memory, docker is virtualization without the overhead
Set up the machine by running
sudo ./reset-the-world.sh
This should automatically run up the web service. If you need to do this manually, refer to
ssh -i ~/.ssh/id_rsa chui@SERVER
cd b2b
sudo python app.py 443