Лайфхаки такие лайфхаки

Я не первый год слежу за lifehacker сайтами и порой что-то нахожу полезное и иногда даже пробую лайфхаки на себе. Например, подставка для айфона из канцелярской скрепки реально рулит — сделал для своей комнаты, для ванной и на работе есть – везде регулярно пользуюсь.

Но лайфхакеры порой заходят слишком далеко… Если вы всё ещё наливаете сок как-то иначе, то вот вам откровение, которое изменит вашу жизнь:

lifehacker for idiots

PS: По-моему, что бы сок не брызгал, коробку достаточно держать так, чтобы он не брызгал :)

Posted in Маразмы | Tagged , | 8 Comments

Fox is down.

Три года машинка работала. Последний раз выключали 2½ года назад для замены кулера. Пусть служит и дальше верой и правдой своему новому владельцу.

[root@fox www]# /etc/init.d/mysql stop
Shutting down MySQL..                                      [  OK  ]
[root@fox www]# /etc/init.d/httpd stop
Stopping httpd:                                            [  OK  ]
[root@fox www]# /etc/init.d/ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@fox www]# rm -rf /var/db/
[root@fox www]# rm -rf /var/www
[root@fox www]# rm -rf /www
[root@fox www]# rm -rf /home/admin
[root@fox www]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             75798336   3101648  68846312   5% /
/dev/sda1               101086     17446     78421  19% /boot
none                    252636         0    252636   0% /dev/shm
[root@fox www]# rm -rf /etc/httpd/conf
[root@fox www]# rm -rf /etc/httpd/conf.d/
[root@fox www]# /sbin/shutdown -h 0

Broadcast message from root (pts/0) (Tue Feb  1 21:00:42 2011):

The system is going down for system halt NOW!
[root@fox www]#

PS: я аж прослезился, чесслово! :)

Posted in Разное | Tagged , , | Leave a comment

Sort dates by day and month only – MS Excel trick for HR people

The problem…

Usually, HR people run lists of the employees’ birthdays and want it to be sorted so they can find out who’s going to have a birthday in upcoming month.

So, imagine they have list with only 2 columns — the first column (A) is for name employee and the second one (B) holds employee’s date of birthday.

Microsoft_Excel_birthday_table.png

Usually, the second column is of type “DateTime” and if you try to sort it, Excel will take the year into account and this will render the list useless (unless you want to find who’s oldest or the youngest person on a payroll.

Microsoft_Excel_date_sort_uses_year.png

In the image above you can clearly see the problem. Given a list of hundred or so employees you will not be able to tell how many employees have a birthday in a given month without going trough the list manually.

The solution

In order to be able to sort by day and a month we will have to get rid of the year so the Excel could sort it properly.

In order to do this, we will need a helper column that uses the formula below:

=CONCATENATE(TEXT(MONTH(B2);"0#");TEXT(DAY(B2);"0#"))


Microsoft_Excel_sort_by_month_and_day_solution1.png

While this solution is okay, it is still not perfect. We can sort, but we cannot (re)use this column for other than sorting.

The solution… improved

Improved solution uses DATE function to recreate birthday date in the helper column:

=DATE(0;MONTH(B2);DAY(B2))

The trick is setting the year to zero. This makes all the dates to be in year 1900. Given the fact that all the dates have the same year, they can be sorted properly and still have the DateTime column format. This gives you the possibility to display day and a month using different format or culture. See the proof below:

Microsoft_Excel_sort_by_month_and_day_solution2.png

In fact, you can use current year in the formula to build complete schedule of birthdays for current year and have it exported to your Sharepoint site so you have reminders set for you:

=DATE(YEAR(NOW());MONTH(B2);DAY(B2))

And the proof pic follows:

Microsoft_Excel_sort_by_month_and_day_solution_current_year.png

Pivot Table

How about counting the number of birthdays in a given month? Easy!

Add another column and use formula “=MONTH(birthday)” and use the table as a source data for the simple pivot table.

Any comments, suggestions, ideas? Please use the form below

Posted in Miscellaneous, SharePoint | Tagged , , , | Leave a comment