PHP Composer

Composer is very useful tool or better dependency manager for PHP. Matthieu Moquet wrote excellent blog post about 5 features to know, and I am sure there is more about Composer on his blog posts.
Here is summary of the command line examples, learn to know, what they do:

$ composer update foo/bar
$ composer update nothing
$ composer update --lock
$ composer require "foo/bar:1.0.0"
$ composer init --require=foo/bar:1.0.0 -n
$ composer create-project doctrine/orm path 2.2.0
$ composer init --require="twig/twig:1.*" -n --profile
$ composer update symfony/yaml --prefer-source
$ composer status -v
$ composer update
$ composer dump-autoload --optimize
Posted in workday | Leave a comment

EXIF info from ISS

There is beautiful picture of the rising Orion from International Space Station. What is really nice, one can look at EXIF info, in this case by jhead program.
Rising Orion from ISS
Here is the info:

File name    : iss040e017069.jpg
File size    : 1246427 bytes
File date    : 2014:06:27 23:29:37
Camera make  : NIKON CORPORATION
Camera model : NIKON D3S
Date/Time    : 2014:06:23 09:16:03
Resolution   : 4256 x 2832
Flash used   : No
Focal length : 28.0mm  (35mm equivalent: 28mm)
Exposure time: 1.000 s
Aperture     : f/1.4
ISO equiv.   : 5000
Whitebalance : Auto
Metering Mode: pattern
Exposure     : Manual
Exposure Mode: Manual
JPEG Quality : 84
Comment      : NASA#2007931
======= IPTC data: =======
City          : ←%G
Record vers.  : 0
DateCreated   : 20140623
Time Created  : 091603+0000
Posted in workday | Leave a comment

Hibernate

Hibernate is great piece of java software, which utilize concept ORM – Object Relational Mapping. If application needs to store data into relational database, it simplifies development tremendously. One don’t need to use SQL queries, unless needs to do something very special. Hibernate has drivers supporting all major databases, so it’s easy to switch database. There are plenty of resources, including youtube tutorials, like JavaBrains. There is also Hibernate OGM (Object/Grid Mapper), which provides Java Persistence (JPA) for NoSQL data.

Posted in workday | Leave a comment

Nette framework: .htaccess file

Playing with nette php framework, here is www/.htaccess file, which is working on 1and1 linux platform:
AddType x-mapp-php5 .php
Options +MultiViews

# disable directory listing
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>

# enable #cool URL
<IfModule mod_rewrite.c>
RewriteEngine On
#following line uncommented on 1and1:
RewriteBase /

# prevents files starting with dot to be viewed by browser
RewriteRule /\.|^\. - [F]

# front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L]
</IfModule>

# enable gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json
</IfModule>

Posted in workday | Leave a comment

Bootable USB Flash disk with Windows7

Here are steps to create bootable USB Flash disk with Windows7.

1. 4GB or bigger USB Flash Disk needed

2. Put your Window 7 Instalation DVD into your computer DVD mechanics. If DVD is not readily available, you may download ISO image, for example, Windows 7 Home Premium x64 with SP1 (bootable) from http://msft.digitalrivercontent.net/win/X17-24209.iso and burn new DVD.

3. On your Windows 7 computer (with DVD in D: and USB Flash in E:) do:

C:> DISKPART
DISKPART>list disk
DISKPART>select disk N
DISKPART>clean
DISKPART>create partition primary
DISKPART>active
DISKPART>format fs=ntfs
DISKPART>assign //letter drive e.g. E:
DISKPART>exit
C:>D:
D:>cd boot
D:>bootsect /nt60 E:
D:>xcopy D:\* E: /E

4. May sure in BIOS, that computer is able to boot from USB Flash drive. It’s also handy to have picture of computer MS Windows certificate.

Posted in workday | Leave a comment

Computer Browser Service and randomly lost connection

I was having once a while connection problem with two computers, both with Windows 7 operating system. I found possible explanation and solution, maybe: Windows 7 itself, or more precise Computer Browser Service. Detail description is in excellent article Wireless network drop connection or at Tom’s Hardware forum Randomly losing internet connection.

One should studied more often logs under Administrative Tools -> Event Viewer -> Windows Logs -> System
Solution involves disabling  Computer Browser Service.

Posted in workday | Leave a comment

Protected: Getting ready

This content is password protected. To view it please enter your password below:

Posted in {closed} | Enter your password to view comments.

Virtual Computer

Performance of nowadays personal computers is more, than one would expect. They can even run two or more computers in the same time, actually virtual computers, which can share resources of real physical computer. For users of Windows there are several options, one of them is VM VirtualBox from Oracle, under GNU General Public License (GPL) version 2.
For example for small work, it’s possible to create 8GB virtual hard drive, to place ISO image, let’s say Ubuntu Desktop 13.04 (Raring Ringtail) into DVD virtual drive, and install it into virtual hard drive. Don’t forget about sudo -s for root session. With Guests Applications it can even share (network) folders. Command could be for example like
mount -t vboxsf   S_DRIVE /home/joedoe/sdrive/ , if you share network drive S:. Thus is very easy to cooperate and share data between Windows and Linux.

Posted in workday | Leave a comment

Snowfall on May 2nd

Only few days again came finally Spring, and today, on May 2nd is Winter here again. Looks like it was too soon put outside garden table and chairs. There is now one foot of snow.
130502_110228_640x400
Snow in the garden
130502_124638_640x400
One foot / 30 cm of snow
130502_105659_640x400
Green silantro is inside, green willows leafs outside are covered by snow
130502_132528_640x400
Fox cubs have unexpected fun

130502_133123_640x400
Three fox cubs outside, other foxes are warm inside

Posted in household | Leave a comment

Spinach Cashew Salad

I made Spinach-Cashew salad again, and everyone liked it. Here is recipe including my measurements. Feel free to adjust it. I personally tend to put less sugar. Or you may add more salad, etc., etc.

Salad

  • 1 bag Spinach (188 or 170g / 6 oz)
  • 1 bag Romaine lettuce (1 heart … 248g / 8.7 oz)
  • 3 red Diced apples (468g / 1lb 0.5oz)
  • 1 can Cashews (2cups – 224g / 8oz)
  • 4 oz Shredded Parmesan Cheese (114g)
  • 1 pkg Craisins (140g / 5oz)

Dressing

  • 3/4 cup Sugar (140g / 5oz)
  • 1/3 cup Cider vinegar (72g / 2.5oz)
  • 2/3 cup Safflower oil (or Soybeans oil 132g / 4.7oz)
  • chopped Green onions (4)
  • 1 tsp Salt
  • 1 tsp Dry mustard
  • 1 tbsp Poppy seed

130303_192543-640x500

Posted in household | 1 Comment