Tuesday, September 13, 2016

WebCheck: A way to watch websites for change in content

There are a lot of times when quick updates are essential to a task. For example when universities release examination forms, or when there is an on line sale for something, or even better, when your favorite blog author publishes something new.

RSS was built to handle such situations, but as we all know, people don't always follow standards. In cases where RSS has not been implemented by site authors, we may use webcheck to keep a watch on the site for changes.

This is a Python3 dependent script that I've used for some time now to keep track of entrance exam notifications. The software and it's installation instructions can be obtained from:

https://github.com/theSage21/reimagined-chainsaw

The way this works is simple.

  1. Get a list of links to watch from a file provided by the user
  2. Download each link and call it the reference page
  3. After a certain amount of time, download everything again and see if something has changed with respect to the reference pages
  4. Repeat 3

Saturday, August 13, 2016

Last Man Standing

When men collide in the ring
The body is the first to go.

What keeps them up, fighting
Is their will, "not yet! no!"

Yet, what keeps me going,
are my fears, "Atelophobia. Go!"

In this fight betwix life and me,
Will nor fear, shall guide.

What will define moi, in this ring,
with all will and fears banding.

Is that with all my soul!
I want to be the last man standing.




Wednesday, July 20, 2016

Phone As Raspberry Pi Screen


I usually have to work on a cluster in the college and all I need is a client to connect to that cluster. The Raspberry Pi is a great alternative to my laptop which has recently started to die of old age.

The problem I face with the PI is however quiet a different one. I usually don't have a projector / display around to see what I'm typing in. This is a workaround to that problem. Since I almost always have my phone around, I decided to use that as a display. 

Do note that this does not mean that you will have full graphics. It just let's you see what you are typing on a terminal in the Pi. For full graphics you would need some sort of VNC setup.



Let's get started.
  1. Hardware Required
    1. Raspberry Pi
    2. Wifi Dongle
    3. Keyboard
    4. Mobile Phone (Android / iPhone etc)
    5. Working internet connection (For setup purposes)
  2. Software required
    1. On Raspberry pi
      1. ssh-daemon (This is preinstalled if you are using NOOBS). Otherwise use sudo apt-get install sshd
      2. Tmux ( can be installed via sudo apt-get install tmux)
      3. In case you don't like tmux for some reason, you may be able to use screen in a similar fashion as described.
    2. On phone
      1. Some sort of SSH client. I use Juice SSH but you are free to use any one.
      2. Since I have never used Apple, I'm going to leave finding an SSH client there to you. comment below if you find one that you have used.
  3. Other requirements
    1. A keyboard for the PI would be nice, though you can use your laptop too in case you do not have one.
    2. The Raspberry pi needs to be able to connect with a network beforehand. See this resource.
    3. In case you have a router lying around, connect the Pi, phone (and laptop if needed) to the same router. Otherwise set up a WiFi hotspot in your phone and connect everything to that.
  4. Steps
    1. Power on the Pi
      1. Switch on the Pi.
      2. Plug in the wireless dongle.
      3. Let the Pi connect to the network
    2. Power on the laptop
      1. SSH into the raspberry pi
        1. ssh pi@192.168.xxx.xxx
        2. Windows users can use Putty
        3. Install Tmux via sudo apt-get install tmux
        4. use raspi-config command to make sure that the login procedure is login to command line
        5. exit the ssh session (Ctrl + d)
    3. Reboot the Pi
      1. Connect a keyboard
      2. You will be logged in to the PI user automatically as per the last config.
      3. type tmux new-session -s main
        1. This opens a new tmux session.
    4. SSH into the Pi using your phone (Juice SSH)
    5. Using your phone type in tmux attach -t main to the terminal you have just opened.

You can now see the same tmux session which is running on your PI. Whatever you type in the keyboard appears on your phone. This allows you to use your phone as a temporary display for the Raspberry pi terminal.

Here's a demo video.