Re: Getting screen to lock on suspend with Lenovo Thinkpad X1 Carbon

2019-09-03 Thread joshua stein
On Tue, 03 Sep 2019 at 19:41:40 -0400, Trey Sizemore wrote:
> One remaining issue is getting the screen to lock when the laptop lid is 
> closed and the laptop suspends.  The screen does not lock and just resumes to 
> the XFCE4 desktop.
> 
> I have the following in my .xsession:
> 
> bsd$ cat .xsession
> xidle -timeout 300 -program "/usr/local/bin/slock" &
> 
> Any help greatly appreciated.

xidle locks on SIGUSR1, so you could send it such a signal upon 
suspend.

With apmd enabled, add "pkill -USR1 xidle" to /etc/apm/suspend



Re: video(1) permissions

2019-08-23 Thread joshua stein
On Fri, 23 Aug 2019 at 15:59:19 -, Stuart Henderson wrote:
> On 2019-08-23, Jan Stary  wrote:
> > This is current/amd64 on a Dell Latitude E5570 (dmesg below).
> > It has this integrated camera which I am trying to use with video(1):
> >
> > uvideo0 at uhub0 port 11 configuration 1 interface 0 
> > "CN0J8NNP7248765RBBM6A00 Integrated_Webcam_HD" rev 2.00/54.13 addr 3
> > video0 at uvideo0
> >
> > Running just plain 'video' says
> > video: /dev/video: Permission denied
> >
> > Does that mean video(1) has to be run inside doas(1)?
> > Or is there, say, a group to add myself too, as with
> > e.g. operator to run shutdown? Doesn't seem so:
> >
> > ls -l /dev/video*  
> > lrwxr-xr-x  1 root  wheel 6 Jun 14  2017 /dev/video -> video0
> > crw---  1 root  wheel   44,   0 Aug 19 16:47 /dev/video0
> > crw---  1 root  wheel   44,   1 Aug 19 16:47 /dev/video1
> 
> You can just chown it, or you can use fbtab(5).

xenocara doesn't work with fbtab:

[...]
if (d->windowPath != NULL)  {
/* XXX not working because of pledge() */
Debug("login_fbtab %s %d\n", d->windowPath, geteuid());
login_fbtab(d->windowPath, pwd->pw_uid, pwd->pw_gid);
}

So unfortunately you still need to add such things to 
/etc/X11/xenodm/{Give,Take}Console.



Re: headphone volume levels cannot be manipulated by mixerctl

2019-04-27 Thread joshua stein
On Sat, 27 Apr 2019 at 14:20:32 -, Christian Weisgerber wrote:
> However, as in this example, I think you will only get a few generic
> controls.
> 
> It is my theoretical understanding that USB audio gadgets typically
> come with a uhid(4) device, as does yours above, and you would use
> usbhidctl(1) to list and manipulate the available controls.
> 
> In practice, I only get some variant of
> 
> usbhidctl: USB_GET_REPORT (probably not supported by device): Input/output 
> error
> 
> when I try this.  So either I'm mistaken or there is a problem
> somewhere.

Some devices just don't supply hardware volume controls, so it must 
be done in software on the sending device.

With sndiod, you can use aucatctl to change the software volume 
per-application (or the master volume).

It's all kind of complicated though.  If you plug in a new USB audio 
device like this, you have to restart sndiod and pass in a new 
device name, then use aucatctl to adjust the volume.  But if you 
unplug the USB device, you have to restart sndiod again to use the 
default audio device and use mixerctl instead.



Re: Black screen when starting Xorg with Dell XPS 13 9350

2019-04-13 Thread joshua stein
> On 13/04/2019 16:49, Noth wrote:
> > Hello again,
> > 
> >   I updated to the latest snapshot and now Xorg works! But it has a
> > caveat, the pointer device detected is the touchscreen not the touchpad.
> > It's assigned device wsmouse0 and ums1 doesn't seem to recognize the
> > touchpad anymore so no wsmouse1. I've tested this on the XPS 13 9350 and
> > my new 9370. Same results on both (do make sure you have the latest
> > firmware installed via fw_update).

Did the touchpad ever work or is this a recent regression?

> dwiic0 at pci0 dev 21 function 0 "Intel 100 Series I2C" rev 0x21: apic 2 int
> 16
> iic0 at dwiic0
> dwiic1 at pci0 dev 21 function 1 "Intel 100 Series I2C" rev 0x21: apic 2 int
> 17
> iic1 at dwiic1
> ihidev0 at iic1 addr 0x2cdwiic1: timed out reading remaining 29
> , failed fetching initial HID descriptor



Re: OpenBSD on Macbook 12" 2017?

2019-03-15 Thread joshua stein
On Fri, 15 Mar 2019 at 09:18:02 +0100, Harald Dunkel wrote:
> Hi folks,
> 
> does it work, OpenBSD on a 12" Macbook 2017? I tried Linux once,
> but keyboard and trackpad were not working, so I kept MacOS.

The keyboard and touchpad are connected over SPI now, so they 
require a new Intel SPI controller driver and then two custom 
drivers for the keyboard and touchpad.

So no, the device does not work on OpenBSD unless you use a USB 
keyboard/mouse.



Re: sound volume reduction - chromium

2019-03-08 Thread joshua stein
On Fri, 08 Mar 2019 at 10:46:24 +0200, Mihai Popescu wrote:
> Hello,
> 
> Does anyone observe some sound volume reduction when chromium is
> displaying some specific tabs?
> 
> I am using mpv in xterm with some internet radio, when I point
> chromium to some tabs (with or without multimedia in them, I can't
> figure out for the moment) the sound volume is dropping a little but
> noticeable and it is coming back to normal when I close chromium or
> the offending tabs.

That is probably sndiod(8) doing its default behavior of trying to 
avoid clipping by reducing volume when multiple things are playing.  
See the -w option in the sndiod man page.



Re: wscons API question: input handling?

2019-02-21 Thread joshua stein
On Thu, 21 Feb 2019 at 08:49:26 +0200, Leonid Bobrov wrote:
> On Wed, Feb 20, 2019 at 08:37:59PM -0500, James Huddle wrote:
> > is ncurses too high-level for your needs?  That might work.
> > 
> 
> I said I need a direct access to input devices, ie, /dev/wskbd* and
> /dev/wsmouse*, not a library for text UI. ncurses won't work for what
> I need, and I need to port libinput which works with input devices
> directly, get it?

https://github.com/mpieuchot/libinput



Re: does 'xset(1) dpms 20' activate xidle(1) after 20sec?

2018-11-27 Thread joshua stein
On Tue, 27 Nov 2018 at 14:32:50 +0100, Marcus Merighi wrote:
> Hello, 
> 
> does 'xset(1) dpms 20' activate xidle(1) after 20 seconds?
> 
> How to repeat:
> 
> $ xset dpms 20
> $ xidle -timeout 180 &
> 
> With this I am locked out after 20 seconds, not 180.

The DPMS event activates the X screensaver which generates an X 
event that xidle is listening for.  xidle then runs its specified 
program (or defaults to xlock).



Re: Syncthing

2018-11-23 Thread joshua stein
On Fri, 23 Nov 2018 at 19:48:04 +0100, Jan Betlach wrote:
> Hi all,
> 
> I am trying to sync my media libraries via Syncthing with other machine.
> However Syncthing on OBSD complains about "too many open files" and refuses
> therefore to scan and synchronize the folder.
> 
> I have increased sysctl kern.maxfiles as well as openfiles-max for the
> staff group (of which the user is a member) in login.conf. Probably still
> not enough.
> 
> What are safe maximal values for both (kern.maxfiles and openfiles-max) to
> use?

Hi,

Newer versions of syncthing use kqueue by default to watch for file 
changes which ends up using a couple file descriptors 
per-sub-directory.

You may be better off just disabling this on large shared folders 
and go back to periodic scanning.  This can be done through the web 
interface by clicking on the folder, then Edit, then Advanced, then 
uncheck 'Watch for Changes'.

https://github.com/syncthing/syncthing/issues/5025



Re: getting scrollback buffer on OpenBSD 6.3

2018-08-26 Thread joshua stein
On Sun, 26 Aug 2018 at 13:28:24 -0500, ed...@pettijohn-web.com wrote:
> I'm guessing
> 
> dmesg | grep drm
> 
> Should help since it won't work with inteldrm nor radeondrm. 

Just for the archives, scrollback support for rasops consoles (like 
inteldrm and radeondrm) was added after 6.3.



Re: Serial port pci cards.

2018-04-08 Thread joshua stein

On Sun, 08 Apr 2018 at 12:19:01 -0400, Michael Price wrote:

I am unwise in the ways of serial port pci cards. Should I be avoiding any
particular brands? Any pointers to more information would be appreciated.


The puc(4) man page has a lot of brands and models that are 
supported.




Re: Xenodm login

2017-03-28 Thread joshua stein
On Tue, 28 Mar 2017 at 10:22:32 -0500, Edgar Pettijohn wrote:
> I recently switched to using xenodm to login/startx. Previously I just used
> startx at the command prompt. I'm curious if it's possible to change the
> background around the login prompt. Currently it's a herringbone black and
> gray that is not very appealing. I found where to change the attributes to the
> login box and I have it looking good, but this background is killing me.  Any
> help is appreciated.

/etc/X11/xenodm/Xsetup_0 is run before showing the login dialog, so
you can put something in there like "xsetroot -solid purple".



Chicago BSD Users Group

2016-07-20 Thread joshua stein
Hello,

I am organizing a BSD users group in the Chicago area.  If you are
reading this and have any interest in joining up with other users,
please join the mailing list at talk+subscr...@chibug.org so we can
work out details of meeting up (or just to follow along with the
discussion).

http://chibug.org/

Thanks!



Re: OpenBSD on a Toshiba Chromebook 2

2016-06-11 Thread joshua stein
On Sat, 11 Jun 2016 at 16:45:20 -0400, Alex Ahn wrote:
> Has anyone tried to install OpenBSD on a Toshiba Chromebook 2? And was able
> to boot it without having to hold Ctrl+L, which I heard was a thing with
> SeaBIOS?
> 
> One person was able to install Windows 10 onto one and not have to hold
> down Ctrl+L whenever

No idea on OpenBSD compatibility with the Toshiba Chromebook 2, but
to make SeaBIOS boot by default without hitting control+l:

https://wiki.archlinux.org/index.php/Chrome_OS_devices#Boot_to_SeaBIOS_by_default



Re: Rails and OpenSSL root certs

2016-03-30 Thread joshua stein
On Wed, 30 Mar 2016 at 17:34:16 +0200, Murk Fletcher wrote:
> Anybody here using http://rails-assets.org (to simplify JavaScript assets
> in Rails) and know how to prevent the following error?
> 
> Simply renaming "https" to "http" makes no difference.
> 
> % bundle install
> Fetching source index from https://rails-assets.tenex.tech/
> Retrying source fetch due to error (2/3):
> Bundler::Fetcher::CertificateFailureError Could not verify the SSL
> certificate for https://rails-assets.tenex.tech/.

It looks like that site is using Let's Encrypt, and LE's
cross-signing root was added to /etc/ssl/cert.pem 9 months ago.
You could just fetch an updated version and install it there, which
Ruby is looking at.

http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libcrypto/cert.pem?rev=1.11=text/plain



Re: Xorg not working correctly on MacBookAir5,2

2013-01-01 Thread joshua stein
On Wed, 02 Jan 2013 at 07:16:03 +0400, Sevan / Venture37 wrote:
 Running startx results in a blank screen, able to switch some consoles ok 
 terminate X without any problem.

 [59.147] (II) intel(0): Output VGA disconnected
 [59.147] (II) intel(0): Output HDMI-3 disconnected
 [59.147] (II) intel(0): Output HDMI-4 disconnected
 [59.147] (WW) intel(0): No outputs definitely connected, trying again...
 [59.147] (II) intel(0): Output VGA disconnected
 [59.147] (II) intel(0): Output HDMI-3 disconnected
 [59.147] (II) intel(0): Output HDMI-4 disconnected
 [59.147] (WW) intel(0): Unable to find connected outputs - setting
 1024x768 initial framebuffer

The Macbook Air's display is connected over eDP (DisplayPort), which
our hacked up Intel driver doesn't support, which is why it can't
find any outputs.



Re: Panic when attempting to boot OpenBSD on MacBookAir5,2

2012-12-31 Thread joshua stein
On Mon, 31 Dec 2012 at 20:13:30 +0400, Sevan / Venture37 wrote:
 I've managed to install the 21st of December amd64 snaphot onto my 13 mid
 2012 MacBook Air without any issues, however attempting to boot the
 installed bsd.mp or sp kernel results in a panic
 http://imageshack.us/photo/my-images/685/img1580tq.jpg/

boot -c and disable acpicpu should let it boot.  This patch should
help:

http://marc.info/?l=openbsd-bugsm=135194704503244w=2



Re: OpenBSD Cloud Offerings

2012-11-28 Thread joshua stein
On Tue, 27 Nov 2012 at 14:18:56 -0800, Constantine A. Murenin wrote:
 Don't necessarily look at the OpenBSD version numbers that are
 offered, or whether OpenBSD is specifically supported; at least with
 KVM and Xen HVM, it's almost always possible to get console-based
 access and install whichever version of OpenBSD you please.  Some
 providers offer ssh-based serial console access; some offer VNC-based
 access; installing OpenBSD yourself is a breeze!

Even if you can't get remote console access, it can be possible to
buy a Linux or FreeBSD VPS (or dedicated server), note the IP and
gateway settings, and then generate and dd a Yaifo[0] image directly
to the hard drive.  Remotely reboot the server and it'll (hopefully)
come back online with an SSH interface to the OpenBSD installer.
I've done this with a FreeBSD dedicated server when the provider
wouldn't give me remote console access.  It can be tricky and you
only get one shot at it, but it opens up a lot of possibilities for
cheaper providers that don't directly offer OpenBSD support.

0. https://github.com/jedisct1/yaifo



Re: Preferred method for tracking src with git?

2012-06-04 Thread joshua stein
On Mon, 04 Jun 2012 at 12:52:47 -0700, Matthew Dempsky wrote:
 It looks like ustuehler and jcs both wrote their own cvs-to-git
 importers for handling the OpenBSD src tree:
 
 https://github.com/ustuehler/git-cvs
 https://github.com/jcs/bigcvs2git

Both will convert HEAD properly, but neither has branch support.  I
used the fromcvs/togit tool (which the estpak mirror uses) to
convert the trees I put on Github, but I found out that that tool
doesn't handle all of the branches in OpenBSD's CVS tree properly
which caused some files to be missing or at incorrect revisions on
-stable branches.

I hoped to have properly converted trees on Github for easy
cloning/forking but I got lost trying to add branch support to my
conversion tool that could properly do OpenBSD's trees.



Re: Small USB wifi adapter

2012-04-23 Thread joshua stein
On Mon, Apr 23, 2012 at 12:35:55PM +0100, Laurence Rochfort wrote:
 Hello,
 
 My laptop's integrated wifi adapter is not supported by OpenBSD.
 
 Can anybody suggest a USB adapter that doesn't stick out of the port very
 far?
 
 Ideally I'd like one that protrudes less than a centimeter.  There are
 several on amazon but technical details are scarce.

i have both of these and they work under openbsd:

http://amzn.to/Ia0PuR

http://amzn.to/I67ObN



Re: Hi-Five OpenBSD World - New installation - Power management questions

2012-04-11 Thread joshua stein
  2) To use apmd, do I need to maintain a swap partition? Indeed, should I 
  ALWAYS maintain a swap partition on this simple setup (which is running 
  fine)? I was hoping to get away without one (currently b: is undefined).
 
 Swap partition is optional, as long as you have enough RAM to do what
 you want.

The swap partition is also where the kernel writes useful memory
dumps if it panics, so that savecore(8) can extract it on the next
boot.



Re: The (unofficial) opebsd repo in github is outdated

2012-01-13 Thread joshua stein
 The openbsd repo in github is outdated. Are the owners reading the
 list? Can someone update the repo?. Github doesn't show me a contact
 address for the organization, so I thing this list is the best
 option for report the problem.

the cvs-to-git conversion tool i was using was not producing 100%
accurate trees, leaving some extra files in some of the release
branches and causing some builds to break.  the trees were not being
updated while i was resuming work on my own conversion tool to fix
these problems.

since a few people have asked about them, i've just deleted the
github repos to avoid confusion.  the new trees will have different
histories and git commit hashes so they will need to be
re-downloaded/forked anyway.  i will push the new trees back up to
github when the tool is finished and i have verified that all of the
branches are identical to the cvs versions.



Re: android's adb

2011-10-10 Thread joshua stein
(this should probably be on ports@)

 with more and more android phones around,
 it would be nice to have a working 'adb'
 to make backups and push custom ROMs on the devices.
 
 i found an older adb linux exectuble in their SDK archives.
 it can be started under linux emulation, but that's about it:

i just looked at the code and was able to get most of it to compile
on openbsd, except the usb stub (usb_libusb.c) which requires
libusb-1.0.  we only have libusb-0.1 in our ports tree, which uses
the old api, and the new api has changed pretty much everything.



Re: bringing degraded softraid back online

2011-10-01 Thread joshua stein
 I'm running 4.9 release with 2x usb hard drives in a softraid raid1 setup.
 
 Both drives lost power so both volumes are degraded:
 
 softraid0: trying to bring up sd3 degraded
 softraid0: sd3 offline, will not be brought online
 
 running the following doesn't fix the problem, I just get the same message as 
 above
 bioctl -c 1 -l /dev/sd1a,/dev/sd2a softraid0
 
 The data isn't all that important but I would like to get it back - I don't 
 have a secondary backup.
 
 Is there anyway to say force one volume back online so I can do a rebuild on 
 the other?

boot with only one drive connected, it will bring it up degraded.
plug in the other drive, then 'bioctl -R /dev/sd3a sd2' (assuming it
brings up the degraded array as sd2 with /dev/sd1a, then plugging in
the drive makes it /dev/sd3'.



Re: rebuild RAID1

2011-08-16 Thread joshua stein
 I built my RAID using this : bioctl -c 1 -l wd0k,wd1k softraid0 
 All is ok, sd0c is mounted in /home (cf /etc/fstab) 
 
 Now i disconnected wd1, restart computer. /home is available, but RAID1 is
 degraded. 
 
 Add wd1, restart computer, try bioctl -R sd0 0:1.0 (give me an error like
 not part in /dev/bio.) 

from the man page:

 The following command starts a rebuild of the degraded softraid volume
 sd0 using a new chunk on wd0d:

# bioctl -R /dev/wd0d sd0

so in your case it would be:

bioctl -R /dev/wd1k sd0



Re: hibernation with APM

2011-08-07 Thread joshua stein
 This is semi-OT, but how does that work, actually? I mean, I know how
 suspend to disk works in principle, but if it's done purely from the
 BIOS, wouldn't the BIOS need to know about (and use) a special
 partition to store the RAM contents? Otherwise, how would the BIOS
 know where to store the RAM contents in the absence of OS involvement?

on at least older thinkpads, it would swap to an msdos partition
that had a specially-formatted save2dsk.bin file.  tphdisk in the
ports tree can be used for that.



Re: OpenBSD Apache with IPv6 VirtualHost

2011-07-17 Thread joshua stein
 I try to configure the OpenBSD Apache to use IPv6 with Name based
 VirtualHosts. But it doesn't work. apachectl configtest says:
 [Sun Jul 17 18:12:53 2011] [error] Cannot resolve host
 fd07:8085:b92f:1::1:1 port 80 --- ignoring!

you need -U in httpd_flags in /etc/rc.conf.local



Re: adding Journaled File System (JFS)

2011-07-04 Thread joshua stein
 ok, so... how can do it in such a way it can go into the tree? should
 I re-implement JFS?

maybe look into SU+J?

http://www.mckusick.com/BSDCan/bsdcan2010.pdf

http://www.youtube.com/watch?v=_NuhRkiInvA

http://jeffr-tech.livejournal.com/22716.html



Re: adding Journaled File System (JFS)

2011-07-04 Thread joshua stein
 I think they maybe have the bugs out, but they were still fixing some
 serious issues very recently, and it took us years to get the existing
 softdep code stabilized.

i'm not sure if netbsd's journaling code is any better, but they
also have something for ffs:

http://mail-index.netbsd.org/source-changes/2008/07/31/msg208525.html

http://zhadum.org.uk/2008/08/23/wapbl-vs-soft-dependences/



Re: Tracking What it's changing in current

2011-02-16 Thread joshua stein
  One thing I would really like to see is the diffs of every commit. This is
  available for DragonflyBSD for instance. Is there a way to find this on
  OBSD?
 
  CVS and git are very different I don't think you can easily have this
  feature with CVS (if it exists I'd be glad to know it :)). Personally
 
 Sure it can. see CVSROOT/loginfo. You define a filter and need a
 filter-script that will take files with changed revisions, do the 'cvs
 diff' and mail out the outputs.

that's for running things when commits happen, but not for
generating diffs from a tree after the fact.

(a loginfo script to send diffs/cvsweb urls is at
https://github.com/jcs/cvs-loginfo/blob/master/loginfo.pl)

if you want to generate a single changeset/diff of a commit (which
cvs doesn't support natively), you can use devel/cvsps in the ports
tree to run on a checked-out tree.



Re: x201 + fan noise

2010-10-24 Thread joshua stein
  http://jcs.org/patches/openbsd-acpithinkpad_fan_control.diff
 
 So i tried it but can't have it working on my machine. Kernel crashed
 at startup.  I'm not sure what I can do to modify it right now.

that patch is pretty old, i'm surprised it even applies and
compiles.

 Anyway, to make sure I didn't dream I installed a double boot with a
 linux distribution and while the lappy under linux is really quiet
 (quasi silent), t's really louder on openbsd once I plug it, or plug
 an external screen. Any idea where I can look/need to provide to help
 to fix this behavior?

you're welcome to dig into the linux thinkpad acpi driver:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/platform/x86/thinkpad_acpi.c;h=2d61186ad5a2e96708fcec4beb0a8402eb2bc09f;hb=HEAD#l7145

note all the firmware bug comments, model-specific quirks, watchdog
routines and other stuff in 1300 lines of code just for fan control.
this is why my fan control patch is a hack and won't be committed.



Re: Finding active interface and its ip address within a perl script ?

2010-10-12 Thread joshua stein
   But is there any better ways to work it out ?

you could get the ip of the interface that the default route is
going through:

route -n get default | grep 'if address' | sed 's/.*: //'

or ask ifconfig what is in the egress group and assume the first ip
on the first interface will be ok:

ifconfig egress | grep 'inet ' | head -n1 | awk '{ print $2 }'



Re: xterm + tmux 256 colors

2010-02-17 Thread joshua stein
 It's probably worth noting at this point that the xterm shipped with
 OpenBSD doesn't support 256 colors.

it is supported in snapshots after january 13th; it was enabled
following nicm's ncurses update:

http://www.openbsd.org/cgi-bin/cvsweb/xenocara/app/xterm/xtermcfg.h



Re: Installer caching selections across different installations... how?

2010-02-17 Thread joshua stein
 The install process goes as expected and the virtual machine is running
 happily along...  The thing is, when I create a second brand new virtual
 machine using the process described above and get to the 'select install
 media' step, it already has my local ftp server's name populated!  As far as
 I can tell, the only thing in common between the two installation processes
 is the cd46.iso file.
 
 This isn't necessarily bad, I just can't explain why its happening.  Two
 questions:
 
 1) Is anyone else observing this behavior?
 2) Can anyone explain why it is occurring?

the installer pulls the list of installation mirrors from
ftp.openbsd.org and defaults to one that is assumed to be closest to
you based on your ip address (using geolocation).

at the end of the installation, the mirror you chose (in your case,
your local ftp server) is sent back to ftp.openbsd.org so that it
will be given to you again the next time, assuming your ip is the
same.

from distrib/miniroot/install.sh:

# If we managed to talk to the ftplist server before, tell it what
# location we used... so it can perform magic next time
if [[ -s $SERVERLISTALL ]]; then
_i=
[[ -n $installedfrom ]]  _i=install=$installedfrom
[[ -n $TZ ]]  _i=$_iTZ=$TZ
[[ -n $method ]]  _i=$_imethod=$method

[[ -n $_i ]]  ftp $FTPOPTS -a -o - \
http://129.128.5.191/cgi-bin/ftpinstall.cgi?$_i; /dev/null 21 
fi

because your vmware installations are presumably all coming from the
same ip address, you keep receiving your local ftp server as a
default.



Re: way to help: laptops and weekly

2010-01-24 Thread joshua stein
 Cron runs the weekly update script every Saturday at 3:30am.  If you
 use a laptop or other desktop, your computer probably isn't on then.
 So the locate and whatis databases never get updated unless you run it
 by hand.
 
 So somebody should figure out a way to handle this for desktop machines.

a combination of calling {daily,weekly,monthly} from @reboot crontab
entries, and those scripts recording their last run date in
timestamp files somewhere.

when they get called at a reboot or at the normally scheduled time,
if they haven't run in x days, then do stuff.  similarly if you
leave your laptop off for a week, boot it up at midnight and it runs
daily and weekly right away, it shouldn't run them again at 1:30 and
3:30.



Re: make OpenBSD beep at start

2010-01-23 Thread joshua stein
 Can someone give a hin on how to make the speaker to beep for example with
 a command or a C program ?

echo 

(that's control+v, then control+g)



Re: howto debug systemfan stuck running fullspeed (acpi)

2009-12-30 Thread joshua stein
 i experience on my Thinkpad X200, that sometimes the fan gets stuck at
 fullspeed. (This time it is after 19h of uptime.)
 The notebook is idle, temperatures are fine, but the fan just goes to
 fullspeed and stays there.
 Normaly the regulation works fine in tandem with apmd -C.
 Rebooting will reset the fan to normal behaviour.

nothing controls fan speeds in the kernel.  the thinkpad embedded
controller defaults to auto mode, which is supposed to regulate
fan speeds itself and speed up or slow down depending on cpu and hdd
temperatures.  you can usually hear it speed up while doing
cpu-intensive tasks, but unfortunately it will never slow down
enough that you can't hear it.

you can try checking if there are any EC/BIOS updates for your
laptop on lenovo's website.

otherwise, you can force the fan down in the kernel.  just last
night i wrote this to quiet down my idle thinkpad x301 by turning
the fan down when the temperatures are low:
http://jcs.org/patches/openbsd-acpithinkpad_fan_control.diff

but use it at your own risk and don't expect it to be committed.  it
could probably use some sysctl knobs to define the max temperatures,
but the hard-coded ones are working ok for me right now.



Re: midwest US mirror

2009-11-18 Thread joshua stein
 I should mention things that I didn't before and reiterate others . . .
 
 1) I am committed to maintaining this service
 2) At the moment, I have a ~300G hard drive devoted to it (and willing
 to devotre more, in the future)
 3) I have a DSL (high-speed) connection

i'm not sure what kind of outbound speeds your dsl connection is
capable of, but the old second level mirror rt.fm saw spikes of up
to 80mbps and a constant 20mbps outbound for many days around each
release time.



Re: Passenger?

2009-08-11 Thread joshua stein
 Can seem to find anything in the archives, .. I just finished setting up a
 Rails app under Passenger on a Linux box - pretty nice! We have a Rails
 app running with Mongrel on 4.5, but I would really like to use an Apache
 SSL session; never could get that working with mod_rewrite, however, when
 we were trying last yeat.
 
 Are other folks using Passenger w/apache2, or is there another option for
 Apache 1.3?

it doesn't work with apache:

http://code.google.com/p/phusion-passenger/issues/detail?id=88

supposedly it works with nginx, though.



Re: acpithinkpad problems on thinkpad w500

2009-03-08 Thread joshua stein
 I came across a strange problem today. I (accidentally) opened the cd/dvd 
 player of my thinkpad w500 laptop. Once the player is opened, it is 
 impossible to close it, as it is immediately reopened.
 
 Dmesg is flawed with the following messages:
 acpithinkpad0: unknown type 3 event 0x006
 
 Any ideas on how I can solve the problem?

does the event log at the opening or closing of the drive?

if you disable the acpithinkpad device (boot -c) does the drive work
properly?



Re: Getting the Thinkpad X200 working fully under OpenBSD

2008-09-22 Thread joshua stein
 WARNING: 16384 bytes not available for msgbuf in last cluster (4096
 used)
 [ using 682848 bytes of bsd ELF symbol table ]

for now you can put 'option MSGBUFSIZE=4096' in your kernel config
just to stop it from misbehaving.

 The P8600 Core2Duo is not regognized by the speedstep code.
 
 Adding the model 0x7 to est.c results in:
 cpu0: unknown Enhanced SpeedStep CPU, msr 0x0617091f0691f
 cpu0: using only highest and lowest powerstates
 cpu0: Enhanced SpeedStep 2400 MHz (1196mV): speeds: 2400, 2600 MHz
 
 Now i just have to find out how to populate fqlist with the right data.

try this, it works on my x200 and gives me 2400, 2133, 1867, and
1600 mhz.


Index: est.c
===
RCS file: /cvs/src/sys/arch/amd64/amd64/est.c,v
retrieving revision 1.7
diff -u -r1.7 est.c
--- est.c   6 Aug 2008 05:24:44 -   1.7
+++ est.c   22 Sep 2008 17:42:33 -
@@ -55,6 +55,7 @@
 
 #include sys/param.h
 #include sys/systm.h
+#include sys/malloc.h
 #include sys/sysctl.h
 
 #include machine/cpu.h
@@ -77,10 +78,11 @@
 #define BUS266 26667
 #define BUS333 3
 
-#define MSR2MHZ(msr, bus) \
-   (int) (msr)  8)  0xff) * (bus) + 50) / 100)
-#define MSR2MV(msr) \
-   (((int) (msr)  0xff) * 16 + 700)
+#define MSR2FREQINC(msr)   (((int) (msr)  8)  0xff)
+#define MSR2VOLTINC(msr)   ((int) (msr)  0xff)
+
+#define MSR2MHZ(msr, bus)  ((MSR2FREQINC((msr)) * (bus) + 50) / 100)
+#define MSR2MV(msr)(MSR2VOLTINC(msr) * 16 + 700)
 
 struct fqlist {
int vendor: 5;
@@ -91,7 +93,7 @@
 
 static const struct fqlist *est_fqlist;
 
-static u_int16_t fake_table[3];
+static u_int16_t *fake_table;
 static struct fqlist fake_fqlist;
 
 extern int setperf_prio;
@@ -158,6 +160,7 @@
model = (ci-ci_signature  4)  15;
switch (model) {
case 0xe: /* Core Duo/Solo */
+   case 0x7: /* Core 2 Duo */
case 0xf: /* Core Xeon */
msr = rdmsr(MSR_FSB_FREQ);
bus = (msr  0)  0x7;
@@ -244,29 +247,74 @@
return;
}
if (est_fqlist == NULL) {
-   printf(%s: unknown Enhanced SpeedStep CPU, msr 0x%016llx\n,
-   cpu_device, msr);
+   int j, tablesize, freq, volt;
+   int minfreq, minvolt, maxfreq, maxvolt, freqinc, voltinc;
 
-   /*
-* Generate a fake table with the power states we know.
-*/
-   fake_table[0] = idhi;
-   if (cur == idhi || cur == idlo) {
-   printf(%s: using only highest and lowest power 
-   states\n, cpu_device);
-
-   fake_table[1] = idlo;
-   fake_fqlist.n = 2;
-   } else {
-   printf(%s: using only highest, current and lowest 
-   power states\n, cpu_device);
-
-   fake_table[1] = cur;
-   fake_table[2] = idlo;
-   fake_fqlist.n = 3;
+#ifdef EST_DEBUG
+   printf(%s: bus_clock = %d\n, __func__, bus_clock);
+   printf(%s: idlo = 0x%x\n, __func__, idlo);
+   printf(%s: lo  %4d mV, %4d MHz\n, __func__,
+   MSR2MV(idlo), MSR2MHZ(idlo, bus_clock));
+   printf(%s: raw %4d   , %4d\n, __func__,
+   (idlo  0xff), ((idlo  8)  0xff));
+   printf(%s: idhi = 0x%x\n, __func__, idhi);
+   printf(%s: hi  %4d mV, %4d MHz\n, __func__,
+   MSR2MV(idhi), MSR2MHZ(idhi, bus_clock));
+   printf(%s: raw %4d   , %4d\n, __func__,
+   (idhi  0xff), ((idhi  8)  0xff));
+   printf(%s: cur  = 0x%x\n, __func__, cur);
+#endif
+
+/*
+ * Generate a fake table with the power states we know,
+* interpolating the voltages and frequencies between the
+* high and low values.  The (milli)voltages are always
+* rounded up when computing the table.
+*/
+   minfreq = MSR2FREQINC(idlo);
+   maxfreq = MSR2FREQINC(idhi);
+   minvolt = MSR2VOLTINC(idlo);
+   maxvolt = MSR2VOLTINC(idhi);
+   freqinc = maxfreq - minfreq;
+   voltinc = maxvolt - minvolt;
+
+   /* Avoid diving by zero. */
+   if (freqinc == 0 || voltinc == 0)
+   return;
+
+   if (freqinc  voltinc || voltinc == 0) {
+   tablesize = maxfreq - minfreq + 1;
+   if (voltinc != 0)
+   voltinc = voltinc * 100 / freqinc - 1;
+   freqinc = 100;
+   } else {
+   tablesize = maxvolt - minvolt + 1;
+   freqinc = freqinc * 100 / voltinc - 1;
+   voltinc = 100;
}
- 

Re: suspend command - curious of function

2008-09-19 Thread joshua stein
 What does the suspend command do?  I cannot find a man page on it, or
 entry in the FAQ, or anything useful in the mailing list archives or
 google (seems most deal with laptop suspend/restore).. When I type
 suspend at the cmd line, it drops me past the command line.

it's a command built in to the shell.  from the csh manpage:

   suspend
   Causes the shell to stop in its tracks, much as if it had
   been sent a stop signal with ^Z.  This is most often used
   to stop shells started by su(1).

[EMAIL PROTECTED]:~ su
Password:
# suspend

[1]  + 26084 Suspended (signal)su
[EMAIL PROTECTED]:~ jobs
[1]  + Suspended (signal)su
[EMAIL PROTECTED]:~ fg
su
# 



Re: X60 Tablet Wacom, Atheros 5213 others

2008-04-15 Thread joshua stein
 - Pen doesn't work at all. Windows say it's connected to the LPC chip 
 mentioned above. Does this mean that I have to write a driver for it 
 (and modify wscons framework to support touch strength, and then modify 
 Xorg wscons driver, BTW removing usbtablet(4))? Looks like nice effort 
 for me, but'll take a lot of time...

if it's like my x61 tablet, it's a serial wacom tablet and it's just
on a non-standard irq and address so you have to tell the kernel
where to probe for pccom0.

'config -e' your kernel, 'change pccom0', set the irq to 5 and port
to 0x200.

and it should attach pccom0.  you'll need the linux wacom driver
for xorg compiled without usb stuff:

http://linuxwacom.sourceforge.net/

 - Buttons near display (are actual in the tablet mode) do not work 
 either. Windows says they're connected in parallel to pen device.

they were working fine for me on my x61.  they generate keycodes you
can see by running xev.  i made them send normal keys with xmodmap:

! little button that can only be pressed with the tip of the pen
!keycode 198 =
! screen rotation key
!keycode 204 =
! whatever that button is to the right of rotate
!keycode 199 =

keycode 203 = Escape

! d-pad arrows and center
keycode 209 = Up
keycode 206 = Left
keycode 205 = Right
keycode 207 = Down
keycode 200 = Return

i eventually setup something to respond to keycode 204 and call a
script that ran 'xrandr' to rotate the display.

 - FireWire and finger scanner are not supported and do not work either. 
 BTW, does anyone have any docs for the last one (see dmesg for more 
 info)?

finger scanner is working, it's your ugen0 device.  fprint works
just fine with it:

http://reactivated.net/fprint/wiki/Main_Page

i have more info on the x61 tablet at http://lowerca.se/laptops/



Re: tpb and tphdisk assistance

2007-05-28 Thread joshua stein
 I have tpb set to run as a daemon from ~/.xinitrc. The volume mute/down/up
 buttons work, but none of the Fn buttons do except for the thinklight.
 On-screen display also does not work. Is this something I can fix with a
 simple configuration change?

tpb does not work correctly with multiprocessor kernels, i think it
has something to do with the nvram driver.

but that doesn't have anything to do with tphdisk; tphdisk and the
msdos partition are just for hibernation.  does that not work
either?



testing needed for keyboard change before 4.1

2007-01-10 Thread joshua stein
this diff changes the way ps/2 and AT keyboards are handled in
attempt to gain support for some quirky ones.  this includes most
laptops that have internally connected ps/2 keyboards.

if you want your keyboard to continue working for the 4.1 release,
please test this change now and report back to me privately,
off-list, whether your keyboard continues to work or not.  include
relevant details like what kind of keyboard it is and a dmesg.


Index: dev/pckbc/pckbd.c
===
RCS file: /cvs/src/sys/dev/pckbc/pckbd.c,v
retrieving revision 1.8
diff -u -r1.8 pckbd.c
--- dev/pckbc/pckbd.c   29 Dec 2005 12:31:29 -  1.8
+++ dev/pckbc/pckbd.c   10 Jan 2007 15:58:01 -
@@ -192,54 +192,75 @@
pckbc_tag_t kbctag;
pckbc_slot_t kbcslot;
 {
-   u_char cmd[2];
-   int res;
+   /* default to have the 8042 translate the keyboard with table 3 */
+   int x = 3;
 
-   /*
-* Some keyboard/8042 combinations do not seem to work if the keyboard
-* is set to table 1; in fact, it would appear that some keyboards just
-* ignore the command altogether.  So by default, we use the AT scan
-* codes and have the 8042 translate them.  Unfortunately, this is
-* known to not work on some PS/2 machines.  We try desperately to deal
-* with this by checking the (lack of a) translate bit in the 8042 and
-* attempting to set the keyboard to XT mode.  If this all fails, well,
-* tough luck.
-*
-* XXX It would perhaps be a better choice to just use AT scan codes
-* and not bother with this.
-*/
-   if (pckbc_xt_translation(kbctag, kbcslot, 1)) {
-   /* The 8042 is translating for us; use AT codes. */
+   if (!pckbc_xt_translation(kbctag, kbcslot, 1)) {
+#ifdef DEBUG
+   printf(pckbd: enabling of translation failed\n);
+#endif
+   /* just set the basic XT table and hope it works */
+   x = 1;
+   }
+
+   /* keep falling back until we hit a table that looks usable */
+   for (; x = 1; x--) {
+   u_char cmd[2];
+#ifdef DEBUG
+   printf(pckbd: trying table %d\n, x);
+#endif
cmd[0] = KBC_SETTABLE;
-   cmd[1] = 2;
-   res = pckbc_poll_cmd(kbctag, kbcslot, cmd, 2, 0, 0, 0);
-   if (res) {
+   cmd[1] = x;
+   if (pckbc_poll_cmd(kbctag, kbcslot, cmd, 2, 0, 0, 0)) {
u_char cmd[1];
 #ifdef DEBUG
-   printf(pckbd: error setting scanset 2\n);
+   printf(pckbd: table set of %d failed);
 #endif
-   /*
-* XXX at least one keyboard is reported to lock up
-* if a set table is attempted, thus the reset.
-* XXX ignore errors, scanset 2 should be
-* default anyway.
-*/
cmd[0] = KBC_RESET;
(void)pckbc_poll_cmd(kbctag, kbcslot, cmd, 1, 1, 0, 1);
pckbc_flush(kbctag, kbcslot);
-   res = 0;
+
+   continue;
}
-   } else {
-   /* Stupid 8042; set keyboard to XT codes. */
-   cmd[0] = KBC_SETTABLE;
-   cmd[1] = 1;
-   res = pckbc_poll_cmd(kbctag, kbcslot, cmd, 2, 0, 0, 0);
+
+   /* the 8042 took the table set request */
+
+   if (x == 3) {
+   /* however, not all that say they can go into table 3
+* actually work, so ask what table it's in now */
+
+   u_char cmd[1], resp[0];
+
+   cmd[0] = KBC_SETTABLE;
+   cmd[1] = 0;
+   if (pckbc_poll_cmd(kbctag, kbcslot, cmd, 2, 1, resp, 
0)) {
+#ifdef DEBUG
+   printf(pckbd: table 3 verification failed\n);
+#endif
+   /* query failed, let's just step down to table
+* 2 to be safe */
+
+   continue;
+   } else if (resp[0] == 3) {
+#ifdef DEBUG
+   printf(pckbd: settling on set 3\n);
+#endif
+   return (0);
+   }
+#ifdef DEBUG
+   else
+   printf(pckbd: set %x != 3, trying 2\n,
+   resp[0]);
+#endif
+   } else {
 #ifdef DEBUG
-   if (res)
-   printf(pckbd: error setting scanset 1\n);
+   printf(pckbd: settling on set %d\n, x);
 #endif
+   return (0);
+   }
}
-   return (res);
+
+   return (1);
 }
 
 static int



Re: Xen?

2006-09-28 Thread joshua stein
  I listened to Christoph Egger's podcast on openbsd + xen. Yowza. Is this a
  4.1 timeframe item?
 
 People who do this need to be spanked!!! 8-)  Come on, at least give us a
 URL...

http://undeadly.org/cgi?action=articlesid=20060927173418

-- 
joshua stein :: superblock :: http://superblock.net/



Re: mssql.so

2006-01-16 Thread joshua stein
 Am I doing something wrong?!

yes, you are not following the advice already given to you.

http://marc.theaimsgroup.com/?l=openbsd-miscm=113729912930316w=2



Re: mssql.so

2006-01-14 Thread joshua stein
 I've read the freetds.org help but I can't figure out what to do!!!
 Someone can help me?!

the php5-sybase_ct-5.0.4.tgz package will give you sybase_ct.so,
which enables the same mssql_* functions as mssql.so.



Re: Can't make 3.7-stable release (tries to exceed capacity of /dev/svnd0a?)

2005-07-11 Thread joshua stein
 Ummm - maybe I don't understand but, how can you make a RELEASE from 
 STABLE? Isnt STABLE following the patch branch? And RELEASE is jsut that 
 - what's on the CD?
 
 If i'm correct - then you can't do that. If I'm correct, think of it this 
 way:
 
 RELEASE = what you buy.
 STABLE  = is what you follow for security patches
 CURRENT = is what you run as a developer. It's kinda like a Beta of the 
 next RELEASE.

3.7-release is what is on the cd.  it is the result of building a
release(8) from the source when 3.6 became 3.7-beta, solidified and
changed to just 3.7.

3.7-stable is a branch of 3.7 made at the same time as 3.7-release
was tagged.  one can make a release(8) of the source in the branch
at any date.  the output would be similar base37.tgz, comp37.tgz,
etc. sets to that of the 3.7-release, but with the minor -stable
fixes in it.  this is what the original poster is attempting.

3.7-current is the main development line of 3.7.  one can make a
release(8) of the source in the main development line at any date
(assuming nothing is broken) and produce disk sets with new stuff
from recent developments.  this is what is done periodically to
produce the snapshots that are available on the ftp mirrors.

eventually 3.7-current turns into 3.8-beta, solidified, and then
becomes 3.8.  the tree is tagged as 3.8-release and branched as
3.8-stable and a release(8) is made with base38.tgz, comp38.tgz.,
etc. sets.  these sets are put on a cd and distributed to the ftp
mirrors.

rinse, repeat every ~6 months.