datetime – In a unix shell, how to get yesterday’s date into a variable? – Stack Overflow

In a unix shell, how to get yesterday’s date into a variable?

You can use GNU date command as shown below

Getting Date In the Past

To get yesterday and earlier day in the past use string day ago:

date –date=’yesterday’

date –date=’1 day ago’

date –date=’10 day ago’

date –date=’10 week ago’

date –date=’10 month ago’

date –date=’10 year ago’

Getting Date In the Future

To get tomorrow and day after tomorrow (tomorrow+N) use day word to get date in the future as follows:

date –date=’tomorrow’

date –date=’1 day’

date –date=’10 day’

date –date=’10 week’

date –date=’10 month’

date –date=’10 year’

Source: datetime – In a unix shell, how to get yesterday’s date into a variable? – Stack Overflow

 

 

I basically google everything when making a shell script for linux.  Blame projects with component that require windows stuff which has helped me forget what I used to know about shell scripting

 

Here is a way of using GNU date which is fortunately present in the linux installed in the oracle servers where our weblogic application servers are installed.

This was used in a CRON job that had to look at a file that is stored in a directory which is formatted with yesterday’s date <YYYYMMDD>.

another useful stackoverflow link regarding the date command.

Here is the link that help me format the command in a CRON job

The secret is that % have to be escaped with \

Oracle SQL: Update a table with data from another table

First time I used a correlated update in a script I had to do.

In oracle SQL, how do I run an sql update query that can update Table 1 with Table 2’s name and desc using the same id?

This is called a correlated update

UPDATE table1 t1
   SET (name, desc) = (SELECT t2.name, t2.desc
                         FROM table2 t2
                        WHERE t1.id = t2.id)
 WHERE EXISTS (
    SELECT 1
      FROM table2 t2
     WHERE t1.id = t2.id )

Assuming the join results in a key-preserved view, you could also

UPDATE (SELECT t1.id, 
               t1.name name1,
               t1.desc desc1,
               t2.name name2,
               t2.desc desc2
          FROM table1 t1,
               table2 t2
         WHERE t1.id = t2.id)
   SET name1 = name2,
       desc1 = desc2

 

 

Source: Oracle SQL: Update a table with data from another table

 

Guide to the select form found here.

 

 

A call for secession from Silicon Valley – Michael O. Church

Silicon Valley wants the world to believe that it is the new America, and that the United States is the Great Britain of 1773. It does not wish for explicit political secession, but it wants economic and cultural secession. It doesn’t want to pay its taxes, and it only wants to follow American laws when they are convenient to it. It has emotionally divorced itself from the rest of us. So should we let it secede? On the contrary, we should secede from it. Silicon Valley draws its strength from Real American

Source: A call for secession from Silicon Valley – Michael O. Church

I care for a more technologically advance world.
It seems that SV is actively impeding this because it has slowly become less about technology and more about marketing.

Would Love To Watch::Critic After Dark: Taxi (Jafar Panahi)

 

Taxi Poster

Self-reflexive metacinema is a common device in Iranian films; everyone from Abbas Kiarostami to Mohsen Makhmalbaf has dabbled in it, and Panahi’s own take is pretty good–The Mirror, about a young girl trying to make her way home who suddenly decides to quit the director’s film and make her own way home (think Shirley Temple walking off the set of Wee Willie Winkie and you can imagine the consternation caused). In this film the meta-premise manages to keep us on our toes, trying to guess what is fiction and what is not. Along the way Panahi satirizes Iran’s political censorship apparatus; gives us a day-in-the-life snapshot of Tehran that also celebrates the people’s resiliency in the face of adversity (government oppression included); and does it all with a deft humorous touch–while under threat of imprisonment, and in direct defiance of a filmmaking ban. If that’s not big brass balls (on a man with a perpetual grin and the kindliest eyes) I don’t know what is.

Source: Critic After Dark: Taxi (Jafar Panahi)

Opinion: Why millennials struggle for success – CNN.com

Search »International Edition+Why millennials struggle for successBy Angela DuckworthUpdated 1741 GMT (0141 HKT) May 3, 20164 photos: From millennials to the greatest generationFrom millennials to the greatest generation – Steve Jobs with a new LISA computer during a press preview in 1983. Baby boomers like to claim this visionary for their own.Hide Caption3 of 44 photos: From millennials to the greatest generationFrom millennials to the greatest generation – On November 30, 1965, about 20,000 marchers protested in Washington against American involvement in the Vietnam War. Those who were born in 1945 were on the tail end of the “greatest generation,” and some participated in anti-war rallies in their youth.Hide Caption4 of 44 photos: From millennials to the greatest generationFrom millennials to the greatest generation – Many Millennials love “The Daily Show,” previously hosted by Jon Stewart.Hide Caption1 of 44 photos: From millennials to the greatest generationFrom millennials to the greatest generation – For generation X, Kurt Cobain of Nirvana was a cultural icon.Hide Caption2 of 44 photos: From millennials to the greatest generationFrom millennials to the greatest generation – Steve Jobs with a new LISA computer during a press preview in 1983. Baby boomers like to claim this visionary for their own.Hide Caption3 of 44 photos: From millennials to the greatest generationFrom millennials to the greatest generation – On November 30, 1965, about 20,000 marchers protested in Washington against American involvement in the Vietnam War. Those who were born in 1945 were on the tail end of the “greatest generation,” and some participated in anti-war rallies in their youth.Hide Caption4 of 44 photos: From millennials to the greatest generationFrom millennials to the greatest generation – Many Millennials love “The Daily Show,” previously hosted by Jon Stewart.Hide Caption1 of 44 photos: From millennials to the greatest generationFrom millennials to the greatest generation – For generation X, Kurt Cobain of Nirvana was a cultural icon.Hide Caption2 of 4Story highlightsAngela Duckworth: Grit, that special combination of passion and perseverance, is the key to successBaby boomers are grittier than millennials, she says, but not for the reasons we thinkAngela Duckworth, PhD, is a 2013 MacArthur Fellow and professor of psychology at the University of Pennsylvania. She is the co-founder of the Character Lab, a nonprofit whose mission is to advance the science and practice of character development in children. She is the author of a new book, GRIT: The Power of Passion and Perseverance (Scribner). The opinions expressed in this commentary are solely those of the author.(CNN)”What’s wrong with millennials?” This is a question many older Americans are asking. Why do they keep changing their minds about what they want to do with their lives? Why does even a hint of critical feedback send them into a tailspin of self-doubt?In a word, why don’t they have more grit?This last question is particularly important to me because I am a psychologist who studies grit. I define grit as passion and perseverance for long-term goals. It’s what keeps us going when everything else makes it seem easier to give up. In my research, I find that how you score on my Grit Scale—a short survey of your current level of passion and perseverance—predicts achievement.Grittier students are more likely to earn their diplomas, grittier teachers are more effective in the classroom, grittier soldiers are more likely to complete their training, and grittier salespeople are more likely to keep their jobs. The more challenging the domain, the more grit seems to matter.Millennials’ much-needed optimismI now have Grit Scale scores from thousands of American adults. My data provide a snapshot of grit across adulthood. And I’ve discovered a strikingly consistent pattern: grit and age go hand in hand. Sixty-somethings tend to be grittier, on average, than fifty-somethings, who are in turn grittier than forty-somethings, and so on.So, why are millennials at the bottom of the heap in grit? There are two possible explanations. That’s because the sixty-somethings I’ve surveyed differ from the twenty-somethings in two ways. One difference is that they grew up in the “Mad Men” era rather than the new millennium. But it’s also true that they have more than twice as much life experience.Do millennials lack grit because our culture devalues a work ethic?Let’s consider the first possibility and assume that older adults are grittier than their younger counterparts because in their formative years, they were shaped by different cultural forces. Back in the day, the story goes, you were expected to grow up to do one thing for a living and then retire. You were exhorted to work hard, and you were told that nothing in life comes easy. These cultural norms validated a solid work ethic and a single lifelong career.If you’re a baby boomer, chances are you agree with this explanatio

Source: Opinion: Why millennials struggle for success – CNN.com

You probably know to ask yourself, “What do I want?” Here’s a way better question — Quartz

 

 

What determines your success isn’t “What do you want to enjoy?” The question is, “What pain do you want to sustain?” The quality of your life is not determined by the quality of your positive experiences but the quality of your negative experiences. And to get good at dealing with negative experiences is to get good at dealing with life.

Source: You probably know to ask yourself, “What do I want?” Here’s a way better question — Quartz

I’ve internalized this before a couple of years back.
I had a personal motto. Proof of desire is pursuit.
I sort of forgot about it and only now am beginning the process of re internalizing and living it again.

Revelations of the TV5-SWS Exit Poll | INQUIRER.net Mobile

The more the schooling, the more the appeal of Duterte: His lead over Roxas was 28 points among college graduates, 19 points over those with some college, 8 points among those with some high school, and 7 points among others.The younger the voter, the more the appeal of Duterte: His lead over Roxas was 33 points in ages 18-24, 26 points in ages 25-34, 14 points in ages 35-44, 10 points in ages 45-54, and 4 points in ages 55 and up.Duterte’s lead was 22 points among men, versus only 12 points among women.Duterte was least supported by Catholics. Duterte led Roxas by 16 points among all voters, but by a below-average 10 points among Catholics.  He led massively by 53 points among Muslims, by 70 points among Iglesia ni Cristos, and by 24 points among other Christians.Platform now counts for more than personality. In the 2016 exit poll, 57 percent said they voted for president on the basis of platform, while 40 percent said they voted on the basis of personality. This item had been evenly divided at 46-46 in the 2010 exit poll.

Source: Revelations of the TV5-SWS Exit Poll | INQUIRER.net Mobile

Trying To Find The Sweet Spot Where Happiness and Passion Fuse

%d bloggers like this: