Thursday, 2 July 2009

Setting up XAMPP local server for working on several sites in a custom directory

  1. Download XAMPP (if you need a portable version, choose zip package).
  2. Double-click on setup_xampp.bat file in the root XAMPP directory (if you have downloaded non-installer version). This should be done only once.
  3. Launch xampp-control.exe. This is the control center for all XAMPP services. Start Apache and check if everything goes fine by pointing your browser to http://localhost.
  4. Now let's assume you have all your sites here: D:\My Documents\Sites, and you need to setup local server for the site which is located in the "Mysite" subfolder. You want it to be accessible in the browser from address mysite.localhost. In the XAMPP folder, go to apache\conf\extra\ and open with a text editor the file httpd-vhosts.conf.
  5. Add this to the end of the file:
    NameVirtualHost 127.0.0.1:80
    <VirtualHost 127.0.0.1:80>
    DocumentRoot "D:\My Documents\Sites\"
    ServerName localhost
    </VirtualHost>
    <VirtualHost mysite.localhost>
    DocumentRoot "D:\My Documents\Sites\Mysite"
    ServerName
    mysite.localhost
    ServerAlias
    mysite.localhost
    <Directory "D:\My Documents\Sites\Mysite">
    Order allow,deny Allow from all
    </Directory> </VirtualHost>
  6. Replace D:\My Documents\Sites, D:\My Documents\Sites\Mysite etc. with the appropriate locations.
  7. Save and close the file.
  8. Now open C:\Windows\System32\drivers\etc\hosts file. Add to it this line:

    127.0.0.1 mysite.localhost

  9. Save and close, start Apache server via xampp-control.exe. now you should see your site at the mysite.localhost address.

Thursday, 12 March 2009

Firefox 3.0x float:right bug

In FF 3.0x there's a known problem with floats which appears when you try to design an element floated to the right with the simple code like this:

Friends
Updates


It positions not as a normal float, but jumps up for about 1.3em, so you need to specifically address the issue by adding the negative margin ("margin-top:-1.3em").This bug is already corrected in Firefox 3.1, but until it's out and to maintain compatibility with older versions, you should follow this recommendation: always place elements floated to the right before the code it's going to float, not after, and you don't need any additional rules, things get normal.
Updates
Friends

Friday, 5 December 2008

How to get all video formats playable in Vista WMP 11 (+ thumbnails and previews in Explorer)

You should install these codec packages:

  1. FFDshow (divx, xvid etc.)

  2. Haali Splitter (mp4, mkv, ogm)
    To get thumbnails, go to Haali Splitter settings and choose Yes in the entry 'Enable thumbnail extraction'.

  3. OSS Flash Filter (flv)
    If not working, go to VFW settings of ffdshow and in the Codecs tab check FLV1 type.

  4. Install Quicktime Alternative 1.81, then 2.70 (or any latest version) (mov, hdmov)
  5. Install the latest Real Alternative for rmvb, don't forget to check "Show thumbnails for rmvb" in the installation window.


To get thumbnails for those extensions that still haven't got them, use this reg file:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.mkv\ShellEx\{BB2E617C-0920-11D1-9A0B-00C04FC2D6C1}]
@="{327669A0-59A7-4be9-B99E-1C9F3A57611A}"

AND replace .mkv with the needed extension (for example, flv, m4v, mp4 etc.). To get the thumbnails check once more if files with such an extension are playable in Windows Media Player (for example, drag-n-drop onto WMP icon). You need to restart computer and clear thumbnail cache via Vista Clean Up manager.
To get video previews in Vista Explorer preview pane, use this tiny app. Open it, choose 'WMP rich preview handler' in the menu and unselect 'Only show classes...' checkbox. Then check those extensions you need and we're done.

Saturday, 4 October 2008

Thunderbird, error on startup after updating Lightning to 0.9: solution

If you use Thunderbird Lightning plugin for reading and writing to the Google Calendar (and GCal Provider), you might have noticed an error after updating the plugin to the latest version (0.9, which is supposed to be the last major version before Thunderbird 3 release). It appears on the start of the app:

An error was encountered preparing the calendar located at http://_unused/ for use. It will not be available.

One way to correct the situation is to delete storage.db file, which is located in the Thunderbird profile folder, and let Lightning recreate it. If you have offline calendars that do not synchronize with server be sure to backup them with "Export Calendar" command. Then you need to create new calendar with an appropriate GCal address.

Friday, 19 September 2008

Converting character sets on Linux

There's a tool in Linux and Unix systems which allows to convert encoding of a text file within wide range: UTF8, UTF16, ASCII, Windows-1251 etc. Its name is iconv and it is accessible from command line aka Terminal.
Some important options to be aware of:

  • -c - makes the program ignore unknown symbols
  • -f - precedes input file encoding
  • -t - precedes output file encoding
  • -l - lists all known encodings
Here's how to use it:

iconv -c -f UTF-16LE -t UTF8 input_file.txt > output_file.txt

This can prove quite handy for tablet users, as OS2008 tablet doesn't like UTF16-encoded documents, neither "native" Notes app nor Leafpad or PyGTKEditor.

Tuesday, 16 September 2008

Ubuntu, new windows created offscreen: solution

If you're on Ubuntu Hardy and struggling the problem of new windows opening offscreen so it's impossible to grab them without a hotkey (Firefox and Terminal, for instance), there's one solution. Open Compiz Config Settings Manager (=Advanced Desktop Effects Settings), go to Window Management section and activate Place Windows plugin. In its settings, General tab, you'll find Placement Mode droplist. Choose something like Smart or Centered and be sure to leave the Workarounds checkbox selected. Then see if it's enhanced your experience.

Wednesday, 11 June 2008

Hiding folders and files on Mac OS X (w/o XCode installed)

Imagine you want to hide some annoying folder or file, but apparently there's no "hidden" attribute to set in 'Get info' box (like on Windows). There's one tool which is able to help, it's called SetFile and is a part of Apple XCode developer toolkit. The latter is freely available to download on the Apple site, but, registration's needed to get the link and XCode weighs over 1Gb. Quick solution to do what you want is:

  1. Download standalone SetFile tool here or here

  2. Place (unzip if needed) into any folder (for ex., /Applications/Utilities/).

  3. Open Terminal and type (with your path to setfile): 

    chmod +x /Applications/Utilities/SetFile

    This will allow SetFile to execute.

  4. Then type:

    sudo /Applications/Utilities/SetFile -a V "/path/to/folder/"

    This will hide the folder or file you have entered the path of now.

To revert, type in the same command and replace "V" with "v". The hidden folder will stay visible in Terminal.

Sunday, 8 June 2008

How to get full res/video acceleration with NVidia 7xxx 512Mb cards on Leopard

Here's a small guide for getting QE/CI and full resolution with 7950GT 512 Mb. This is a solution that got worked for me; it can be used as guidelines for resolving problems with other cards as well.

1. First, you need to flash your card bios. BIOS REFLASHING IS REQUIRED ONLY FOR NVIDIA 7xxx DESKTOP VIDEOCARDS WITH 512 MB. UNCAREFULLY MADE, THIS PROCEDURE MAY KILL YOUR CARD FOREVER. You won't lose its functionality in other OSes - reflashing affects only Mac OS. You should have a bootable MS-DOS flash ready with nvflash app on it. To create it, you need to do some work in Windows. (Take a look also at this tutorial.)

  • Download HP key boot utility here, install it. If you don't want to install anything, download only exes here (but it might not work and isn't really "portable", be warned).
  • Download Windows 98 system files - they are needed to create bootable flash with the HP utility.
  • Run the app, point it to the location of Win98 system files, insert a USB key, and press Format. The bootable flash was just created.
  • But that's not all - there's nothing to run on USB key yet. Download NVFlash here (pick the latest version on the last page) and extract it to the key. When finished, go for instructions here, they are pretty clear and I don't want to repeat them).

2. Once you've done with reflashing, we need certain extensions to be in Extensions folder (search with Spotlight if you don't know where it is). These are: NVinject.kext, NVDAResman.kext, NVDANV40Hal.kext, Geforce.kext (see additional info here). You can install them with Punk92 Nvidia installer. (From now on you may get native resolution, but no QE/CI yet.)

3. Now you need to add your device id to the kexts. The value is in System Profiler under Graphics/Displays section, should look like 0x9999 (some of the known id's are put together here). Copy these four files from Extensions folder somewhere else and find an appropriate editor. Files are simple XML, but better get Apple Property Editor from Xcode toolkit (it may be also located in developer/ folder of the Leopard install DVD, or you can download it from Apple site after free registration). You can use Property Editor Pro or PrefSetter as well. Also download KextHelper, which will help us a bit later. Open each kext in editor, browse to the file Info.plist, find the entry "IOPCIMatch" in it and add your device id to the string following the presented scheme. For ex., if the string already contains something like this "0x019310de" and your device id is 0x0295, then add "0x029510de", and so on. Different device id's in the string are separated with spaces.

4. Now reboot in safe mode with -x switch, delete 4 old files from Extensions folder, drag changed files onto KextHelper icon, enter your pass and hit Easy install. If you're successful, reboot with -f switch, which will force all extensions to reload. Now you should/may have QE/CI and native resolution.

Have fun with it.

How to force Spotlight index NTFS drives

If you've noticed that on some volumes (may be NTFS/FAT32, internal/external) Spotlight search doesn't work, try this solution (found here):
type in Terminal:
sudo mdutil -i on /Volumes/something
where "something" should be the name of your volume. If it contains spaces, you must surround the whole path with quotes.

Wednesday, 28 May 2008

Yassir

Friday, 9 May 2008

Browser-specific CSS: targeting Opera 9

If you want to target modern Opera versions (9.0-9.5b2+), you may use this code as a wrapper (taken from this site):

@media all and (min-width:0px) {
head~body:lang(en) [place Opera-specific css here]
}
Remember that to have this working properly, you need to specify language in html element of the page (not only 'en' of course is possible, but also any other language):

<html lang="en">

UPDATE 21.06.2009: Now css3 media queries have got support in Fx 3.5, so the changes are visible in that browser too. Use the solution proposed here.

Saturday, 3 May 2008

Пользовательские шорткаты в Windows с помощью Autohotkey

По следам недавних и не столь недавних публикаций о шорткатах в Windows (1, 2) и Linux решил написать о том, как при помощи программы Autohotkey (Windows-only, инсталлятор, zip-(портабельная) версия) можно задавать свои собственные клавиатурные сокращения для тех команд, для которых в системе по умолчанию никаких шорткатов не предусмотрено. Во многом свою роль здесь сыграло желание иметь в Винде те же шорткаты, что и на Маке, на котором я одно время много работал.
[далее - Хабрахабр]

Saturday, 19 April 2008

Google Reader OSX optimized for N800/N810

Another style from userstyles.org, modified a bit to solve some issues that have appeared in Microb. Screenshot:



Download it here, then import into your userContent.css (just place greader.css in the same folder where userContent.css is, usually ~/.mozilla/microb/chrome/, and insert at the beginning @import url("greader.css");) or paste all the code from it there. Also for your viewing pleasure there's desktop version for using with Stylish (or standalone, also a bit corrected).
Google Reader shortcuts might be very useful.

View generated source bookmarklet

This bookmarklet allows to view generated source, i.e. HTML source of pages dynamically generated by JavaScript and AJAX requests, in separate window with syntax highlighting. (This feature also comes with WebDeveloper FF extension.) Very useful for user-styling and for browsers that lack the option to view source (for example, Maemo's Microb on N8x0).
Taken from here.

Friday, 18 April 2008

Google Maps optimized for N800/N810

If you want Google Maps page look on n8x0 like this:



paste this code into userContent.css (~/.mozilla/microb/chrome/userContent.css) or import into it:

@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("maps.google.com") {

.helplinks {
visibility:hidden !important;
overflow:hidden !important;
width:0px !important;
height:0px !important;
}
#map {
position:fixed !important;
left:-10px !important;
top:0px !important;
width:100% !important;
height:100% !important;
}

/*map navbuttons*/
#amtc_option_0, #amtc_option_1, #amtc_option_2, #amtc_option_3, #cbcontrol, #trafficcontrol {-moz-opacity:0.9;}

/*hide zoom nav*/
/*.gmnoprint>div:first-child>div>img, .gmnoprint>div+div {display:none;}
#amtc_option_0, #amtc_option_1, #amtc_option_2, #amtc_option_3, #cbcontrol, #trafficcontrol {display:block}*/

#amtc_option_0:hover, #amtc_option_2:hover, #amtc_option_3:hover, #amtc_option_1:hover, #cbcontrol:hover, #trafficcontrol:hover {-moz-opacity:1;}
#map>div:first-child+div>* {display:none !important;}

/*search*/
input[type="text"] {-moz-opacity:0.6; position:fixed; top:7px; left:100px; width:200px !important;}
input[type="text"]:focus {-moz-opacity:0.9;}
.ipt{padding-bottom:2px; border-bottom:0px !important; margin-top:-70px;}
#srchex, #sl1, #sl2, #hidess, .vbtn {display:none}
#showss {display:block !important;position:fixed; left:100px; top:30px;color:white !important}
#mrtbox {position:fixed; top:7px; left:310px}
#dir input {display:block !important}
#d_daddr {position:fixed; top:30px; left:100px}
#sl_t {-moz-opacity:0.8;}
}

You may also download bigger buttons version.

Thursday, 17 April 2008

Street View embedded

Sunday, 13 April 2008

Some Matchbox hacks on OS2008

  1. Open X-term.
  2. Go under root.
  3. Type nano /etc/osso-af-init/matchbox.defs.
  4. Change DIALOGMODE=static to 'free' - now you can move dialog boxes around.
  5. Change SUPERMODAL=yes to 'no' - now you can do other things on tablet while, for example, receiving a file via bluetooth.
  6. Save the file by pressing Ctrl-O and confirming it.
From here.

Saturday, 12 April 2008

Билл Мюррей и саундтреки

Так выходит, что у многих фильмов, в которых поучаствовал Билл Мюррей, — запоминающиеся саундтреки. Музыка, под которую хорошо вставать утром. Возможно, это связано с личными музыкальными пристрастиями молодых режиссеров, у которых он много снимался в последнее время. Вот небольшой список (по мотивам поста на ILoveCinema):

M3 video/audio converter crashes solution

Problem:
M3 video/audio converter crashes at startup since march 2008.
Solution:
Block http://www.vapulus.com access in router or hosts file (see here).

Чарльз Буковски. Доллар и двадцать центов

Чарльз Буковски
Доллар и двадцать центов
Больше всего нравился ему самый конец лета, не осень, может, это и была осень, и так и так, на пляже веяло холодом, и ему нравилось прогуливаться вдоль береговой линии почти сразу после захода солнца, кругом не было никого, и вода казалась мутной, вода напоминала о смерти, и чайки не хотели засыпать на ее волнах, они ненавидели сон, и чайки опускались все ниже, летали у самой воды, задавая вопросы прямо в глаза и в душу, в то, что еще оставалось ему от души.
если у вас не осталось много души, и вы это осознаете, значит, немного души у вас все же еще осталось.
потом он садился и приникал глазами к воде, простиравшейся до самого горизонта, и когда смотришь на воду до самого горизонта, становится трудно верить во что-то. например, что существуют такие государства, как Китай или Соединенные Штаты, или что есть такое место, как Вьетнам, или что когда-то он был ребенком, нет, подумать еще над этим, не так уй и трудно в это поверить; его детство было адом, и это забыть не удавалось. И старший возраст: все его заработки, и все женщины, а потом ушли женщины, и теперь нету работы. шестидесятилетний бродяга. В конце пути. Ничего нет. У него был доллар и двадцать центов мелочью. Неделя аренды уже оплачена. Океан… Снова пришли мысли о женщинах. С какой-то из них было хорошо, остальные были просто занудами, приживалами, немного сумасбродками и бессердечными как камень. Комнаты, кровати, дома, рождественские праздники, работа и углы и больницы, и скука, дни и ночи наполнены скукой, без смысла, без надежды.
Сейчас, в 60 лет, стоил он доллар и двадцать центов.
Потом он услышал за плечами смеявшихся, они захватили накидки и бутылки и банки с пивом, кофе и бутерброды. Смеялись, смеялись. 2 мальчишки, 2 девчонки. Стройные, гибкие тела. Не проявили внимания. Потом один из них заметил его.
- Эй, это что такое?
- Господи, откуда я знаю?
Он не двинулся.
- Но это существо человек?
- Он дышит? Трахается?
- Трахается?
Хохочут все вместе.
Он поднял свою бутылку вина. Еще оставалось немного, как раз столько, чтобы допить.
- Оно двигается, смотрите, двигается!
Он встал, отряхнув песок с брюк.
- Так у него есть руки, ноги! И ЛИЦО!
- Лицо?
Снова взрыв смеха. Он не мог взять в толк. Обычные ребята так не поступают, обычные ребята не такие злые, кто же эти такие?
- Не следует стыдиться того, что ты стар.
Один из парней опустошил банку пива. Отбросил ее в сторону.
- Но нужно стыдиться лет, прожитых зря. И ты, папаша, напоминаешь никому не нужное барахло.
- Я еще полон сил, сынок.
- Представь, что одна из этих малышек даст тебе взглянуть на пизду, папаша, что бы ты сделал ради этого?
- Род, не смей так говорить!
Это говорила девчушка с длинными рыжими волосами. Она укладывала волосы, разметанные ветром, казалось, она сама колыхается на ветру, с ногами, утонувшими в песке.
- Что скажешь, папаша? А? Что бы ты сделал за то, чтоб одна из наших девушек тебе отдалась?
Он пошел размеренным шагом, развернулся за их колыхавшимися накидками и направился к тропинке, зачинавшейся возле пляжа.
- Род, почему ты так разговаривал с тем несчастным старичком? Иногда я тебя просто ненавижу!
- Иди сюда, крошка!
- Нет!
Он обернулся и увидел, как Род принялся охотиться за девушкой. Девчушка кричала благим матом, потом принялась смеяться. Род настиг ее, и они повалились в песок, борясь и смеясь одновременно. Он увидел и вторую парочку, они целовались.
Ступив на тропинку, он присел на лавчонку и счистил песок со ступней. Потом одел ботинки. Через десять минут он был в своей комнате. Он снял ботинки и лег на постель. Свет зажигать не стал.
Вот кто-то постучался.
- Мистер Снид?
- Да?
Дверь открылась. Это была хозяйка, миссис Коннерс. Миссис Коннерс было 65 лет, ее лица было не разглядеть в темноте. Он был доволен тем, что лица не было видно в темноте.
- Мистер Снид?
- Да?
- Я приготовила бульон. Я приготовила очень вкусный бульон. Давайте я принесу вам миску бульона?
- Нет, я не хочу.
- Но послушайте, мистер Снид, это чудеснейший бульон, действительно очень вкусный! Давайте принесу миску!
- Ну хорошо.
Он поднялся, уселся на стул и принялся ждать. Она оставила дверь открытой, и из коридора лился свет. Яркий луч света, он пересекал ноги и ложился на колени. Туда она и поставила суп. Тарелку с супом и ложку.
- Вам понравится, мистер Снид. Я умею готовить бульон.
- Спасибо, - сказал он.
Он стал разглядывать бульон. Тот был желт, как моча. Это был куриный бульон. Мяса в нем не было. Он уставился на круги жира, которые плавали в бульоне. Посидел еще. Потом вынул ложку из тарелки и положил ее в буфет. Потом понес бульон к окну, приподнял сетку от комаров и принялся тихонько наклонять тарелку. С земли пошел легкий запах. Потом исчез. Он поставил тарелку на буфет, закрыл окно и вернулся на постель. Было темнее чем прежде, ему нравилась темнота, в ней был смысл.
Он стал прислушиваться очень внимательно и так услышал океан. Немного послушал океан, вздохнул, вздохнул еще раз глубоко и умер.
Перевод с итальянского