_ __ | |__ | | ___ __ _
| '_ \| '_ \| |/ _ \ / _` |
| |_) | | | | | (_) | (_| |
| .__/|_| |_|_|\___/ \__, |
|_| ...2017-02-07 |___/
Make stuff move
I wrote a small program to demonstrate to a friend of mine how to "get stuff on
the screen and make it move" in C++, so the first thing I did was to disregard
most of the C++ features, and try to keep the code as simple as possible.
So the following example should be an adequate introduction to a beginner, but
won't satisfy anyone who's written C or C++ as a hobby before. Anyway, I thought
that since I already wrote it, and it's been a while, I'll go through how to get
it up and running, so you can start playing around with interactive computer
graphics, should you so desire. So skip this if you're not interested.
That reminds me that I should talk about how awesome git is, some day.
Hint to future self: Write about how to recover from an unintended amend.
The following is for Linux, Windows differences might be explained another day.
Makefile - Used by a tool called Make to build the executable
README - Because documentation
ball.cpp - Implementation of the ball class
ball.hpp - Class description of the ball class
ball.png - Picture of the ball (edit this in gimp for a personal touch)
bounce - Executable, might work on your 64 bit linux system, might not.
main.cpp - Implementation of the main program functionality
# Here's how to clone it with git, it brings down the code to your computer:
git clone https://github.com/DusteDdk/bounceball
# Then install libsdl2-dev, libsdl2-image-dev, make and the c++ compiler:
# If you use ubuntu you can do it like so, I think:
sudo apt-get install libsdl2-dev libsdl2-image-dev make g++
# To build the project:
# To run the program:
Just found this https://www.youtube.com/watch?v=2bA2Gnac9OY it's a music-video
cut from "Dredd" to Carpenter Brut - Anarchy Road, now, I'm not a big fan of
super hero movies at all, but the music injected into the images a depth that
I am sure is not present in the movie, but makes me curious to watch it anyway.
I'm going to start streaming soon, and I decided that the soundtrack should
include at least some Bola, I have their album "Gnayse", and Ladytron.
No reason to say this, just.. I like music! :)
Be careful with Docker, it's awesome, very good, but keep in mind that the
docker daemon runs with root privileges, meaning that he who controls the wale
controls not only the containers but can trivially escalate privileges on the
host machine. Here's how to root a docker-host if you can control the daemon:
In a shell, like bash:
docker run --rm -ti -v /:/mnt --entrypoint bash ubuntu
# Now you're inside the container..
# There we go, a root shell on the docker hosts filesystem.
Avoid it by:
Ensuring that only people who has to are members of the docker group.
NEVER mount the docker socket into a container, run dind instead.
Don't open the rest API unless needed, and take steps to secure it.