Suramya's Blog : Welcome to my crazy life…

September 9, 2018

Meet my new neighbors – Baby Pigeons!

Filed under: My Life — Suramya @ 1:14 PM

I have some new neighbors – a pair of Baby Pigeons are now happily living in my bedroom windowsill. I missed taking the photo earlier because the mom was always on or near the nest and I didn’t want to disturb/scare her into abandoning the nest.


Baby Pigeons!

I will be happy when they grow up and fly away because then I can resume scaring the other pigeons away as they are loud and very annoying in the morning.

– Suramya

September 6, 2018

There is now a company in Japan that resigns from your job for you.

Filed under: My Life — Suramya @ 6:16 PM

There is a startup in Japan which a person can to submit resignation notices to employers on their behalf. At first when I read the article I thought it was one of the more ridiculous ideas for a startup that I had heard about. However it stuck in my mind and I kept thinking about it, then I remembered how hard working Japanese people are and how strongly they believe in staying with one company for their entire carrier. In 2016, the average worker in Japan had been at one company for about 12 years so there is a strong stigma against quitting even if you are miserable at your job. Now there is a service called ‘Exit’ that offers a way around that.

“Quitting jobs can be a soul-crushing hassle. We’re here to provide a sense of relief by taking on that burden,” said Toshiyuki Niino, co-founder of Senshi S LLC, a startup he and childhood friend Yuichiro Okazaki launched last year.

The company operates Exit, a service that relays an employee’s intention to resign for a fee: ¥50,000 ($450) for full-time employees and ¥40,000 for part-time workers. Repeat clients get a ¥10,000 discount.

Whether or not people consider that expensive depends on how desperate they are. But if business is any indication, many regard it as a worthy investment for some much-needed peace of mind. In the one year since Niino and Okazaki set up shop, they have mediated the resignations of roughly 700 to 800 clients from across the nation as the number of requests surge.

I can understand the urge to offload the unpleasant task of quitting to another person/company but I feel its more healthy to face your fear and stand up for yourself. It will help increase your self-confidence and the ability to handle unpleasant situations.

Imagine what would happen if they tried to expand into India? Where at times people have offered their resignations over SMS or in some cases just not shown up for the work leaving their manager to figure out themselves that their employee is no longer interested in working with them.

What do you think? Is this a good idea or not?

– Suramya

September 3, 2018

Software hack to keep my speaker powered on

Filed under: Computer Hardware,Linux/Unix Related,Tech Related,Tutorials — Suramya @ 6:37 PM

A little while ago I bought a new klipsch speaker as my previous one was starting to die and I love it except for a minor irritation. The speaker has builtin power saving tech that powers it off if its not used for a certain period of time and that means that I have to physically power it on every time I wanted to listen to music which was annoying. As I would invariably be comfortably seated and start the music before remembering that I needed to power it on. Also, I could not start the music from my phone whenever I felt like as the speaker was powered off and I would have to walk to the room to power it on.

After living with the irritation for a while I finally decided to do something about it and whipped up a small script that checks if any music/audio is already playing on the system and if not it plays a 1 second mp3 of an ultrasonic beep. This forces the system to keep the speaker on and I love it as now I can start the music first thing in the morning while lazing in bed. 🙂

The script requires the mpg123 to be installed and you can install it on a Debian system by issuing the following command:

apt-get install mpg123

The Script itself is only 4 lines long:

#!/bin/bash

if ! grep RUNNING /proc/asound/card*/pcm*/sub*/status &> /dev/null ; then
    /usr/bin/mpg123 -q /home/suramya/bin/KeepSpeakerOn.mp3 &> /dev/null
fi

What it does is to check if any of the PCM soundcards have a status of RUNNING and if not it plays the mp3. I have a cron job scheduled to run the script every one min:

XDG_RUNTIME_DIR=/run/user/1000

* * * * * /home/suramya/bin/KeepSpeakerOn.sh 

One interesting issue I hit during the initial testing was that the mpg123 application kept segfaulting whenever I initiated it from the Cron but it would work fine if I ran the same command from the command prompt. The error I got in the logs was:

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.25.10; written and copyright by Michael Hipp and others
        free software (LGPL) without any warranty but with best wishes
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
/home/suramya/bin/KeepSpeakerOn.sh: line 5: 10993 Segmentation fault      /usr/bin/mpg123 /home/suramya/bin/KeepSpeakerOn.mp3 -v

Spent a while trying to debug and finally figured out that the fix for this issue was to add XDG_RUNTIME_DIR=/run/user/<userid> to the cron where you can get the value of <userid> by running the following command and taking the value of uid:

id <username_the_cronjob_is_running_under> 

e.g.

suramya@StarKnight:~/bin$ id suramya
uid=1000(suramya) gid=1000(suramya) groups=1000(suramya),24(cdrom)....

Putting that line in the cron entry resolved the issue. Not sure why but it works so…

Well this is all for now. Will write more later.

– Suramya

Powered by WordPress