Project - [GUI-based FTP client for KolibriOS] (https://summerofcode.withgoogle.com/projects/#5072256724107264)
- Add proper error handling [Modification]
- Refactor code to decouple console code and core FTP code [Flow diagram] [Modification]
- Console
| require 'formula' | |
| class Sshpass < Formula | |
| url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.09/sshpass-1.09.tar.gz' | |
| homepage 'http://sourceforge.net/projects/sshpass' | |
| sha256 '71746e5e057ffe9b00b44ac40453bf47091930cba96bbea8dc48717dedc49fb7' | |
| def install | |
| system "./configure", "--disable-debug", "--disable-dependency-tracking", | |
| "--prefix=#{prefix}" |
| # The script sends an email with updated IP address | |
| # whenever there is an IP change from ISP | |
| MSG="To: [email protected]\nFrom: [email protected]\nSubject: New IP\n" | |
| IP_FILE=/home/nisarg/ip-address.txt | |
| IP=$(/usr/bin/dig +short myip.opendns.com @resolver1.opendns.com) | |
| OLD_IP=$(cat $IP_FILE) | |
| if [ "$IP" != "$OLD_IP" ]; then | |
| echo $IP > $IP_FILE # save new IP to file | |
| MSG="$MSG\n$IP\n" # add IP to message body |
| #!/usr/bin/env python | |
| """ | |
| Very simple HTTP server in python. | |
| Usage:: | |
| ./dummy-web-server.py [<port>] | |
| Send a GET request:: | |
| curl http://localhost |
| #Implementation of 'Game of Sticks' (http://nifty.stanford.edu/2014/laaksonen-vihavainen-game-of-sticks/handout.html) | |
| #Instructions | |
| #In the game of sticks there is a heap of sticks on a board. | |
| #On their turn, each player picks up 1 to 3 sticks. | |
| #The one who has to pick the final stick will be the loser. | |
| import random | |
| hats=[0] |