Sunday, May 17, 2015

UNIX Gem 3: How to display, segreggate file types:


We have several types of files in a directory (txt,pdf,.pl,.c etc) and we want UNIX to seggregate the file based on their types. How can we achieve this. UNIX has a command file. If we want to display the file type for txt file, just type in
>file filename.txt
If we want to display types for entire files:
file *
If we want to display set of files:
file file1 file 2 file 3
sample output:
file *
sound:                   directory
speech-dispatcher:       directory
ssh:                     directory
ssl:                     directory
sudoers:                 regular file, no read permission
sudoers.d:               directory
sysctl.conf:             ASCII English text
sysctl.d:                directory
systemd:                 directory
terminfo:                directory
thunderbird:             directory
timezone:                ASCII text
ts.conf:                 ASCII text
ucf.conf:                ASCII English text
udev:                    directory
ufw:                     directory
updatedb.conf:           ASCII text
update-manager:          directory

Sunday, May 10, 2015

Unix gem: Truncating file

We know how to truncate a table in SQL,i.e. retain the structure of the table removing the contents of the table.
In UNIX ,lets say we want to remove the contents of the file and retain the empty file (zerobyte file). How can we achieve this.

➡ One way is to delete the file completely and recreate it.

➡The second method is to open the file using an editor such as vi and delete each line and save.

But what if we want to truncate the file on the fly?

Consider the problem statement:

Check if the file called dataflow has been sent by upstream and count the number of records. If records exceed threshold (value of 10,000) truncate the file and FTP it to the remote server indicating threhold breach-incorrect records. Else FTP the file as it is.

UNIX has a command for this:

We can use
cat >dev >null dataflow

This would make the file zero byte

A simple hueristic for the above problem will be

If exists file then
If
wc -l dataflow gt threshold
cat >dev >null dataflow
Ftp servername (pick credentials from .netrc)
Put dataflow
Bye
Else
Ftp file intact.

Unix Gems

In the next posts time and time I will brush up some important Unix related stuff that can be used as a quick reference. These are some important commands,info that are dug from the grounds of Unix. And hence gems

Saturday, May 9, 2015

20 reasons as How I wonder Why Jurassic movie again

Coming to the next ten reasons
11. Jurassic World is said to be homage to Jurassic Park. This sounds optimistic.
12. Jurassic World would bring back old memories and nostalgic values..wish we were kids again.
13.The featurette had Spielberg himself praising the movie..
14. It would be refreshing to see 'Jurassic' dinos again on the screen.
15.It might ignite Jurassic Franchise again....
16.T rex is back from the original?
17.Chaos theory returns...
18. Waiting to see real dinosaurs in fully functional theme park..
19.Good to have a blast from the past..
20.Lets see what latest technology is to offer through the film.
I am looking forward to review every aspect of the movie once it hits the screen as it is being decreed as the most awaited movie of 2015.

20 reasons as How I wonder Why Jurassic movie again

1. Jurassic Park was not just a movie, it was an experience and a sensation. It created waves around the globe with its ground breaking special effects that cinema never witnessed before. Will JW live to that expectation?



2.JP introduced us to 'real' dinosaurs that looked so real it was hard to believe these was engineered through computer. We as children did believe that there really were dinosaurs in some island where the movie was made ☺. Now even toddlers know what special effects are. Just see a third graders syllabus to know what is Micro processor and what RAM is.

3.JP led a franchise that made dinos as household things such as comics,toys, bags,t-shirts,cartoons and endless other things.. What about JW..

4. Now dinos are nothing new.. There are TV series on Dinos in discovery and NGC.


5. There are independant film makers who were able to produce special dino effects at par with big production houses.

6.Nothing can beat the original. This has been the buzz word for ages.

7. There are Dino theme parks and rides everywhere.. JW follows the theme again..

8.Dinos have become yester year topic now.. And there have been N-number of creature effect movies.. Group of people stranded at a creature ridden place and plan for escape.. nothing new.

9.On a funny note: Jason Sthathom can defeat T rex now.

10. JP offered something new to the world. I would say it was almost an invention and a revolution in Cinema.. Hats off to Spielberg and his vision. and Stan Winston on technical grounds.. and Michael Crichton...for his inimitable concept...
...continued....

Monday, May 4, 2015

20 reasons as How I wonder Why Jurassic movie again

"INTRO"

23 years back Jurassic Park was  sensation. People had never seen anything like it on the screen before. Spielberg achieved a seemingly impossible task and the movie won the hearts of one and all.. And what followed was a mass histeria on dinosaurs with dino toys, dino games,dino theme parks and dino themed movies.

The concept of cloning the extinct giants from DNA of fossilized insects was innovative and the visual effects were phenomenal unlike some of the older hollywood dino flicks where the animals were mere puppets. Here the technicians had breathed life into the animals such that they looked so real.. We as children believed that they were real dinosaurs -We werent aware that the original concept was by an author called Michael Chricton. As time passed by the movie attained cult status.

...continued

Saturday, May 2, 2015

Feeling Nostalgic

I felt nostalgic after watching the new featurette on Jurassic World. Childhood memories.. The movie that introduced us to Dinosaurs and computers. The T Rex and the Silicon Graphics Workstation.

https://youtu.be/PA4IdQZ7k7w