Tuesday, July 14, 2015

My useful linux commands notes

show open files and programs holding it 
#lsof +L1

Repeatedly run a command and see output 

watch -n 1 date +%r


Create a password that works for Debian and Ubuntu  (can be used in Puppet manifests ) 


 mkpasswd -m sha-512


Create database (MySql) 

CREATE DATABASE databasename;

Create user for a database 

mysql> grant all privileges on databasename.* to 'user'@'host' \
identified by 'password';

if you want to access this database with that user over the network (tcp connection) replace the 'host' with the one you need or change to '%' to allow access from any host (a security threat) .

Delete database 

DROP DATABASE databasename;


Convert flac to mp3 - right in the flac files folder

(install flac and lame)
apt-get install flac lame

for f in *.flac; do flac -cd "$f" | lame -b 320 - "${f%.*}".mp3; done

Mount Windows shares 


mount -t cifs //FILE-SERVER-IP-ADDRESS/public /local/mountpoint -o user=nobody

Compress and Decompress Folder ( for backup or whatever ) - use p to preserve permissions


COMPRESS 
tar -zcvf outputfile.tar.gz /home/jerry/prog

DECOMPRESS 
tar -zxvf outputfile.tar.gz

Copy files over ssh using *.pem file authentication 

scp -i  mykey.pem somefile.txt root@ec2-123-123-123-123.compute-1.amazonaws.com:/tmp

Copy files to S3 bucket 

apt-get install s3cmd
( configure s3cmd to authenticate with your credentials, make sure you have the required permission for the bucket) 

s3cmd put file.tar.gz s3://bucketname/


VI(M) tips


make a .vimrc file in the user directory and in /etc/skel , type syntax on in it in order to always have syntax highlighting enabled.

:%s/foo/bar/g
Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.
:s/foo/bar/g
Find each occurrence of 'foo' (in the current line only), and replace it with 'bar'.
:%s/foo/bar/gc
Change each 'foo' to 'bar', but ask for confirmation first.
:%s/\/bar/gc
Change only whole words exactly matching 'foo' to 'bar'; ask for confirmation.
:%s/foo/bar/gci
Change each 'foo' (case insensitive) to 'bar'; ask for confirmation.
This may be wanted after using :set noignorecase to make searches case sensitive (the default).







Monday, March 16, 2015

MySQL database and user creation reminder

MySQL database and user creation reminder 



CREATE DATABASE DATABASENAME;

GRANT ALL PRIVIEGES ON DATABASENAME.* TO "USER"@"HOST" IDENTIFIED BY "PASSWORD";

FLUSH PRIVILEGES;

Enable Permalink/Clean URLs (hebrew) in WordPress

Wordpress notes: 

Enable "clean URLs" :


For hebrew ,
1-  change apache default encoding to utf-8
2- enable mod_rewrite :

To enable it the rewrite module, run "apache2 enable module rewrite":
sudo a2enmod rewrite
You need to restart the webserver to apply the changes:
sudo service apache2 restart
If you plan on using mod_rewrite in .htaccess files, you also need to enable the use of .htaccessfiles by changing AllowOverride None to AllowOverride FileInfo. For the default website, edit /etc/apache2/sites-available/default:
    
            Options Indexes FollowSymLinks MultiViews
            # changed from None to FileInfo
            AllowOverride FileInfo
            Order allow,deny
            allow from all
    
After such a change, you need to restart Apache again.
3. Change Settings->Permalink settings in WP 





    Wednesday, February 25, 2015

    Is the low oil price pointing to an upcoming war to be lead by the next (Republican) President?

    OPINION: Hussein Obama's two terms presidency looks just like another proof of American voters being ignored by the (power) minority pulling the strings backstage.


    They run the show since ever,  and it becomes more and more apparent to the naked eye.
    I believe that this power minority doesn't care about the presidential candidate's political side as long as his goals or ideology serves their agenda. That's how they decide to affect the Electoral College in order to choose their man.
    So at the time they elected Bush, of course, a Republican,  to conquer Iraq and control the energy market.  So he did his part, and they thought they've succeeded to enroll Iraq in this plot. After that, a Democrat, Bill Clinton was put to power in order to continue the military punch with contracts, peace processes and 'economy' driven acts. It still didn't work out so... again use of force by Bush Jr. 2003 with 9/11 in the reasons arsenal. Maybe there's a truth behind the ME hatred for America's intervention in their own business, after all.

    Now, again Obama, drawing back the army from the ME and making deals with the devil. Deals that are not in the favor of his alleged voters but the interest of few people behind the wheel.
    They make money on the way to their target by selling everything the well paying Army needs by owning the weapons and supplies companies. And they make even more money if they can play with the energy price. I'm not sure what's best for them, low or high, looks like they prefer the higher. All interventions by the US caused the oil price to jump at least for a long while.

    They demolish buildings and burn the evidence, manipulate insurance companies, Wall Street during expected radical attacks. They own the media and cut out footage that raise questions. Everything is Kosher.

    Does a low oil price points to an upcoming war? Is a low oil price a reason for aggression by the oil countries?  The lower revenues might fuel terrorism cause no Arab country can declare war on America, which in turn requires another military intervention ?!
    Obama was instructed to calm down the public doing nothing. Meanwhile, make some money. So he did in a lucrative way, pulling back the Army and turning against EU. The US seized and amended accounts and banks for compliance reasons and by controlling the money moving mechanisms.
    Bush Jr. was the one sitting shocked in the kinder garden chair holding the book upside down when 9/11 attacks occurred, not Bill Clinton who few years before created the background for it.
    Obama will be gone soon, for his bosses he has done his job. But the loose hands in the ME  probably just cooked the next attack on America. The proportion might be linear or exponential, but the scale will be in its league and probably make 9/11 look a pale small incident GD forbid.
     It doesn't have to be an explosion; it can manifest in a spiritual way, like Koran mandatory teaching in schools, Arab mass emigration, just an example.

    We forgot, being overwhelmed by the reality, but the 24 TV series  was a detailed premonition.

    The next president will be a Republican. He will forcedly swallow what Obama passively prepared ... and if televised for some reason, he will have the same lost look on his face, in total disbelief of what just happened.
    America and the string pullers got a real problem trying to repeat the Japanese (society reset) model, although it worked only once by using the Judgment Day weapon. The Japanese, stubborn as they had been, didn't rely on God's "will" as the Arab's.
    An Atheist/Christian society has all the means and technology to hurt anyone badly. However,  it lacks the patience, the inner strength and motivation to win the mighty long war against monotheistic ideology, as twisted as it might be in Islam's case.
    As long as sugar is the main ingredient in America's food, the masses will continue to watch American Idol and do 9 to 5 until the next bump.
    I hope this opinion didn't trigger too many threat flags on NSA's content analysis systems.

    Sunday, April 7, 2013

    Nobody lives forever (Microsoft, Apple, Google)


    *wrote this more than a year ago" ... now Apple is 33% down ...

    Well, sure IBM CEO is in the background cause none of their products are "taken personally" by millions of people  ... we listen to music, play games, communicate and work using Apple products... touching them every few minutes. I account this "personal" approach to Steve Jobs being a great speaker and addressing everyone directly and frontally. If your product is a database server you better not show your face on stage cause it's useless !
    Tim Cook is a GrAY COO with a sleepy talking style, all short-term achievement are just a dimming ECHO of the last decade phenomena and it will slowly but surely fade away. In the mid-term future we will see a decline start in many forms and it is to be accompanied by desperate moves to hold on the title, moves that will speed the fall.

    Evolution vs. Creationism


    (Please excuse my english issues)

    Evolution  vs. Creationism


    I really don't understand how not even one voice was pertinent enough in the last few hundreds years to clearly point on how the two supposedly opponent opinions are just complimentary one to the other.

    I relate this fact to the more than feasible option that each "side" was too eager to annihilate each other's opinion or existence, more than pursuing the truth, without success, and on the way blaming and killing as many Jews as possible as a common practice of their frustration, anyway they had all the answers...

    So let's address the titled mater...

    Here is a list of some feasible facts from everyone's daily observations that we can easily agree on and use them as tools for the logical debate even tough the deeper "knowledge" is beyond the written logical.

    Fact #1 : Will comes before action

    Look "inside" yourself and notice that any action you can voluntarily take has a basic will at it's root. Moving your finger is a great example. "Will" is not "Urge" even tough they are closely related. 
    They are related because they both lead to action but the difference is that the Will is optional and the Urge might become mandatory or even involuntary (faint). That is, by the way the difference between humans and other creatures. With us, urge becomes realised after it passes the "will layer".

    We'll probably never see a Lion chasing a Zebra, catch it and then lick it's nose and walk away (until the days to come at least) going to himself "Ok Zebra , i was thinking while a ran after you that i might not that be so hungry just yet today so you go away for now before i change my mind"

    Probably because the Lion has not manifested a will when he started chasing the Zebra but a strong urge. So urge does not leave room for much choice but only will-equipped creatures can enjoy/suffer from it. 

    The outcome of this additional layer of choice of exercising our will beside urges is speech. The Speech fills the space created between the choices of our will. 
    As more as a creature is closer to mandatory-urge-driven behavior, the lower are it's communications skills. Example: If we have no choice about something in our lives, we just do it however we still have the choice of talking about it but we do it without debating it.

    Everything communicates at some degree, some more and some less, each to their cause. A sand grain communicates at certain spectrum range as visual presence, it might monotonically sing at it's atomic level. In the other hand, your girlfriend or wife definitely represents the opposite extremity... 


    Fact #2 : Progression is a fact

    A really important "secret" that stands at the base of our entire existence is (TBC)



    לכשרצה ה' להוריד שפע לעולם הגשמי והרוחני עשה כדרכו, מהאינסוף לזה העולם ומשבאינסוף אין תחילה וסוף ואין שינוי, כך השמש מאירה מרצונו על הנבראים באופן קבוע (לשמש יש גם התחלה וסוף מזה שהיא בתוך הבריאה אזי מאירה היא פעם בבריאה).
    ומשאין בכוחם ודרכם של נבראים התחתונים לקבל השפע כדרך העליונים בקביעות (נהנים מזיו שכינתו וכו') נתחייבה המציאות להתגלגל בכל יסודותיה.

    לכן הארץ סובבת מפני השמש ובזאת יש שבירת הנצח ליש ואין, דהיינו יש הארה ביום ואיו (ישירה) בלילה. ומשאנשים לא יחשבו שאין השגחתו ית' בלילה שם הירח והמאורות לממשלה בה שמאירים מרצונו גם.
    מופלאה דרכו וחכמתו שיש בכך שימור עקרונות בסיסיים שהוא יתברך, אין בו שינוי וצימצום (אלא מאיר קבוע) ואינו מצמצם נתינתו חלילה אלא קבלתו של האדם ע"י שמסובב פני כל העולם בלילה.
    ומזה אפשר לדעת דברים הרבה, כגון שיש לנבראים צורך/חובה/מגבלה בשני סוגי קבלה. האחד ישיר ואחד חוזר. וזה סוד זכר ונקבה, אב ואם , נידה וטהרה, חול וקודש, גלות גאולה, האחד בגלוי והשני בהסתר וזו המצאיות אשר יצא אליה האדם מגן העדן.
    ואל תומר שלפי חטאו אין העולם היה מתגלגל וכי לא היה צורך בכך אלא כפי שהכין לו ה' מקום עליון אילו היה שומע בקולו כך הכין לו גם את העולם באם יתגשם האדם בעורלתו ויחטא שמה יהיה לו מקום בו יעשה תשובה ולא יאבד חלילה. כאב ואם שנותנים לבנם האחד את הדעת והחינוך והשני מלבוש ומזון.
    (תזכורת לנושא נוסף) – כפי שמצאתי כי העלה בצומח חייב שני פנים, אחד עליון הפונה ישירות לשמש והשני מקבל אור חוזר מהאדמה שאילו אין הדבר היה כך, אין העלה היה תלוי ולא והיו לו שני פנים אלא היה דבוק על גוף הצומח..)
    השמש מגלה סוד שבירת הנצח בזה העולם והנעשה בדין בתחילה והופך לרחמים שמאירים לנבראים. ומה כתיב בדין, שאינו משתנה.

    Friday, September 23, 2011

    God for dummies...


    Try to forget the old man with the long white beard for a minute and lets cut the thousands years BS, it can't get any simpler than this :

    The entire Creation, known or unknown, on it's vast existence spectrum relies on a simple low denominator : the Truth of it's existence. 

    Truth "provides" existence to the enormous ramifications of the Creation's building blocks on both meta and physical levels, one by one and all as one. 

    Because it is the lowest common denominator, the Truth is visible while observing the smallest simplest particle known or the biggest and complex.

    Nothing can exist without the Truth of it's existence while the Truth itself does not depend on any manifestation. It is a higher dimension which doesn't rely on any manifestation but causes the manifestation existence. 

    The Creation is a manifestation of the Truth of it's existence.

    The Truth "itself" on it's turn is a lower manifestation and an executor of a higher dimension Will.

    Not the Truth nor the Will above it are God, only a lower manifestation of it's Kindness (Kindness cause if it was not, nothing could ever be), and that's the human's highest point of observation on this mater.

    Since it's will and truth are manifested in every particle and therefor in any non-particle, it has a constant presence among the manifested and non-manifested existence. That's why "he" is "everywhere and "knows" everything.

    The way from the highest form of "kindness" down to the "manifested" world goes trough an analog gradation, with 10 disticted steps (this is why the 10 base) , 7 (6 mater faces + 1 principle)  of them in our spectrum and 3 above .

    So is this in contradiction with any scientifical findings ? NO!
    Does it contradict evolution ? NO ! it supports evolution that has nothing as start point and humans as purpose (to be debated in the next Note)

    So next time you say "Show me" you don't need any explanation but the fact you are there to ask it.

    Please challenge me on this! 

    Sunday, September 18, 2011

    Recovering from startup failure and the lessons learned.

    It's always nice when you do something, and it works but how do you face failure?
    I recently failed with the last startup (bidsarena.com - is down), it was my first "me too" internet venture.
    I learned a few things...

    * "Me too" ventures have no entry barriers therefore there are many "me"s that will get in the game usually even faster than you.
    * India is a significant competitor in the "me too" game and they copy any working model within days of its success, and they do it very fast.
    * Do only what you believe in and feel comfortable with the morality of the business model if you don't, stop immediately.
    * Do not hire newbies just because they're cheaper, they will drag you month's away from targeted launch.
    * Do not work on it too much to make it "perfect", start it and improve on the way, it will never be perfect.
    * Never forget that advertising is much trickier and expensive than you think.
    * Never forget that you cannot always succeed.
    * If your business is considered as high risk by credit card processors there's a reason for it.
    * Make sure you can afford to fail otherwise keep your 9 to 5 job until it gets some traction and revenues.
    * Always raise double the money you think you'll need and be truthful  about the chance to succeed to your investors.



    Sunday, September 11, 2011

    My 9/11 story


    9/11 - i was on the plane, one hour away from NY...
    The old Ben-Gurion airport was strangely agitated beyond the usual level, and increased security measures were taken that night... (the screening machines were put on every entry) , lots of security personnel than usual. They knew something is going on...

    I was supposed to meet in NY with a colleague that lives in LA and close an IT equipment deal for the company i worked for. On Wed I tried to avoid the flight and close everything over the phone, it didn't worked out so despite my inner voice i had to order the ticket for Thursday.
    Mean time i ordered a hotel room few blocks from WTC, shopped online $1500 worth of clothes and toys online for the kids which i never got.

    That day was so strange... i felt something is so wrong, i felt it so bad and sad that i could barely talk and even TOLD EVERYONE around me about my feelings (which i never do) and i was scared to take that flight. I even called my religious friends and asked them if this day has any special meaning in the hebrew calendar.

    I overcame my fear by preparing myself as i did tens of times before .. explaining myself that i am always nervous about flights that have no real life value (just business trip to lower IT costs which were significant back in those days) .

    I was sleeping, the pilot woke all passengers up telling us what happened ... it was shocking, we landed in Canada. Cell phones were dead... nobody in IL knew what planes crushed, they only knew i "had a very bad feeling" and that now i do not answer the phone many hours after the supposed landing.
    I was stuck there for 5 days while watching the stock markets crushing on Yahoo Finance and Commando's patrolling the airport.
    I though this is WW3, and that US will hit that Nuke button while i am on the other side of the world.... i imagined myself isolated from my kids and family without even knowing that my mom is in LA. 


    The events are still unbelivable for me, the building #7 collapse is the worse mystery and after 10 years we know even less.