Alcoholism in movies

Tags

, ,

Drinking is not an Indian culture. I don’t say that nobody drinks.. But, people will have a guilty feeling when they do.

In olden movies, the actors will drink only when they are sad or bad (villains). If the good guy drinks, either he will die because of drinking or he will quit drinking.. That kind of made sense. But, nowadays, the hero or his friend drinks. Whether they are happy or sad doesn’t matter. As if it is part of daily life.. There are very very very very few movies that doesn’t have alcohol in it in the past 5-6 years.. This sends a wrong message to the next generation.

I read that, the government makes a lot of profit from wine shops. Somehow this makes me think whether the government is indirectly forcing the media industry to have atleast one scene where somebody drinks…

If the directors say that the story needs it, how did the (g)older movie directors made movies for ages without any drinking scenes.. Can anybody show/name me a movie where MGR had alcohol?? Didn’t those stories had the so called “situations”? If he wanted, do you think he couldn’t have included such scenes? Because, he wanted to send ONLY the RIGHT messages to people. And HE STOOD BY IT.

Don’t BS me saying that this is the culture now. Still, there are millions who are afraid to go home after taking drinks and don’t drink for that reason alone.

Showing “Drinking is injurious to health” at the beginning of the movie alone is not enough.. If you really mean it, why the *** do you need those scenes in your movies??

Film industry, Movies have a greater reach. It is a powerful media.. Do not misuse it and Please DO NOT SPOIL THE UPCOMING GENERATION.. By watching the movies, we can build an opinion about those olden days.. This is also like recording the culture in history.. DO NOT DEFAME OUR CULTURE…

Recursively list files (with space in their names)

Tags

, , , , , ,

Today, I had to do a long list of files inside a folder recursively. I tried using

find <folder> | xargs ls -l

This failed miserably when the folders/files inside the search location had space character in it. Searched for sometime and came across:

find <folder> -print0 | xargs -0 ls -l

Its kool..

-print0 prints null character as line delimiter and -0 (for xargs) takes null character as line delimiter and passes that input to ls.. Nice one :)

Security issue on linux??

Tags

, , , ,

Recently, I was playing around with creating users and groups on my machine and observed a weird behaviour.

Created a user first and made that user to be the owner of a folder.  And, deleted that user and created another user. Now, this new user became owner to the folder.

How could this happen?

I think the ownership is assigned to the User’s ID and not the name.

How is the ID determined?

It gets the highest ID of the existing users and adds one to it and assigns it to the new user. ie. Lets say I have users with IDs 1000, 1001 and when I delete the user with ID 1001, and create a new user, that user gets 1001 as ID. If 1000 is deleted instead of 1001, the new user will get an ID of 1002.

I tried this on Ubuntu and SuSE so far and observed this on both. I agree that the system admin has to take care of restricting access to users so that they will know what all folders the user has access to. So, when the user is deleted, the admin can take care of resetting/revoking permissions. But still, Im thinking, isn’t this is a serious security issue? Coz, this newly created user got rights to folder that was not intended. Shouldn’t the system itself should take care of allocating unique IDs to users??  Any thoughts from anybody?

Future of Software Developers

Recently, I attended a Java training. We have done all of the exercises in our college days itself. But, we used loooots of new stuff. We write abstractions over our code. They have some abstractions.. There are more abstractions over the previous ones.. For example: We have SQL/JDBC (Low level). We have hibernate and that is an abstraction over this. And JPA is another API that can provide an abstraction over hibernate..

On looking at things, I get a feeling that: After 5 years, there will be only two kinds of software developers. One who create abstractions, and the other, consumes abstractions. The consumer’s fate will be:

* After 5 years, No Java developer will know what is “new” operator

* After 5 years, Nobody will know how to write SQLs..

* After 5 years, Nobody will know how things actually work.. What happens behind the scenes…

* After 5 years, Companies will hire people with more memory power rather than their abilities.

And after 10 years, they’ll be just like some electricians who doesn’t know how things work. Only, knows how to assemble things.. If something goes wrong, the response will be, replace this with a working one…

After 20 years, people will not know what is going on.. how to debug issues.. why things are happening the way it is happening.. All these due to these levels of abstractions.. Finally, one fine day, they will say, Lets start writing our own SQLs and our own code…

Another UID???

I thought of making my blog to be more technical than social.. But, what Im am doing is in total contrast to my thoughts!! :(

Recently came to know that our Government is planning to provide an unique number for PF that will be called as Universal Account Number (UAN). This will be the new number that we can use for our PF accounts. Good Idea???

How many numbers are they going to give.. We already have Driving License, RC Book, Gas Connection, PAN, Phone Connection, Bank Accounts, Passport, blah blah blah… hundreds of things.. If I have to do a change of address, think about what all I have to do..

My question is, why don’t they use Aadhar in the first place? As a citizen, I should update my details in Aadhar and be done with it. And from then on, all the utilities should use the new detail. I don’t think this task will be a difficult task for the Government. May be initial investment is high. But, once things are set, it will be easier for government and citizens..

An Observer Pattern should be enough… (At last, could link something technical in this blog) ;)

My colleague used to say, “I am OK with taking a short term pain for a long term gain”. But, looks like our government is “OK with taking a long term pain for a short term gain”

Scary Marketting World!!!

A few days back, I was watching “Brain Games” on NGC.. The subject was about Persuasion. It was a re-telecast. The first time, I saw only towards the end.. May be last 5 mins or so… In that, they asked a fill in the blanks kind of question.. The question was: I am feeling thirsty. So, I need a glass of : (Options) Water, Milk and something else (that I don’t remember now)

When I watched for the first time, my answer was Water. Big Deal!! After that, the host said, We know the answer you would say is Milk. Because, WE PUT IT IN YOUR BRAIN and showed a few scenes (from the same episode) that related directly or indirectly to Milk.. I didn’t believe as my answer was Water. But, the second time, after watching the complete program, automatically “Milk” came to my mind.. I was so shocked when I realized that my answers are different in both the occasions.

And they said that, these kind of techniques are followed by the marketing people to attract us to buy their product. Those brands will have experts in these subjects. Also, I saw an ad recently that says something like: Every one person in some X number will get this disease. And YOU could be the one.. WHAT THE XXXXXX.. After watching that “Brain Games” episode, I feel that this can indirectly create an impact in our brain and that is not good.. May be, there should be a censor board or something that has some Brain experts who monitors such Ads and block them from showing.

From our side, we need to be very careful in taking decisions. I think some marketing people doesn’t give enough time to make our decisions. They will give a very attractive offer and say you have to decide with this time which may not be possible. We may not get enough time to think through the pros and cons of that offer. To avoid missing the offer, we’ll step further which obviously will benefit them.. We need to be careful in making such decisions.. We need to really really think before making such decisions.. I KNOW THIS IS VERY VERY VERY DIFFICULT. But, …

Reading file/folder path in bash

Sometime back, was working with a colleague and came across a new requirement. We needed a script that takes a path as input. (It is an interactive shell script) The catch is, we wanted to provide some flexibility for the user and so we wanted the path to be auto-completed. (tab fills up the path)

When we tried “read -e path” and “echo $path“.. it didn’t help :( So, we did a “man read” and found that read can store the input in REPLY variable and you can use it.

read -e
echo $REPLY

This worked.. When we used tabs, it auto-filled and we can use REPLY variable to get the input.  This was tried on an SLES machine. When I tried “read -e path” on ubuntu, auto-completion itself worked. So, looks like the auto-completion is different between SLES and Ubuntu..

Moral of the story: (Apart from Ubuntu is convenient), read stores the input in REPLY variable and that can be used in your scripts :)

Nemo Actions (Comparing Multiple files)

If you had followed the steps in my previous post, by now, your nemo will be able to select a file and compare it with another file. If you think it should also have the ability to compare multiple files when you select them, Go ahead. Read on!!!

Now, you need copy the content below to $HOME/.local/share/nemo/actions/compare-multi.nemo_action

[Nemo Action]
Active=true
Name=Compare selected items
Comment=Compare %F saved file or directory.
Exec=/usr/bin/meld %F
Icon-Name=meld
Selection=M
Extensions=any
Quote=double

Nemo Actions (Comparing Single file)

I have been using Nemo as my file browser for almost a year now.. Since nautilus lost the most used features and started assuming things that I never intended to…

Recently, I had to do a comparison of a few text files and had to go to console and open the diff viewer.. Thought, what if nemo had this ability in itself (something like in the right click menu).. Started searching for it and found a link that talked about how this can be accomplished.

Abstract:

You need to create the following files (along with their contents) in .local/share/nemo/actions under your home directory. (System wide location : /usr/share/nemo/actionsI haven’t tried it yet though.. But, it should work.)

nemo_action files are the files that creates menu entries in the pop-up dialog that comes up when you right click. These files are read by nemo whenever you right click. The syntax is similar to a .desktop file. You can invoke a script from these nemo_action files that does your job. If you want to change the script, feel free to do so. And to verify your changes, all you have to do it save the changes and right click on nemo :).. (I know how happy a software engineer will be for not having to wait for testing their changes)

You can have a look at /usr/share/nemo/actions/sample.nemo_action and /usr/share/nemo/actions/myaction.py. These files have detailed information on what each field in the action files indicates. Really simple and useful :)

We are going to add options to:

  • Select for comparison (We are selecting a file that we need to compare with)
  • Compare with selected file (Compare with the file selected in previous step. This option will be visible only when a file has been already selected for comparison.)

How are are going to add those options?

Simple. Do what we have been doing all these years (In short, Copy Paste) the exact content given below as it is. It will work :)

Lets get into action:

$HOME/.local/share/nemo/actions/compare-save-for-later.nemo_action

[Nemo Action]
Active=true
Name=Compare later
Comment=Save file for comparison later.
Exec=<compare.sh save %F>
Icon-Name=meld
Selection=S
Extensions=any

$HOME/.local/share/nemo/actions/compare-with-saved.nemo_action

[Nemo Action]
Active=true
Name=Compare with saved element
Comment=Compare %F saved file or directory.
Exec=<compare.sh compare %F>
Icon-Name=meld
Selection=S
Extensions=any

$HOME/.local/share/nemo/actions/compare.sh

#!/bin/bash
savedfile=/tmp/compare-save-for-later.$USER
comparator=/usr/bin/meld

if [ -L $0 ] ; then
DIR=$(dirname $(readlink -f $0)) ;
else
DIR=$(dirname $0) ;
fi

if [ "$1" == "save" ]; then
echo “$2″ > “$savedfile”
chmod 700 $savedfile
else
“$comparator” $(cat “$savedfile”) “$2″ &
mv $DIR/compare-with-saved.nemo_action $DIR/compare-with-saved.nemo_action1
rm -f $savedfile
fi

if [ -f $savedfile ]; then
mv $DIR/compare-with-saved.nemo_action1 $DIR/compare-with-saved.nemo_action
fi

NOTE:

If you think your file names may contain spaces in them, then you can add Quote=double to the nemo_action files mentioned above. Nemo encapsulates each path in double quotes and passes it to the diff viewer.

Buddy Pounce!!!

How many times, you had to ping somebody and (s)he is offline and you want to be notified when (s)he comes online so that you can continue doing what you were doing instead of keep on checking whether (s)he has come online or not!!!

My first long sentence after a loooooong time!!!

In Pidgin, you can Select a buddy and “Add Buddy Pounce…”. It gives a load of options on when you want (somebody comes online/sends message/becomes idle……….)to do what (Send a message/Popup a notification…..)

Kool feature that I liked :) It helped me solve a problem that I have mentioned in one of my looooongest sentences :D

Follow

Get every new post delivered to your Inbox.