sobota 15. prosince 2012

... relativita v praxi

V roce 2009 zemřelo v USA 33 800 lidí při dopravních nehodách (zdroj). V průměru ~93 mrtvých denně. Málokdy si jich někdo všimne.

čtvrtek 29. listopadu 2012

Zákony pro lidi

... konečně ... asi pozdě jsem našel ...  už nějaký čas fungují http://www.zakonyprolidi.cz
je smutné, že podobnou aplikaci nevytvořila státní správa, ale komerční organizace. 

úterý 31. července 2012

... a pak že nerostou ....

Nestyďte se zaslabší zrak, a klidně si kliknětě pro plnou velikost fotky.



pátek 25. května 2012

Windows ACL hell solution

Error message "Access denied" makes me crazy. Whenever I see this message unexpectedly on windows computer I know that next few minutes/hours will be painful.

Windows access rights apparatus is overcomplicated for most uses. When advanced settings are combined with inheritance. When playing with ACLs man gets easily at the edge madness.

After several tries things are getting worse and worse. You can end up with a folder you can't do anything with. No rights left to you even if you are member of the Administrators group.

Following three steps should help in most cases (There are rare cases it will not help connected mainly to inability in taking ownership). Being administrator is the only prerequisite.

Steps to survive ACL hell:
  1. Taking the ownership - As a member of Administrators group you have all the power to own anything (any object) on a local system. And when there is another owner you can seize the object at your will. 
    • takeown /F file-or-folder 
    • you can use /R to do it recursively 
  2. Reseting rights - After membership is taken it is possible to get rid of all explicitly assigned ACLs using.
    • icacls file-or-folder /reset /T
  1. Test effective rights - using file Properties tab Security button Advanced tab Effective permissions - you can test whatever user you want and get his or here effective permissions.

Good luck!

 

čtvrtek 24. května 2012

...obětování plechovým bohům

... dnes před desátou na Jižní spojce probíhal obřad obětování plechovým bohům. V kruhu alegorických vozů s modrými blikajícími světly uprostřed rozpáleného asfaltového pruhu ležela oběť. Nehybná v paprscích zářícího slunce s nákrčníkem. U oběti v nábožné úctě v pokleku několik ceremoniářů dohlíželo na obřad. V obětišti jakoby se čas zastavil. Od obětiště se táhla dlouhá řada účastníků. Někteří ukrytí uvnitř svých plechových bohů, někteří poblíž.

středa 28. března 2012

... dsquery needs to be elevated to query memberOf

Today after an hour of pain I have discovered weird beavior od dsquery command. I was trying to reproduce my yesterday work. Yesterday I queried users based on their membership using following filter in dsquery *.

(&(objectClass=inetOrgPerson)(memberOf=GROUPDN))

Yesterday it worked. Today .. no user is found. After a fair ammount of time I found a solution. Queires containing memberOf as part of the filter need to be executed inisde ELEVATED prompt.

Let me scream again .. UAC on the server is EVIL.

pátek 2. března 2012

Arduino Uno serial communication

Disclaimer: following procedure worked for me. Obviously there is no  guarantee that it will work for you but there is pretty high probability of success. Improper handling can damage or destroy the board but it is unlikely. 

Great little Arduino has one drawback for "production" operation. After (USB)serial port is connected from PC, the unit resets.

The feature is suitable for development - each serial connect enables upload of the code. But it is annoying during production when you may need to connect to your Arduino to collect data. There is a HW solution.

There is a RESET-EN trace on the board (see below - it is located in the green circle marked with RESET-EN label). When the RESET-EN trace is cut (see the red line below - be rough enough when cutting to be sure it is cut) the serial communication initiated resets are disabled. The trace can be soldered again in the future (see Arduino.cc section Automatic (software) reset for reference).



After the RESET-EN trace is cut PC can connect and disconnect the serial and Arduino does not reset. On Linux simple shell scripts can be used to collect the data. Attention - uploading the new code to the Arduino might be a little less comfortable. To upload the new code use the following procedure (i can't find the link of the site where I have discover this procedure):
  1. prepare the sketch in the Arduino IDE
  2. place the mouse pointer at the upload button on the screen
  3. press and hold reset button on the Arduino board 
  4. fix your eyes on RX LED on the Arduino board
  5. click the upload icon in the Arduino IDE
  6. look at the RX LED and after it flashes once release the reset button
  7. look at the Arduino IDE to whether upload was successfull
  8. when the upload fails don't worry and try again with a little different timing of reset button release
  9. it needs little practising but it definitely works for me
  10. ... be patient :-)     
Or you can use alternative approach :
  1. prepare the sketch in the Arduino IDE
  2. place the mouse pointer at the upload button on the screen
  3. look at the status bar of the Arduino IDE
  4. press upload button 
  5. "Compiling sketch ..." will be displayed in the status bar
  6. After several seconds it changes to "Uploading ..."
  7. Press reset on the Arduino board as soon as possible after "Uploading .." comes up
  8. keep practising and you will succsseed

At first the correct serial setup is needed. To setup serial port to be readable using shell utilities use:

stty -F dev/ttyXXX cs8 9600 raw

And then you can use basci text utils to process Arduino output. To read 5 lines from Arduino to a file use:

cat /dev/ttyXXX | head -n 5 > data.txt

And to write command to Arduino just:

echo -n CMD > /dev/ttyXXX

Good luck ...