Re: cdio burning images

2011-11-18 Thread Sviatoslav Chagaev
If you are using a CD-RW -- make sure you have blanked it first by

  cdio blank


Also, if you're using the first drive, i.e. cd0, you don't have
to specify the device, you can just type

  cdio tao image.iso


On Fri, 11 Nov 2011 23:07:41 +1100 John Tate  wrote:
> # cdio -f cd0c tao /home/john/ubuntu-11.10-desktop-i386.iso
> cdio: The media can't be written in TAO mode
> 
> What am I doing wrong?
> 
> 
> -- 
> www.johntate.org



Re: Why I uninstalled OpenBSD…

2011-10-02 Thread Sviatoslav Chagaev
RTFM.

http://www.openbsd.org/security.html#process
http://www.openbsd.org/papers/



Re: can not turn num lock on/off on keyboard

2011-05-19 Thread Sviatoslav Chagaev
I think this is intentional.
I think when X has some use for the LED -- it won't let you change it.
For example my Caps Lock LED acts as a 'group led' -- it lights up when
I switch to Russian. Also, I have an older release of Slackware at
work, I remember I was scripting new email notification to light up a
led on the keyboard, and I could only light up scroll lock led.

On Thu, 19 May 2011 10:25:18 +0200
LEVAI Daniel  wrote:

> Hi!
> 
> 
> I can not toggle the numlock led on my keyboard with:
> 
> $ xset led named "Num Lock"
> or
> $ xset led 1..32
> 
> In fact, I can only switch the scroll lock led, when trying all of them:
> 
> for i in $(jot -s' ' 32);do xset led $i; sleep 0.2; xset -led $i;done
> 
> Is this intentional, or is it some limitation in my hardware?
> Oh, and this is and usb keyboard, attached to the laptop, btw.
> 
> 
> 
> $ setxkbmap -print
> xkb_keymap {
> xkb_keycodes  { include "xfree86+aliases(qwerty)"   };
> xkb_types { include "complete"  };
> xkb_compat{ include "complete"  };
> xkb_symbols   { include "pc/pc(pc105)+pc/us"};
> xkb_geometry  { include "pc(pc105)" };
> };
> $ setxkbmap -query
> rules:  xorg
> model:  pc105
> layout: us
> $ dmesg
> OpenBSD 4.9-current (GENERIC.MP) #112: Sat May 14 09:59:17 MDT 2011
> t...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
> cpu0: Genuine Intel(R) CPU T2400 @ 1.83GHz ("GenuineIntel" 686-class) 1.83 GHz
> cpu0: 
> FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM
> real mem  = 2145775616 (2046MB)
> avail mem = 2100494336 (2003MB)
> mainbus0 at root
> bios0 at mainbus0: AT/286+ BIOS, date 08/27/09, BIOS32 rev. 0 @ 0xfd6b0, 
> SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
> bios0: vendor LENOVO version "79ETE5WW (2.25 )" date 08/27/2009
> bios0: LENOVO 2007FRG
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET BOOT SSDT SSDT SSDT SSDT
> acpi0: wakeup devices LID_(S3) SLPB(S3) LURT(S3) DURT(S3) EXP0(S4) EXP1(S4) 
> EXP2(S4) EXP3(S4) PCI1(S4) USB0(S3) USB1(S3) USB2(S3) USB7(S3) HDEF(S4)
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpiec0 at acpi0
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: apic clock running at 166MHz
> cpu1 at mainbus0: apid 1 (application processor)
> cpu1: Genuine Intel(R) CPU T2400 @ 1.83GHz ("GenuineIntel" 686-class) 1.83 GHz
> cpu1: 
> FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM
> ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
> ioapic0: misconfigured as apic 2, remapped to apid 1
> acpimcfg0 at acpi0 addr 0xf000, bus 0-63
> acpihpet0 at acpi0: 14318179 Hz
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 1 (AGP_)
> acpiprt2 at acpi0: bus 2 (EXP0)
> acpiprt3 at acpi0: bus 3 (EXP1)
> acpiprt4 at acpi0: bus 4 (EXP2)
> acpiprt5 at acpi0: bus 12 (EXP3)
> acpiprt6 at acpi0: bus 21 (PCI1)
> acpicpu0 at acpi0: C3, C2, C1, PSS
> acpicpu1 at acpi0: C3, C2, C1, PSS
> acpipwrres0 at acpi0: PUBS
> acpitz0 at acpi0: critical temperature 127 degC
> acpitz1 at acpi0: critical temperature 99 degC
> acpibtn0 at acpi0: LID_
> acpibtn1 at acpi0: SLPB
> acpibat0 at acpi0: BAT0 model "93P5030" serial  2444 type LION oem "SONY"
> acpibat1 at acpi0: BAT1 not present
> acpiac0 at acpi0: AC unit online
> acpithinkpad0 at acpi0
> acpidock0 at acpi0: GDCK not docked (0)
> bios0: ROM list: 0xc/0xfe00 0xd/0x1000 0xd1000/0x1000 0xdc000/0x4000! 
> 0xe/0x1!
> cpu0: Enhanced SpeedStep 1829 MHz: speeds: 1833, 1333, 1000 MHz
> pci0 at mainbus0 bus 0: configuration mode 1 (bios)
> pchb0 at pci0 dev 0 function 0 "Intel 82945GM Host" rev 0x03
> ppb0 at pci0 dev 1 function 0 "Intel 82945GM PCIE" rev 0x03: apic 1 int 16
> pci1 at ppb0 bus 1
> vga1 at pci1 dev 0 function 0 "ATI Radeon Mobility X1400" rev 0x00
> wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
> wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
> radeondrm0 at vga1: apic 1 int 16
> drm0 at radeondrm0
> azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02: apic 1 
> int 17
> azalia0: codecs: Analog Devices AD1981HD, 0x/0x, using Analog Devices 
> AD1981HD
> audio0 at azalia0
> ppb1 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: apic 1 int 20
> pci2 at ppb1 bus 2
> em0 at pci2 dev 0 function 0 "Intel PRO/1000MT (82573L)" rev 0x00: apic 1 int 
> 16, address 00:16:41:aa:d2:70
> ppb2 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: apic 1 int 21
> pci3 at ppb2 bus 3
> wpi0 at pci3 dev 0 function 0 "Intel PRO/Wireless 3945ABG" rev 0x02: apic 1 
> int 17, MoW2, address 00:18:de:65:2d:37
> ppb3 at pci0 dev 28 function 2 "Intel 82801GB PCIE" rev 0x02: apic 1 int 22
> pci4 at ppb3 bus 4
> ppb4 at pci0 dev 28 funct

no rgb font anti-aliasing in GTK2 apps

2011-05-17 Thread Sviatoslav Chagaev
Hi,

(I'm running i386/current but this was also true when I installed
amd64/4.9 recently)

I noticed that the fonts in GTK2 apps are not RGB anti-aliased, even
though I created a symlink /etc/fonts/conf.d/10-sub-pixel-rgb.conf
-> ../conf.avail/10-sub-pixel-rgb.conf. Creating this symlink always
worked in the past.

Then I also tried adding the following lines to my ~/.gtkrc-2.0:
gtk-xft-hinting = 1
gtk-xft-hintstyle = "hintfull"
gtk-xft-antialias = 1
gtk-xft-rgba = "rgb"

and adding the following lines to my ~/.Xdefaults:
Xft*dpi:   96
Xft*antialias: true
Xft*hinting:   true
Xft*hintstyle: hintfull
Xft*rgba:  rgb

still no luck.

The weird thing is, I can see that cwm(1), for example,
does perform an RGB anti-alias.

Anyone knows what's going on in here?
I have a suspicion that maybe with the recent versions of GTK,
this setting is controlled from within GTK with that gconf-tool
or something?



Re: Things to do with a Pentium 166MHz cpu - 32 MB of RAM - 1.5 GB disk

2011-05-15 Thread Sviatoslav Chagaev
On Sun, 15 May 2011 19:48:36 +0300
Michael Sioutis  wrote:

> Hello,
> 
> I ressurected an old pc yesterday (specs on title) with OpenBSD 4.9
> and without X to keep it light. It
> runs ridiculously well! Everything works fine except the automatic
> powerdown (shutdown -hp now), which
> is not supported aparently by the mobo, anyway, don't care about that.
> 
> I currently have sshd, pf, sshguard and sendmail running, all in 4-5
> MB of 18-21 available RAM (the rest is taken
> by the hardware I suppose) and 1-2 MB of 42 MB swap.
> 
> I could turn it into a firewall, but I allready have one, and I am not
> very excited about the idea.
> What I do find exciting is teaching my nephew some computer/programming 
> basics.
> Anyone find it a good idea?
> 
> I have allready installed python and gprolog, which I like for basic
> aritmhetics stuff.
> 
> What dissapoints me the most, is that there don't exist USB ports and
> they might not even be supported, the pc
> is from 1998.
> I could use rtorrent with screen to download stuff to an external hard drive..
> But I will check on that when I find the time to open the case.
> 
> What else could I use it for?
> 
> Thank you!
> Mike
> 

It should have an LPT port, you can use this port to interface with
other electronic devices. Anything from lighting up a few LEDs to
automatizing your home. I use the LPT port to upload firmware to
Atmel AVR microcontrollers for example (there is a C compiler for them
pkg_add -vi {avr-gcc,avr-libc,avr-binutils}).

http://logix4u.net/Legacy_Ports/Parallel_Port/A_tutorial_on_Parallel_port_Interfacing.html
http://www.kpsec.freeuk.com/
$ man i386_iopl
or
$ man amd64_iopl
and see the inb/outb functions/macros in /usr/include/{i386,amd64}/pio.h



Re: Help finding file-analysis tool?

2011-05-15 Thread Sviatoslav Chagaev
On Mon, 2 May 2011 17:50:48 -0400 (EDT)
Dave Anderson  wrote:

> Sorry to bother you all, but I'm failing miserably at searching for a
> tool to help analyze the structure of arbitrary files (prefereably one
> which runs on OpenBSD).
> 
> I've got a device which exports data in a undocumented format and the
> only program available to use that data doesn't do what I need, so I
> need to figure out the file formats so I can communicate with the device
> the way I need to.
> 
> What I'm looking for is an interactive program which makes it easy to
> look at selected parts of a file (individual items, sets of items
> located at regular intervals, sets of items linked by pointers or
> offsets, etc) in any of many formats (ascii, unicode, int, double float,
> etc) and either endianness, store comments about items or sets of items
> in an aux file, store names for various values in particular items and
> display those items values using those names, search for patterns at
> regular intervals or linked by pointers or offsets, etc, etc, etc; all
> those things which make it easier to discover and keep track of the
> structure of an unknown file.
> 
> It's hard to believe that nobody has ever written such a program, but
> I've been unable to find one.  Any suggestions for effective searches or
> for suitable programs would be appreciated.
> 
> Thanks,
> 
>   Dave
> 
> -- 
> Dave Anderson
> 
> 

Never heard of such a program.
I would use /usr/ports/editors/bvi, a hex editor, and Python, a very
high-level scripting language in which you can perform various
operations on data pretty easily.
 f = open('myfile.dat', 'rb')
 bytes = f.read(4)
 msg = 'first 4 bytes in hex: '
 for x in bytes:
 msg += hex(ord(x))[2:].upper()
 print msg
You could create a .py file with various useful functions, then start
up Python interpreter, import this file and explore the file
interactively by calling functions.
Conceive a theory by trying to think how would you create a file for
these purposes and by trying to see patterns in the file, test the
theory by changing the file one thing at a time, observe behavior,
repeat.



dell latitude d430 + port replicator -- is okay?

2011-02-04 Thread Sviatoslav Chagaev
Hi,

I want to buy a DELL Latitude D430 + a port replicator (for the DVI and
LPT ports).

Does this laptop work okay with OBSD?

How about the port replicator? Does it need any kind of support from
the OS (e.g. drivers) or is it just an electromechanical contraption?

Thanks.



Re: xxkb in 4.8-BETA

2010-08-06 Thread Sviatoslav Chagaev
On Mon, 2 Aug 2010 14:08:24 +0300, Gregory Edigarov wrote:
> Hello,
> 
> 
> There is a trouble switching keyboard maps in 4.8-BETA:
> Section "InputDevice"
> Identifier  "Keyboard0"
> Driver  "kbd"
> Option  "XkbModel" "pc105"
> Option  "XkbLayout"  "us,ru"
> Option  "XkbOptions"
> "grp_led:scroll,grp:ctrl_shift_toggle" EndSection
> strange, but this only adds only "us" layout, so I've put
> 
> setxkbmap -layout us,ru
> 
> into my .xsession file, and after that everithing works fine.
>  
> 

A week or so ago, I upgraded to a snapshot and had this same problem,
in X log, it would write

...
[266813.036] (**) Mouse0: (accel) acceleration threshold: 4
[266813.037] (**) Option "CoreKeyboard"
[266813.037] (**) Keyboard0: always reports core events
[266813.037] (**) Option "Protocol" "standard"
[266813.037] (**) Keyboard0: Protocol: standard
*** [266813.037] (--) Keyboard0: using wscons layout us ***
[266813.037] (**) Option "XkbRules" "xorg"
[266813.037] (**) Keyboard0: XkbRules: "xorg"
[266813.037] (**) Option "XkbModel" "pc104"
[266813.037] (**) Keyboard0: XkbModel: "pc104"
[266813.037] (**) Option "XkbLayout" "us"
[266813.037] (**) Keyboard0: XkbLayout: "us"
[266813.037] (**) Option "XkbVariant" ",winkeys"
...

While I had 
  Option "XkbLayout" "lv,ru"
in my xorg.conf...

So I checked out the latest /usr/xenocara, compiled it and the problem
was already gone.



Re: how to type non latin in xterm?; video stream to watch FIFA World Cup?

2010-06-08 Thread Sviatoslav Chagaev
On Tue, 8 Jun 2010 00:40:06 +0200, Tomas Bodzar wrote:
> Just start uxterm(1) and you will be much more happy. And luit(1) is
> good candidate for reading too.

Thanks for the reply. Yeah, this works too, but also partially: when I 
set -o emacs
in ksh, I can't input non-latin chars, so I have to
set +o emacs-usemeta
and it becomes basically the same as in Rune Lynge's post.

Ugh, forget it. I guess I'll just shut up, since I'm not up to
implementing locale support in OBSD =)

> 
> On Tue, Jun 8, 2010 at 12:16 AM, Sviatoslav Chagaev
> <0x1...@gmail.com> wrote:
> > Hi misc@
> >
> > I want to be able to type non latin characters in xterm (Russian and
> > Latvian).
> > I sat down, read xterm manpage and tried playing with all the
> > options which even remotely looked like they could influence
> > something. But the only thing I managed to get working is xterm
> > displaying UTF-8 correctly.
> >
> > Here's my ~/.Xdefaults:
> >
> > XTerm*loginShell: true
> > XTerm*useClipping: false
> > XTerm*geometry: 119x38
> > XTerm*termName: xterm-xfree86
> > XTerm*scrollBar: false
> > XTerm*rightScrollBar: true
> > XTerm*colorMode: true
> > XTerm*colorBDMode: false
> > XTerm*boldColors: true
> > XTerm*boldMode: true
> > XTerm*cutNewline: false
> > XTerm*cutToBeginningOfLine: false
> > XTerm*trimSelection: true
> > XTerm*internalBorder: 2
> > XTerm*Font: -*-terminus-medium-*-*-*-14-*-*-*-*-*-iso10646-1
> > XTerm*Foreground: rgb:cc/cc/cc
> > XTerm*Background: black
> > XTerm*locale: false
> > XTerm*utf8: 2
> > XTerm*deleteIsDEL: true
> > XTerm*eightBitInput: true
> >
> >
> > export LANG=en_US.UTF-8
> > export LC_CTYPE=en_US.UTF-8
> > export LC_NUMERIC=en_US.UTF-8
> > export LC_TIME=en_US.UTF-8
> > export LC_COLLATE=en_US.UTF-8
> > export LC_MONETARY=en_US.UTF-8
> > export LC_MESSAGES=en_US.UTF-8
> > export LC_PAPER=en_US.UTF-8
> > export LC_NAME=en_US.UTF-8
> > export LC_ADDRESS=en_US.UTF-8
> > export LC_TELEPHONE=en_US.UTF-8
> > export LC_MEASUREMENT=en_US.UTF-8
> > export LC_IDENTIFICATION=en_US.UTF-8
> > export LC_ALL=en_US.UTF-8
> > xterm
> >
> > Didn't help too.
> >
> > The annoying thing is that when I start vim in xterm, I *can* type
> > in any language with no problem.
> >
> > export LANG=en_US.UTF-8 LC_ALL
> >
> > Is it possible to enable non latin input in xterm somehow?
> >
> > ---
> >
> > And while I'm here, do you know of any video stream of some channel
> > or something which mplayer (or something from ports) could play and
> > where they'll show FIFA World Cup? My TV receives badly, with a lot
> > of noise, so I thought that maybe even an internet stream could be
> > better, plus I want commentaries in English.



Re: how to type non latin in xterm?; video stream to watch FIFA World Cup?

2010-06-08 Thread Sviatoslav Chagaev
On Tue, 8 Jun 2010 11:51:22 +0200, Rune Lynge wrote:
> Hi Sviatoslav,
> 
> On Tue, Jun 8, 2010 at 12:16 AM, Sviatoslav Chagaev
> <0x1...@gmail.com> wrote:
> > I want to be able to type non latin characters in xterm (Russian and
> > Latvian).
> 
> [SNIP]
> 
> > Is it possible to enable non latin input in xterm somehow?
> 
> Are you using ksh in emacs editing mode? A  'set +o emacs-usemeta'
> might help you.

Thanks for the reply. Yup, ksh in emacs mode. It does indeed work, but
partially, meaning that when I type something, some letters appear as
empty squares: http://img541.imageshack.us/img541/2549/0060c.jpg
(same thing with Liberation Mono font)

>From the ksh manpage:

emacs-usemetaIn emacs command-line editing, use the
 8th bit as meta (^[) prefix.  This is the default.

I guess it prepends every char which has 8-th bit on with a ^[ ?..

> 
> Note that UTF-8 locale support in OpenBSD is ... well, waiting for
> diffs, afaik; see
> <http://kerneltrap.org/mailarchive/openbsd-misc/2007/11/2/380315/thread>.
> But setting a LC_CTYPE will bring you some of the way depending on
> your selection of applications.
> 
> Best regards,
> Rune



Re: how to type non latin in xterm?; video stream to watch FIFA World Cup?

2010-06-07 Thread Sviatoslav Chagaev
On Tue, 8 Jun 2010 01:16:48 +0300, Sviatoslav Chagaev wrote:
> export LANG=en_US.UTF-8 LC_ALL
Disregard that line =)



how to type non latin in xterm?; video stream to watch FIFA World Cup?

2010-06-07 Thread Sviatoslav Chagaev
Hi misc@

I want to be able to type non latin characters in xterm (Russian and
Latvian).
I sat down, read xterm manpage and tried playing with all the options
which even remotely looked like they could influence something.
But the only thing I managed to get working is xterm displaying UTF-8
correctly.

Here's my ~/.Xdefaults:

XTerm*loginShell: true
XTerm*useClipping: false
XTerm*geometry: 119x38
XTerm*termName: xterm-xfree86
XTerm*scrollBar: false
XTerm*rightScrollBar: true
XTerm*colorMode: true
XTerm*colorBDMode: false
XTerm*boldColors: true
XTerm*boldMode: true
XTerm*cutNewline: false
XTerm*cutToBeginningOfLine: false
XTerm*trimSelection: true
XTerm*internalBorder: 2
XTerm*Font: -*-terminus-medium-*-*-*-14-*-*-*-*-*-iso10646-1
XTerm*Foreground: rgb:cc/cc/cc
XTerm*Background: black
XTerm*locale: false
XTerm*utf8: 2
XTerm*deleteIsDEL: true
XTerm*eightBitInput: true


export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LC_NUMERIC=en_US.UTF-8
export LC_TIME=en_US.UTF-8
export LC_COLLATE=en_US.UTF-8
export LC_MONETARY=en_US.UTF-8
export LC_MESSAGES=en_US.UTF-8
export LC_PAPER=en_US.UTF-8
export LC_NAME=en_US.UTF-8
export LC_ADDRESS=en_US.UTF-8
export LC_TELEPHONE=en_US.UTF-8
export LC_MEASUREMENT=en_US.UTF-8
export LC_IDENTIFICATION=en_US.UTF-8
export LC_ALL=en_US.UTF-8
xterm

Didn't help too.

The annoying thing is that when I start vim in xterm, I *can* type in
any language with no problem.

export LANG=en_US.UTF-8 LC_ALL

Is it possible to enable non latin input in xterm somehow?

---

And while I'm here, do you know of any video stream of some channel or
something which mplayer (or something from ports) could play and where
they'll show FIFA World Cup? My TV receives badly, with a lot of noise,
so I thought that maybe even an internet stream could be better, plus I
want commentaries in English.



Re: UVC Webcams

2010-06-02 Thread Sviatoslav Chagaev
On Wed, 2 Jun 2010 11:03:26 -0700 (PDT), Robert Kopp wrote:
> I have used a number of operating systems, including Linux and
> FreeBSD, and am thinking about adding OpenBSD to the list. (This
> would be i386, or amd64 if the latter has enough features: my
> hardware will support it). I use a UVC Webcam with Linux, and it
> would increase my motivation to try OpenBSD if such equipment would
> also work with that OS. I heard that 4.4 offered "partial" support,
> and there are more recent releases than that. Has anyone here tried
> using such a Webcam (say, with Skype or Ekiga?). Skype probably
> doesn't work unless Linux emulation is pretty well-developed, as with
> FreeBSD, but there should be a native port of Ekiga.
> 
>  
> Robert "Tim" Kopp 
> http://analytic.tripod.com/
> 

>From my personal experiences -- I wouldn't count on Skype. I could get
it to run, but I couldn't make it display cyrillic characters
properly and it worked somewhat oddly, ultimately it would freeze up
after a few minutes of work.
USB webcams work.



Re: help configuring pf: one net can access other but not vice versa

2010-05-09 Thread Sviatoslav Chagaev
On Sun, 9 May 2010 02:47:15 +0300, Jussi Peltola wrote:
> On Sun, May 09, 2010 at 01:59:16AM +0300, Sviatoslav Chagaev wrote:
> > Hello,
> > 
> > I have the following network configuration:
> > 
> > $ext_if -- wired interface, connected to my ISP's network, with a
> > real IP address, visible from the Intertubes.
> > 
> > $int_if -- wired interface, to which comps on my home LAN are
> > connected
> > 
> > $wifi_if -- wifi interface, working in host ap mode, free-for-all
> > 
> > I've set up two NATs so that comps on $int_if:network and
> > $wifi_if:network could access the Intertubes.
> > 
> > Now I want the following:
> > so that comps from $int_if:network could access $wifi_if:network
> > (say, ssh to comps over there) but not vice versa.
> > 
> > How do I do this?
> > 
> > Everything I try either ends up blocking all traffic or allowing
> > traffic both initiated from $int_if:network to $wifi_if:network and
> > vice versa in a strange way: only every second response gets to
> > destination, i.e. I see ping like:
> > seq_num: 2
> > seq_num: 4
> > ...etc
> > 
> > Here's my current config file (with many failed attempts commented
> > out), system is 4.5:
> > 
> > #
> > # See pf.conf(5) for syntax and examples; this sample ruleset uses
> > # require-order to permit mixing of NAT/RDR and filter rules.
> > # Remember to set net.inet.ip.forwarding=1 and/or
> > # net.inet6.ip6.forwarding=1 in /etc/sysctl.conf if packets are to
> > # be forwarded between interfaces.
> > 
> > ext_if='fxp0'
> > int_if='sis0'
> > wifi_if='ral0'
> > 
> > # Limit speed on wifi_if to 2 megabits
> > #altq on $wifi_if cbq bandwidth 2Mb queue std
> > #queue std bandwidth 100% cbq(default)
> > 
> > # block return in all
> > # block return out all
> > 
> > set require-order no
> >
> > set skip on lo
> > scrub in
> > 
> > # NAT
> > nat on $ext_if from $int_if:network to any -> $ext_if
> > nat on $ext_if from $wifi_if:network to any -> $ext_if
> > 
> > # NAT/filter rules and anchors for ftp-proxy(8)
> > #nat-anchor "ftp-proxy/*"
> > #rdr-anchor "ftp-proxy/*"
> > #rdr pass on ! egress proto tcp to port ftp -> 127.0.0.1 port 8021
> > #anchor "ftp-proxy/*"
> > #pass out proto tcp from $proxy to any port ftp
> > 
> > # Filter for $ext_if
> > block return in on $ext_if
> > pass in on $ext_if proto tcp from any to any port { www, 222 }
> 
> this is unnecessarily broad. to $ext_if would be adequate.
> 
> To do what you want to do, I'd write something like the following:
> 
> set block-policy return
> 
> antispoof quick for { $int_if, $wifi_if, $ext_if }
> 
> block all
> 
> pass out on $ext_if
> pass out on $wifi_if proto tcp from $int_if:network to
> $wifi_if:network port ssh pass in on $ext_if proto tcp to $ext_if
> port { www, 222 } pass in on $int_if
> pass in on $wifi_if
> 

Worked like a charm, thanks!



help configuring pf: one net can access other but not vice versa

2010-05-08 Thread Sviatoslav Chagaev
Hello,

I have the following network configuration:

$ext_if -- wired interface, connected to my ISP's network, with a real
IP address, visible from the Intertubes.

$int_if -- wired interface, to which comps on my home LAN are connected

$wifi_if -- wifi interface, working in host ap mode, free-for-all

I've set up two NATs so that comps on $int_if:network and
$wifi_if:network could access the Intertubes.

Now I want the following:
so that comps from $int_if:network could access $wifi_if:network (say,
ssh to comps over there) but not vice versa.

How do I do this?

Everything I try either ends up blocking all traffic or allowing
traffic both initiated from $int_if:network to $wifi_if:network and
vice versa in a strange way: only every second response gets to
destination, i.e. I see ping like:
seq_num: 2
seq_num: 4
...etc

Here's my current config file (with many failed attempts commented out),
system is 4.5:

#
# See pf.conf(5) for syntax and examples; this sample ruleset uses
# require-order to permit mixing of NAT/RDR and filter rules.
# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1
# in /etc/sysctl.conf if packets are to be forwarded between interfaces.

ext_if='fxp0'
int_if='sis0'
wifi_if='ral0'

# Limit speed on wifi_if to 2 megabits
#altq on $wifi_if cbq bandwidth 2Mb queue std
#queue std bandwidth 100% cbq(default)

# block return in all
# block return out all

set require-order no
set skip on lo
scrub in

# NAT
nat on $ext_if from $int_if:network to any -> $ext_if
nat on $ext_if from $wifi_if:network to any -> $ext_if

# NAT/filter rules and anchors for ftp-proxy(8)
#nat-anchor "ftp-proxy/*"
#rdr-anchor "ftp-proxy/*"
#rdr pass on ! egress proto tcp to port ftp -> 127.0.0.1 port 8021
#anchor "ftp-proxy/*"
#pass out proto tcp from $proxy to any port ftp

# Filter for $ext_if
block return in on $ext_if
pass in on $ext_if proto tcp from any to any port { www, 222 }

# Filter for $wifi_if
#block return in on $wifi_if
#pass in quick on $wifi_if from any to $wifi_if:network
#pass in on $wifi_if from $wifi_if:network to { ! $wifi_if, ! $int_if:network }
#pass in quick on $wifi_if from $int_if:network to any
#block return in on $int_if from $wifi_if:network to any
#block return in on $wifi_if from any to { $wifi_if, $int_if:network }

antispoof log quick for $ext_if
antispoof log quick for $int_if
antispoof log quick for $wifi_if



Is Radeon HD 4870 okay?

2009-08-11 Thread Sviatoslav Chagaev
Hello,

I want to buy a new video card, and I'm considering ATI Radeon HD 4870.

On UNIX (OpenBSD that is), I need the card to:
* be capable of 1920x1...@60hz resolution on DVI-D
* have 2D acceleration (including X-Video)
3D acceleration would be nice but is not required.

I dual-boot for games, so buying something older won't do, I need
fairly modern and powerful hardware.

My motherboard (ASUS M3N78-EM) has a GeForce 8300 chipset (not
supported by "open source"/magic-number nv driver, and I couldn't force
vesa driver to 1920x1080), I'm intending to run OpenBSD/amd64.

So, will 4870 work okay in OBSD? If not, could you please suggest
something that would meet the two above-mentioned criteria and be
powerful enough for gaming?

Thanks!

-- 
Sviatoslav Chagaev 



CardBus not working on DELL Latitude D400 (fixable though)

2009-06-17 Thread Sviatoslav Chagaev
Greetings m...@!

I have a D400 laptop, i386 OpenBSD 4.5 release, and at boot time, I get the 
following messages from kernel (full dmesg in the end of the msg):

cbb0 at pci1 dev 1 function 0 "TI PCI7510 CardBus" rev 0x01: irq 11, CardBus 
support disabled
cbb1 at pci1 dev 1 function 1 "TI PCI7610 CardBus (Smart Card mode)" rev 0x01: 
irq 11, CardBus support disabled

I dived into kernel's source code and found the place where this happens: 
sys/dev/pci/pccbb.c, function pccbbattach() (search "disabled").
The function reads the TI PCI7510 PCI-to-CardBus bridge's PCI configuration 
register 0x18, where the Subordiante Bus, Secondary Bus and Primary Bus numbers 
are stored, sees that they are all 0, and disables CardBus, because it's not 
addressable, because 0 is the address of root PCI bus.

Right now, I added the following code just before the 0x18 register is read in 
sys/dev/pci/pccbb.c:pccbbattach(), which fixes the problem for me:

tmpreg = pci_conf_read(0, pa->pa_tag, 0);
if (PCI_PRODUCT(tmpreg) == PCI_PRODUCT_TI_PCI7510_CB) {
printf("\nD400 fix\n");
busreg = (pcireg_t) (0x20 << 24) | (0x2 << 16) | (0x2 << 8) | (0x1);
pci_conf_write(0, pa->pa_tag, PCI_BUSNUM, busreg);
}

It programs the bridge with a hardcoded Secondary Bus number of 2 (which I 
devised from seeing in dmesg that the greatest bus number is 1).


I'm actually a novice at this, I've started learning about PCI just a few days 
ago (primarily from osdev.org and sites it links to) so I don't completely 
understand the whole system and how it all works/should work. Some questions:

What could be the reason for bus nums in 0x18 reg being set to 0 at autoconf 
time?
Whose responsibility is it to assign bus numbers to PCI bridges, BIOS's or 
kernel's?
Is this my hardware's fault or this could happen to other comps too?
If this is D400's bug of some sort is it possible to incorporate a fix for it 
into kernel, so that it wouldn't impair normal systems?
And can you recommend some good and preferably fresh books or maybe online 
resources on the PC system architecture? The ones that would be useful to an OS 
developer? The PCI specs I downloaded (for free, ALL HAIL GOOGLE: "PCI spec 
filetype:pdf") are too dry and hard to understand.

Thanks!



OpenBSD 4.5 (GENERIC) #1749: Sat Feb 28 14:51:18 MST 2009
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) M processor 1400MHz ("GenuineIntel" 686-class) 1.40 
GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,TM,SBF,EST,TM2
real mem  = 535023616 (510MB)
avail mem = 509046784 (485MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 06/28/05, BIOS32 rev. 0 @ 0xffe90, SMBIOS 
rev. 2.3 @ 0xf8cf0 (61 entries)
bios0: vendor Dell Computer Corporation version "A08" date 06/28/2005
bios0: Dell Computer Corporation Latitude D400
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP ASF!
acpi0: wakeup devices LID_(S3) PBTN(S4) PCI0(S3) USB0(S1) USB1(S1) USB2(S1) 
USB3(S1) MODM(S3) PCIE(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (PCIE)
acpicpu0 at acpi0: C3, C3, C2, C1, FVS, 1400, 1400, 1400, 1400, 1200, 1000, 
800, 600 MHz
acpitz0 at acpi0: critical temperature 99 degC
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0 model "DELL 0006T0" serial 2021 type LION oem "Sanyo"
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: PBTN
acpibtn2 at acpi0: SBTN
acpidock at acpi0 not configured
acpivideo at acpi0 not configured
acpivideo at acpi0 not configured
bios0: ROM list: 0xc/0xd800! 0xcd800/0x800! 0xce000/0x800 0xce800/0x800 
0xcf000/0x800 0xcf800/0x800
cpu0 at mainbus0: (uniprocessor)
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82855GM Host" rev 0x02
"Intel 82855GM Memory" rev 0x02 at pci0 dev 0 function 1 not configured
"Intel 82855GM Config" rev 0x02 at pci0 dev 0 function 3 not configured
vga1 at pci0 dev 2 function 0 "Intel 82855GM Video" rev 0x02
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xf000, size 0x800
inteldrm0 at vga1: irq 11
drm0 at inteldrm0
"Intel 82855GM Video" rev 0x02 at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 29 function 0 "Intel 82801DB USB" rev 0x01: irq 11
uhci1 at pci0 dev 29 function 1 "Intel 82801DB USB" rev 0x01: irq 11
uhci2 at pci0 dev 29 function 2 "Intel 82801DB USB" rev 0x01: irq 11
ehci0 at pci0 dev 29 function 7 "Intel 82801DB USB" rev 0x01: irq 11
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb0 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x81
pci1 at ppb0 bus 1
bge0 at pci1 dev 0 function 0 "Broadcom BCM5705M" rev 0x01, BCM5705 A1 
(0x3001): irq 11, address 00:0f:1f:ab:e2:2a
brgphy0 at bge0 phy 1: BCM5705 10/100/1000baseT PHY, rev. 1
cbb0 at pci1 dev 1 funct

Re: how to undelete?

2008-07-19 Thread Sviatoslav Chagaev
On Sat, 19 Jul 2008 10:18:19 -0400
"Nick Guenther" <[EMAIL PROTECTED]> wrote:
> On Sat, Jul 19, 2008 at 5:23 AM, Die Gestalt <[EMAIL PROTECTED]> wrote:
> > On Mon, Jul 7, 2008 at 9:30 PM, macintoshzoom <[EMAIL PROTECTED]> wrote:
> >> Which hex editor do you advise?
> >> Should I have to umount the partition before?
> >> the partition is 40 GB size on a secondary disk, OpenBSD old slice,
> >> should I need at least such space (/tmp ?) to open it on the hex editor
> >> from my OpenBSD 4.3?
> >
> > There is a very nice hex editor specialized in forensics called
> > WinHex, but it runs on Windows. I don't know if there is an equivalent
> > tool in the *nix world.
> >
> 
> hexdump -C?
> 

bvi ( http://bvi.sourceforge.net/ )



Re: How to write drivers?

2008-05-01 Thread Sviatoslav Chagaev
Thanks!

On Thu, 01 May 2008 11:57:02 -0700
Predrag Punosevac <[EMAIL PROTECTED]> wrote:
> Sviatoslav Chagaev wrote:
> > Yes, I even wrote a program which "talks" with the device directly, with 
> > the help of inb()/outb().
> >
> > But now I want to learn how to write drivers =)
> >
> >   
> http://www.netbsd.org/docs/kernel/ddwg.html
> 
> 
> 
> > On Thu, 1 May 2008 19:22:10 +0200
> > Jonathan Schleifer <[EMAIL PROTECTED]> wrote:
> >
> >   
> >> Sviatoslav Chagaev <[EMAIL PROTECTED]> wrote:
> >>
> >> 
> >>> I need to write a driver for a primitive device which connects to the
> >>> LPT port, so I was wondering, are there any
> >>> manuals/tutorials/HOWTOs/... on this subject?
> >>>   
> >> You don't even need a driver in the kernel for that, you can just
> >> access the lpt device in /dev.
> >>
> >> -- 
> >> Jonathan



Re: How to write drivers?

2008-05-01 Thread Sviatoslav Chagaev
Yes, by default these are blocked. But there are two ways in which you
can gain access to I/O ports:
1) Enable access to all I/O ports for all processes with i386_iopl(2)
2) Enable access to individual I/O ports for the current process with
i386_set_ioperm(2)
Both calls must be called with superuser privileges (and i386_iopl has
even more restrictions).

I'm a CS student, I really like all this low-level stuff, and I want
to learn how OS'es work.

On Thu, 1 May 2008 20:00:38 +0200
Jonathan Schleifer <[EMAIL PROTECTED]> wrote:

> Sviatoslav Chagaev <[EMAIL PROTECTED]> wrote:
> 
> > Yes, I even wrote a program which "talks" with the device directly,
> > with the help of inb()/outb().
> 
> I doubt you could use inb/outb in OpenBSD. The kernel will prevent that.
> Just talk with the device in /dev directly - there is really no need to
> write a driver. OpenBSD already has an LPT driver that gives access to
> it to the userland, so why reinvent the wheel here?
> 
> -- 
> Jonathan



Re: How to write drivers?

2008-05-01 Thread Sviatoslav Chagaev
Thanks!

On Thu, 01 May 2008 13:33:18 -0400
Bret Lambert <[EMAIL PROTECTED]> wrote:

> On Thu, 2008-05-01 at 20:15 +0300, Sviatoslav Chagaev wrote:
> > Hello!
> > 
> > I need to write a driver for a primitive device which connects to the LPT 
> > port, so I was wondering, are there any manuals/tutorials/HOWTOs/... on 
> > this subject?
> > 
> > I could probably just read the source code of OpenBSD and learn from there, 
> > but I'm a beginner programmer, so this probably will take much more time 
> > and there are no guarantees that I won't miss anything...
> > 
> 
> http://www.openbsd.org/papers/opencon06-drivers/index.html
> 
> is a pretty thorough runthrough



Re: How to write drivers?

2008-05-01 Thread Sviatoslav Chagaev
Yes, I even wrote a program which "talks" with the device directly, with the 
help of inb()/outb().

But now I want to learn how to write drivers =)

On Thu, 1 May 2008 19:22:10 +0200
Jonathan Schleifer <[EMAIL PROTECTED]> wrote:

> Sviatoslav Chagaev <[EMAIL PROTECTED]> wrote:
> 
> > I need to write a driver for a primitive device which connects to the
> > LPT port, so I was wondering, are there any
> > manuals/tutorials/HOWTOs/... on this subject?
> 
> You don't even need a driver in the kernel for that, you can just
> access the lpt device in /dev.
> 
> -- 
> Jonathan



How to write drivers?

2008-05-01 Thread Sviatoslav Chagaev
Hello!

I need to write a driver for a primitive device which connects to the LPT port, 
so I was wondering, are there any manuals/tutorials/HOWTOs/... on this subject?

I could probably just read the source code of OpenBSD and learn from there, but 
I'm a beginner programmer, so this probably will take much more time and there 
are no guarantees that I won't miss anything...