Pages

Tuesday, January 17, 2012

String replacing in VIM.


To replace a string with vim do the following:
:%s/string/replace string/g
% - means search and replace in whole file
If you want to replace stuff in certain portion of the file you can do following:

:20,50 s/string/replace string/g
:20,50 will search and replace string in rows between 20 and 50

Escaping special chars with \. Look at following example. I need to replace /usr/src/ with /var/log/archive in one of my scripts:
:%s/\/usr\/src/\/var\/log\/archive/g

Sunday, December 4, 2011

PowerMac G4/1Ghz with Nvidia GeForce 440mx notes

Just a few notes for OpenFirmware, Xorg configuration. Sources guide-open-firmware-apple-bios-0, xorgconf-powermac-g41ghz-geforce-4-mx-apple-studio-display-17, http://sowerbutts.com/linux-mac-mini/.

OpenFirmware:
  • ls - displays contents of the current path in the device tree.
  • devalias - provides a list of short alias names for key hardware devices.
  • .properties - provides a list of properties for the selected device.
  • pwd - displays the current path within the device tree.
  • dev - selects a device (using either the alias or absolute/relative device tree path).
  • words - provides a list of forth scripts associated with the selected device.
  • source - executes a particular forth script.
  • load - loads a image from disk, cd, network or another device.
  • go - execites the currently loaded image.
  • see - displays the source code for a particular forth script.
Booting installation of Debian GNU/Linux Squeeze 6.0 on PowerMac G4/1Ghz: 
0>boot cd:,\install\yaboot
 Partition disk:
1. Don't touch the small Partition #1 at the start of the disk, that contains the partition map itself.
2. Partition #2 (16MB) is for "yaboot", the bootstrap that allows you to boot

3. Linux or MacOS. You want to tell the partitioner to use that partition as a "NewWorld boot partition", and set the bootable flag.
4. Partition #3 (2.0GB) should be used as "swap area".
5. Partition #4 (48.0GB) is your root filesystem, you want to use that as a "ReiserFS journalling file system", format it, and mount it on "/"
 Booting after installation:
0>setenv boot-file hd:3,\yaboot

Xorg.conf PowerMac G4/1GHz GeForce 4 MX:

Section "Device"
Identifier "Configured Video Device"
BusID   "PCI:0:16:0"
Driver  "nv"
EndSection

Section "Monitor"
    Identifier    "StudioDisplay17"
    Option "DPMS"
    HorizSync   30-80
    VertRefresh   50-100
EndSection

Section "Screen"
    Identifier    "Default Screen"
    Monitor        "StudioDisplay17"
    Device        "Configured Video Device"
        DefaultDepth    24
           SubSection       "Display"
             Depth            24
             Modes             "1280x1024" "1024x768" "800x600" "640x480"
           EndSubSection
           SubSection        "Display"
             Depth            16
             Modes             "1280x1024" "1024x768""800x600" "640x480"
           EndSubSection
SubSection "Display"
      Depth      15
      Modes      "1280x1024" "1024x768" "800x600" "640x480"
   EndSubSection
SubSection "Display"
      Depth      8
      Modes      "1280x1024" "1024x768" "800x600" "640x480"
   EndSubSection
SubSection "Display"
      Depth      4
      Modes      "1280x1024" "1024x768" "800x600" "640x480"
   EndSubSection
SubSection "Display"
      Depth      1
      Modes      "1280x1024" "1024x768" "800x600" "640x480"
   EndSubSection
EndSection

Section "ServerLayout"
   Identifier   "Default Layout"
   Screen      "Default Screen"
EndSection

Section "DRI"
   Mode   0666
EndSection




Monday, November 28, 2011

Изложба на Иван Христов - Грога, 15.12.2011 - галерия Аспект - Пловдив


На 15.12.2011г. габровският художник Иван Христов - Грога (всъщност това е баща ми) открива самостоятелна изложба в Пловдив - галерия "Аспект", площад "Стефан Стамболов" 1А (до общината). Откриването е между 16:00 - 20:00 часа.


За повече информация може да посетите сайта му http://groga.gabrovo.com/ а също така и на facebook страницата му: http://www.facebook.com/...

Monday, November 14, 2011

Втори и трети опит за домашна бира.

След успеха на първият опит си поръчах още 2 кита. Правих ги един след друг с разлика няколко дена. Изборът ми се спря на Multons Premium Bitter (светла) и Midland Mild Ale (тъмна).


Ферментацията става по вече описания от мен начин. Важно е просто да се спазват инструкциите.

Midland Mild Ale - до момента на мен не ми беше харесвала тъмна бира. Пробвал съм почти всички които ги има на пазара (за бутилираните говоря) но така и не повторих. Тази мога да кажа че беше супер без никакви забележки. Трябва да отблежа че не харесвам много горчиви бири а това е Ейл който по принцип трябва да е сладникав.


Premium Bitter - това трябва да е типичен английски битер и може би за това на мен не ми хареса. Прекалено ми е горчива. От друга страна родителите ми много я харесаха от което следва че всичко е до въпрос на вкус. Просто трябва да се пробва.

Следващото което ще тествам е пак на Muntons Export Pilsner.

Tuesday, October 18, 2011

Fix console font on NetBSD 5.1/macppc

One of annoying things about booting NetBSD 5.1 on PowerMAC G4 after install is console font which is too big to fit in screen. Today I found solution on port-macppc mailing list. You can see it here http://mail-index.netbsd.org/port-macppc/2011/10/18/msg001479.html.

Edit your kernel config file to look like this:

#options    FONT_GALLANT12x22
options       FONT_VT8x8
then recompile and reboot.

Saturday, October 15, 2011

Webkit-gtk on NetBSD 5.1/macppc additional notes (solved)

I've got response from bug report on webkit-gtk (pkg/45429) and here is solution for fixing compiling process on NetBSD/macppc. Create a file named hacks.mk in pkgsrc/www/webkit-gtk. Copy/paste the following and then do make clean; make.

# $NetBSD: hacks.mk,v 1.4 2010/11/02 07:54:31 wiz Exp $

.include "../../mk/compiler.mk"

### [Sun Nov 14 02:35:50 EST 2004 : jlam]
### On PowerPC, building with optimisation with GCC causes an "attempt
### to free unreference scalar".  Remove optimisation flags as a
### workaround until GCC is fixed.
###
.if !empty(CC_VERSION:Mgcc*) && !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc)
PKG_HACKS+=             powerpc-codegen
BUILDLINK_TRANSFORM+=   rename:-O2:-O0
.endif