CoderDojo Dublin @ The Warehouse

The Warehouse

The making of Cyberstick

Posted on June 1st, 2017

What is Cyberstick?

Cyberstick is a temporary cloud server. What this means is that you can store files here for 15 minutes to have someone download them and then forget about them. This can be used among friends; if you want to share a song you just made in garageband, pop it into Cyberstick and give them the three word key. What if you wanted to move a photo onto your computer from your phone and don’t have a cable handy? This website works perfectly on mobile devices and should not cause any problems.

How does Cyberstick work?

Cyberstick is built in Python using the open-source libraries shutil, pdb, stripe, jinja2, python-flask, werkzeug, urllib2 and TinyDB.

When a user opens the upload page, the server builds a session ID by picking 3 random numbers with the built-in Python function randint, which are used to select 3 words from a list. The server then creates a session folder locally with the naming system [UNIX time]-[Session ID].

The server displays a webpage created by injecting content into a custom-built jinja2 template. This template contains a drag ‘n’ drop box for uploading files and the session ID which is passed through jinja2 as a string. Any files that are uploaded are saved to the session folder.

Another python script has a loop which lists all sessions folders and compares the marked UNIX time to the current UNIX time and if the folder is over 900 seconds, wipes the content of the folder and then deletes the folder.

The download link is created using the session ID so it is easier to remember and communicate.

The API simply sends a request to the server using curl http request. It requests an upload folder. The server builds it and responds in JSON giving the error code (if any) and the session ID. Using the received session ID, the API then makes a POST request to the server uploading the files. To download files, the API sends a download request with the session ID, the server responds with file names and the API downloads them directly.

When a user wants to create a user ID, they are redirected to a payment system that sends back a confirmation key such as stripe. When the server receives this confirmation key, it forgets it, generates an ID with 6 random words and checks that this ID has not been already used, and if it has not, saves it to the database together with the number of sessions that the user has bought. The last thing it does is it displays the user ID and saves it to an encrypted cookie. The name and payment information are not saved. To login, you must write the user ID. Sessions that are created by a user that is logged in, the folder name includes the user ID. This allows the user to see their own sessions for the system scans the folders and displays the ones whose name contains the user’s ID. The user can also add more sessions to their user ID by adding their key on the checkout page which causes the server to repeat everything in a normal purchase but without randomizing the key and using the given key instead.

Psst – – See the source code here, or the website in action here.


My Day at the BTYSTE on the CoderDojo stand

Posted on January 26th, 2017

I arrived at the RDS at 8.30 with my Mum and Dad’s laptops, a suitcase full of projects, LEDs and a pretty substantial lunch. My Mum and Dad were just as shocked as I was when I saw so many people queuing up to get in.

Pete from CoderDojo met us at the front door 5 minutes after we arrived. We were one of the first people to get into the RDS. I felt like a VIP! Pete lead us up to our stand and carried my Mum’s heavy laptop bag. Then my Mum had to leave to go to work. After that my Dad and I started setting up.

 

We set up the Bluetooth controlled Neopixel LEDs, the LED Matrix Scroller, the Line Following Robot and the Flashing Mini Christmas Tree. Pete showed me the mBot robot he made at CoderDojo. Ross from CoderDojo took this picture of me and put it on Twitter

A Teenage Exhibitor came at 9:15am and asked me about my Bluetooth controlled NeoPixel LEDs. When I showed him it he was amazed, and got other people to come over to me.

Some of the kids at our CoderDojo stand came over to me. Their names were Lucas and Evie. They made a self-driving car. They asked me a few questions about my website. When they finished asking me questions, I went over to their desk, leaving my Dad to mind the stuff. They showed me their self-driving car. It’s a remote control toy car they hacked. This type of hacking is not bad. It means taking something apart and making it do something else. They used Python to control the car.

 

It was after a few demonstrations that I decided to always show visitors to our stand my video first. This meant I did not have to repeat the same thing over and over.

Soon after that my school friends arrived. My teacher chose 6 boys to come to the RDS today. They loved my project and it was extra special being in my school uniform as all my school friends were very proud.

I showed them my Bluetooth controlled Neopixel Led Project.

It was 11:45am and I decided to have my lunch because I felt hungry. I had an Innocent Smoothie and a delicious roll.  About an hour later one of the kids beside me was eating chips and that made me hungry!! I asked my Dad if I could have chips (with salt and vinegar obviously!). He finally said yes, so I got the chips.

I showed some teenage girls my line following robot.

When I was wandering around the stand I saw Ross’ s Flappy Bird game. I followed the instructions (Put your hand on tin foil and keep it there) which were quite simple. I tapped my finger on to the piece of jelly and I could play Flappy Bird.

One kid showed me his design for a plane. He said that he knew how to do the hardware but not the software. I told him that when my website goes live it would be great to work with him. The whole idea of my website is to share ideas and to help kids. This is what I am doing here.

The CEO of the Raspberry Pi Foundation from England came over to our stand! He was one of the only people to ask me detailed questions about my project. I got a picture of him with Lucas, Evie  and 2 kids from other Dojos.

I finally got a chance to look at other stands like Analog Devices when my Mum came back from work.

I was very tired after all of that but I enjoyed the day very much…

Benjamin Murray



© CoderDojo Dublin @ The Warehouse 2015.
All rights reserved.