Re: Kind OFF Topic. FreeBSD for Blocking URLS? Nanny?

2012-04-10 Thread Joshua Isom

On 4/9/2012 10:27 PM, Jorge Biquez wrote:


As always there are some experts that controls everything
and do not let you change anything because is their kingdom.


What do they control?  The network infrastructure?


One of the managers asked me for help to block some web sites were some
students in the other lab and people that helps there waste bandwithd
seeing videos, movies (youtube, cuevana, serieid, etc) and spend lot of
time on facebook also.


This is a network issue.  You can try to detect a client using too much 
bandwith for a period of time, and then throttle them.  Dropping tcp 
packets will force throttling.  Blocking websites is more effective at a 
firewall than a desktop.



with a few that are seeing movies and videos the rest of us can not work
at all. Thing is that other manager (you know how those things are
sometimes) do not want us to do that since his guru and expert is the
one that controls all the Network. So the best we could get until now is
that we can do all we can without touching the Cisco routers and until
now not administrative password for change anything on the PCs (that
could change one we prove that we can have the solution and show it to
the board of people that runs the place).


They're asking you to fix a network problem but refuse to give you 
control of the network.  Ask the administrators what happens if all the 
software you've installed is bypassed by someone bringing in a laptop, 
or you switch to WiFi and everyone's on a cell phone you done control. 
Deal with the problem at the network.



The Internet provider gives the DNS servers to use and one of the
routers gives the DHCP service.

First thing I thought was to change the DNS servers and use the one from
my small office (running Freebsd 7.3) using Bind there and simply block
there pointing the sites to nothing in the Apache configuration. It does
not work. Once changed the DNS values the PC does not resolve anything.
It was a quick test but that does not work. Not sure if Internet
provider is blocking in some way that we can not use other DNS server
but theirs.


Google is 8.8.8.8 and 8.8.4.4, easy enough to remember, and circumvent.


Other solution I was thinking while coming home was to convert one
machine there to a freebsd server and use it as a router (if they let
me) so that way I can control from there and do filtering. Issue is that
maybe they do not let me but connect the server as an extra machine
without replacing the main router so in that case I would have 2 DHCP
servers doing the same service in the same lan and could be conflicts I
guess.


That's affecting the network and causing a mess for no good reason.


Another solution a friend suggested was to buy one small router (from my
money for sure) and let that small router to receive the internet (RJ45)
and from that with the small 4 port switch included to provide the
internet to the switches to feed the labs , library and administrative
offices. I have never use one of those and I am short on money so I
would like to explore other alternatives before if possible.


Adding a router won't help for the real problem.


Finally another solution would be to install in each PC a kind of Nanny
software but only if free, otherwise is not a solution (I do not know of
any yet but will do searching the following hours).


And then you have to trust the software.  Some software will ban health 
information, such as breast cancer, but because of so many porn websites 
created so fast they can still allow porn.  In any case, it's just a 
firewall.



I know all can be solved if the guru-expert guy would let me have
passwords from PC's, router, etc but that won't be an option since they
think we would try to take the control of those services (we do not want
that) so the burocracy could be a problem there. He have told them that
to block is not possible (they have been working that way for years).


The block is possible, but it's a network issue, the other guy.  Either 
he does it, or you take over the network.  The more centralized and 
built into the network it is, the more effective it is.



So, in this kind of schema. Do you think FreeBSD (even linux) could be
of help if we do not have access to routers, switches and can not
install new software on the PCs( the ones running XP)?


No.  You lack the network control to control student's computer use.


Any comments you have that could help me to solve this challenge?

Thanks in advance for your time and comments.

Jorge Biquez

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to
freebsd-questions-unsubscr...@freebsd.org


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: FreeBSD's backwards webdesign / corporate identity

2012-04-10 Thread Polytropon
On Tue, 10 Apr 2012 15:29:42 +1000, Da Rock wrote:
 On 04/10/12 21:32, per...@pluto.rain.com wrote:
  Mark Felderf...@feld.me  wrote:
 
  Python on Planes is the future, mn.
  Shouldn't that be spelled plains, as in the places where the
  snake-containing grass grows?
 
 
 
  :-)
 
 Ha! One would think so, but with ruby on rails one would think that 
 python on plains wouldn't sound anywhere near as exciting or appear too 
 quick. That and a shaded reference to a certain similarly titled movie 
 with Samuel L Jackson- corny! :D

Should we modernize programming languages by putting
them on something? Like awk on a anchor, C on a
chimney or Java on Jambalaya? :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: cups slow when printing from firefox

2012-04-10 Thread Leslie Jensen


 Hi all,

 I'm struggling with a speed issue when trying to print stuff from
 firefox (10.0.2,1). I've set up cups (meta package 1.5.2) on my box
 which uses a Lexmark E360dn printer via ethernet. The printer has a
 postscript emulation which is set as the default (as opposed to
 PCL). I've used a PPD file from openprinting.org which claims that the
 printer is 100% supported. Printing works fine in general with all
 sorts of text and images, including PDF and LibreOffice and
 whatnot. However, trying to print maps from maps.google.de sends one
 CPU to 100% for a couple of minutes. Printing the same map from a
 Debian box takes a couple of seconds. I can print the map to a file,
 and print that file with lpr which also takes just a few seconds.

 While printing from firefox directly, I noticed a process gsc owned by
 cups which causes most of the CPU load. I take this as an indication
 that the postscript output from firefox is incorrectly rasterized on
 my box, instead of sending the postscript data directly to the
 printer. I did not make any changes to the default config files except
 for adding the printer through the localhost:631 interface.

 Is there anything else that I need to configure, either on the firefox
 or the cups end, to make printing maps faster?

 regards
 Markus

 --
 Markus Hoenicka
 http://www.mhoenicka.de
 AQ score 38
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 freebsd-questions-unsubscr...@freebsd.org


Hi Markus.

If you do a search in the archives you'll see that some of us have
printing problems with Firefox. Some even suspect that printing in Firefox
is broken.

I myself has not been able to solve my specific printing problems which
include both Firefox but also Libre office.

I'm running Win7 in Virtualbox in order to fix my printing :-(

Regards

/Leslie



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Apache: Socket is not connected: core_output_filter: writing data to the network

2012-04-10 Thread Christer Solskogen
I see this error in the error log of apache. It seems to happen
whenever someone do a GET on certain mp3-files on my server. What does
this error mean?

-- 
chs,
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Apache: Socket is not connected: core_output_filter: writing data to the network

2012-04-10 Thread Matthew Seaman
On 10/04/2012 08:05, Christer Solskogen wrote:
 I see this error in the error log of apache. It seems to happen
 whenever someone do a GET on certain mp3-files on my server. What does
 this error mean?

It can be due to various different reasons.  At a guess, probably this:

https://issues.apache.org/bugzilla/show_bug.cgi?id=10712

In which case, it's probably your users getting frustrated with slow
downloads and cancelling requests -- improving performance and getting
more downstream bandwidth would help.

Beyond that, it can be due to apache running out of file descriptors --
you'ld see error messages mentioning file descriptors elsewhere in the
apache logs in that case, and it would only appear if your apache setup
had hundreds of virtual hosts each with their own log files.

Other things to look at: use of EnableSendFile or EnableMMAP in your
configuration.  IIRC this is generally fine and enabled by default on
FreeBSD, *except* when you mount your document root by NFS.  See the
discussion in the Apache docs for more details.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey




signature.asc
Description: OpenPGP digital signature


Re: Apache: Socket is not connected: core_output_filter: writing data to the network

2012-04-10 Thread Christer Solskogen
On Tue, Apr 10, 2012 at 9:33 AM, Matthew Seaman matt...@freebsd.org wrote:
a good explaination

Thanks!

-- 
chs
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Using kqueue with 2 threads

2012-04-10 Thread Ben Short
Hi,

I'm trying to use a kqueue to listen for VNODE events on a worker thread. I
want new events  to be registered with the kqueue by a separate thread.

I have been referring to this example [URL=
http://doc.geoffgarside.co.uk/kqueue/file.html;]
http://doc.geoffgarside.co.uk/kqueue/file.html[/URL]

Here are the relevant parts of code as it is at the moment.

In my worker thread:

[CODE]std::cerr  Started worker  std::endl;

struct kevent ke;
int i;

while ( !mStopRequested ) {

memset(ke, 0x00, sizeof(kevent));

i = kevent(kq, NULL, 0, ke, 1, NULL);
if ( i == -1 ) {
std::cerr  kqueue produced error:   strerror(i) 
std::endl;
continue; // todo is this the best thing todo?
}

std::cerr  Beep:   i  std::endl;

}

std::cerr  Shutting down worker  std::endl;[/CODE]

Other thread

[CODE]int fd = open(fileName.c_str(), O_RDONLY);
if ( fd == -1 ) {
std::cerr  Failed to open file:   fileName   Error:  
strerror(errno)  std::endl;
// todo throw exception
}

struct kevent ke;

EV_SET(ke, fd, EVFILT_VNODE, EV_ADD, NOTE_DELETE | NOTE_RENAME |
NOTE_EXTEND, 0, NULL);

if (kevent(kq, ke, 1, NULL, 0, NULL) == -1) {
std::cerr  kevent produced error:   strerror(errno) 
std::endl;
}[/CODE]


When I run my code the kevent call in the worker code doesn't block at all.
Any ideas what I'm missing? or if what I want to do is even possible?

Ben
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: problem with Xorg

2012-04-10 Thread Da Rock

On 04/11/12 00:30, Bernt Hansson wrote:

2012-04-09 13:57, Da Rock skrev:

On 04/09/12 21:38, Bernt Hansson wrote:

2012-04-09 13:03, Da Rock skrev:

On 04/09/12 20:38, Bernt Hansson wrote:

Hello list.

When I try to start X I'm getting this error


Yep. This one will be fun... :)


No. Not really.


Never is, let me tell you.



X.Org X Server 1.7.7
Release Date: 2010-05-04
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 8.2-RELEASE i386
Current Operating System: FreeBSD kw.fqdn 8.2-RELEASE FreeBSD
8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011
r...@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
Build Date: 09 April 2012  02:21:53AM

Current version of pixman: 0.24.2
  Before reporting problems, check http://wiki.x.org
  to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
  (++) from command line, (!!) notice, (II) informational,
  (WW) warning, (EE) error, (NI) not implemented, (??) 
unknown.

(==) Log file: /var/log/Xorg.0.log, Time: Mon Apr  9 12:30:37 2012
(==) Using default built-in configuration (30 lines)
(EE) LoadModule: Module fbdevhw does not have a fbdevhwModuleData 
data

object.
(EE) Failed to load module fbdevhw (invalid module, 0)
Setting master
The XKEYBOARD keymap compiler (xkbcomp) reports:

Warning:  Type ONE_LEVEL has 1 levels, butRALT   has 2

symbols

Ignoring extra symbols

Errors from xkbcomp are not fatal to the X server
xinit: connection to X server lost

waiting for X server to shut down Dropping master


First some questions:

1. Does the machine lock up when you run X?


No It doesn't but no picture.


2. Do you know what video card you're using?


Intel 845


3. What is the output of pciconf -lv, dmesg?


pciconf -lv
hostb0@pci0:0:0:0:  class=0x06 card=0x chip=0x25608086
rev=0x01 hdr=0x00
 vendor = 'Intel Corporation'
 device = 'DRAM Controller / Host-Hub I/F Bridge
(82845G/GL/GV/GE/PE)'
 class  = bridge
 subclass   = HOST-PCI
vgapci0@pci0:0:2:0: class=0x03 card=0x00b90e11 chip=0x25628086
rev=0x01 hdr=0x00
 vendor = 'Intel Corporation'
 device = '82845G/GL/GV/GE/PE Integrated Graphics Device'
 class  = display
 subclass   = VGA
uhci0@pci0:0:29:0:  class=0x0c0300 card=0x00b90e11 chip=0x24c28086
rev=0x01 hdr=0x00
 vendor = 'Intel Corporation'
 device = '82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI
Controller *1'
 class  = serial bus
 subclass   = USB
uhci1@pci0:0:29:1:  class=0x0c0300 card=0x00b90e11 chip=0x24c48086
rev=0x01 hdr=0x00
 vendor = 'Intel Corporation'
 device = '82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI
Controller *2'
 class  = serial bus
 subclass   = USB
ehci0@pci0:0:29:7:  class=0x0c0320 card=0x00b90e11 chip=0x24cd8086
rev=0x01 hdr=0x00
 vendor = 'Intel Corporation'
 device = '82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB 2.0 EHCI
Controller'
 class  = serial bus
 subclass   = USB
pcib1@pci0:0:30:0:  class=0x060400 card=0x chip=0x244e8086
rev=0x81 hdr=0x01
 vendor = 'Intel Corporation'
 device = '82801 Family (ICH2/3/4/5/6/7/8/9,63xxESB) Hub
Interface to PCI Bridge'
 class  = bridge
 subclass   = PCI-PCI
isab0@pci0:0:31:0:  class=0x060100 card=0x chip=0x24c08086
rev=0x01 hdr=0x00
 vendor = 'Intel Corporation'
 device = '82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge'
 class  = bridge
 subclass   = PCI-ISA
atapci0@pci0:0:31:1:class=0x01018a card=0x00b90e11 chip=0x24cb8086
rev=0x01 hdr=0x00
 vendor = 'Intel Corporation'
 device = '82801DB/DBL (ICH4/ICH4-L) UltraATA/100 EIDE 
Controller'

 class  = mass storage
 subclass   = ATA
pcm0@pci0:0:31:5:   class=0x040100 card=0x00ad0e11 chip=0x24c58086
rev=0x01 hdr=0x00
 vendor = 'Intel Corporation'
 device = 'Realtek AC97 Audio (82801DBM SoundMAXController
(ICH4-M B0 step))'
 class  = multimedia
 subclass   = audio
fxp0@pci0:5:8:0:class=0x02 card=0x00120e11 chip=0x103b8086
rev=0x81 hdr=0x00
 vendor = 'Intel Corporation'
 device = '82801DB/DBL (ICH4/ICH4-L) PRO/100 VM Network
Connection'
 class  = network
 subclass   = ethernet


4. What does Xorg -configure produce?


No idea, haven't tried it. Using HAL.





Given your previous answers, I'd say you _have_ to run it. Then the last
option I offered _will_ work. You need to force it to use vesa and that
is the only way.


It gives a black screen. Vesa or not.


Is that with the retro option?



As a last chance perhaps run X -conf /root/xorg.conf.new -retro and see
if it does happen to work; this shows up the old test pattern so that
you can see that X is actually running instead of a black screen.



Finally, can you change the driver setting in the xorg.conf.new to 

pcmcia wifi adapter that can be purchased?

2012-04-10 Thread Kendall Shaw
Hi,

This is my first post in a decade or so. Hopefully, it is the start of a
serious of decreasingly stupid questions...

I've looked through the hardware notes for freebsd 9.0 which I have
installed in my fujitsu lifebook p1110, and comparing the list of
supported wireless adapters with what I can find for sale on the
internet, I am still having trouble finding an adapter that I can
actually buy that works.

Do you happen to know of a PCMCIA Type II wireless adapter that is
currently being sold online that supports WPA under freebsd 9.0?
Alternately, a USB 1.0 adapter? I would rather keep the USB ports free
for other uses.

Kendall
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Kind OFF Topic. FreeBSD for Blocking URLS? Nanny?

2012-04-10 Thread Robert Bonomi

Jorge Biquez jbiq...@intranet.com.mx wrote:

 Hello all.

 One of the managers asked me for help to block some web sites were 
 some students in the other lab and people that helps there waste 
 bandwithd seeing videos, movies (youtube, cuevana, serieid, etc) and 
 spend lot of time on facebook also. Our bandwidth is only 4Mb and you 
 understand that with a few that are seeing movies and videos the rest 
 of us can not work at all. Thing is that other manager (you know 
 how those things are sometimes) do not want us to do that since his 
 guru and expert is the one that controls all the Network. So the 
 best we could get until now is that we can do all we can without 
 touching the Cisco routers and until now not administrative password 
 for change anything on the PCs (that could change one we prove that 
 we can have the solution and show it to the board of people that runs 
 the place).

[.. sneck ]]

 So, in this kind of schema. Do you think FreeBSD (even linux) could 
 be of help if we do not have access to routers, switches and can not 
 install new software on the PCs( the ones running XP)?

 Any comments you have that could help me to solve this challenge?

This is doable -if- you can insert a, say FreeBSD, box in the network
-between- the labs and the outside world, where all the traffic can
be forced to go -through- that box.  it would basically function as a i
two-port router.   This would probably require 'minor' configuration
changes on the boxes on each side of the box you are adding (tweaking
the 'routing' stuff, because there will be a new device/IP-address
involved).

IF you can get a box in that position, then 'ipfw', or 'pf', the 'firewall'
utilities, will allow you to block traffic to/from selected netblocks.

It will be somewhat 'maintainence' intensive, keeping the address-block
list up to date -- as users find 'new and different' sources for the
'banned' content.

somewhat *more* effective would be a tool that monitors 'who' each
PC in the lab is connected to, -and- an indication of traffic levels
or that PC.   this can be accomplished by a box sitting somwehre that
it can 'see' all the LAN traffic -- does -not- have to be inserted
in-line like the 'filtering' box does.   Something like 'tcpdump' to
capture LAN traffic, piped into a (probably custom) analyzer that tracks
source/dest IP addresses, packet 'data' size, and relevant data 'flags'
(syn/fin mostly) can tell the lab supervisor  which use they need to
'speak firmly' to.  This -is- a 'people' problem, not a technology 
issue -- therefore, make the solution a *people*-based one.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: FreeBSD's backwards webdesign / corporate identity

2012-04-10 Thread Robert Bonomi
 From owner-freebsd-questi...@freebsd.org  Mon Apr  9 23:40:07 2012
 Date: Tue, 10 Apr 2012 04:32:09 -0700
 From: per...@pluto.rain.com
 To: f...@feld.me
 Cc: freebsd-questions@freebsd.org
 Subject: Re: FreeBSD's backwards webdesign / corporate identity

 Mark Felder f...@feld.me wrote:

  Python on Planes is the future, mn.

 Shouldn't that be spelled plains, as in the places where the
 snake-containing grass grows?

Nay.  As written, it describes a problem in wood-shop tool-storage.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Missing kernel configuration file(s)

2012-04-10 Thread Коньков Евгений
I have upgrade src to Revision: 234068

# cd /usr/src
# make -j 8 buildkernel KERNCONF=KES_KERN_v10
ERROR: Missing kernel configuration file(s) (KES_KERN_v10).
*** Error code 1
1 error
*** Error code 2
1 error
# cd /usr/src/sys/amd64/conf
# ls
.cvsignore  GENERIC.hints   Makefile
DEFAULTSKESOPTS LINTNOTES
GENERIC KES_KERN_v10LINT-VIMAGE XENHVM

I always do this steps, but now I get errors.
I can not find what was changed.
How I must compile my kernel now?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Missing kernel configuration file(s)

2012-04-10 Thread Коньков Евгений

КЕ I have upgrade src to Revision: 234068

КЕ # cd /usr/src
КЕ # make -j 8 buildkernel KERNCONF=KES_KERN_v10
КЕ ERROR: Missing kernel configuration file(s) (KES_KERN_v10).
КЕ *** Error code 1
КЕ 1 error
КЕ *** Error code 2
КЕ 1 error
КЕ # cd /usr/src/sys/amd64/conf
КЕ # ls
КЕ .cvsignore  GENERIC.hints   Makefile
КЕ DEFAULTSKESOPTS LINTNOTES
КЕ GENERIC KES_KERN_v10LINT-VIMAGE XENHVM

КЕ I always do this steps, but now I get errors.
КЕ I can not find what was changed.
КЕ How I must compile my kernel now?

Foget, that I install freebsd from CD with i386
so I need
make -j 8 buildkernel KERNCONF=KES_KERN_v10 TARGET=amd64

Thank you


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: zpool creation on geli failed with FreeBSD-9.0

2012-04-10 Thread Christopher J. Ruwe
On Tue, 10 Apr 2012 08:13:36 +1000
Da Rock freebsd-questi...@herveybayaustralia.com.au wrote:

 On 04/10/12 02:07, Christopher J. Ruwe wrote:
  I was trying to install FreeBSD 9.0 using a geli encrypted disk and
  ZFS on my ThinkPad R500 this weekend. I failed.
 
  Having sucessfully initialized the geli part and having attached the
  provider, my attempt to create a zpool on the geli section thus
 
  $  zpool create ntank /dev/ada0p2.eli
 
  failed with the message
 
  Cannot create 'ntank': invalid argument for this pool operation.
 
  I could not convince the system to create the zpool on the geli
  part, so I gave up and created the zpool on the unencrypted
  partition instead to have a working machine for the week. I would,
  however, like to have my data on an encrypted partition though. Has
  anyone witnessed and resolved this issue or does anyone have other
  ideas?
 
 Someone using ZFS will be able to verify this, but from my
 understanding ZFS runs on the hardware and you can *possibly* put
 geli on top of ZFS.
 
 You can put geom on ZFS but not the other way around.
 
 HTH
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 freebsd-questions-unsubscr...@freebsd.org


I had a zpool on a geli on FreeBSD-8.0 to 8.2 and
8-stable. I opted for a complete reinstall of 9.0 instead of upgrading
due to issues with xmonad, which I did not understand then. I am
furious at my decision now that I have seen that a update would
possibly have been much easier than to reinstall, had I at that time
understood what was causing problems with xmonad.

Cheers, Christopher
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Using kqueue with 2 threads

2012-04-10 Thread Ben Short
I have put together the following example and can still see the problem.
Once the file is written to extended is printed every second. If I remove
the sleep then it prints a whole lot more. So it seems that the call to
kevent in the worker_thread method blocks until the file is written to then
it returns the same event straight away on every call.

Is this expected? Am I meant to clear the event some how?

#include cstdlib

#include iostream

#include sys/stat.h
#include sys/errno.h
#include iostream
#include fstream
#include cstring
#include stdio.h

#include sys/types.h
#include sys/event.h
#include sys/time.h
#include stdio.h
#include fcntl.h

using namespace std;

struct wrapper {
int kq;
};

static void* worker_thread(void* obj) {

int kq = ((wrapper*)obj)-kq;

std::cerr  Started worker  std::endl;

struct kevent ke;
int i;

while ( 1 ) {

memset(ke, 0x00, sizeof(ke));

i = kevent(kq, NULL, 0, ke, 1, NULL);
if ( i == -1 ) {
std::cerr  kqueue produced error:   strerror(i) 
std::endl;
continue; // todo is this the best thing todo?
} else if ( i == 0 ) {
std::cerr  kqueue time limit expired  std::endl;
continue;
}

if ( ke.filter == EVFILT_VNODE ) {

if ( ke.fflags  NOTE_DELETE ) {
std::cerr  delete  std::endl;

break;
} else if ( ke.fflags  NOTE_RENAME ) {
std::cerr  rename  std::endl;
} else if ( ke.fflags  NOTE_EXTEND ) {
std::cerr  extended  std::endl;
} else {
std::cerr  some other fflags  std::endl;
}

} else {
std::cerr  some other filter  std::endl;
}


sleep(1);

}

std::cerr  Shutting down worker  std::endl;

return 0;
}

void writeToFile(std::string fileName, std::string key, std::string value) {

std::fstream registryEntry;

registryEntry.exceptions(std::ifstream::failbit |
std::ifstream::badbit);

try {

registryEntry.open(fileName.c_str(), std::ios::out |
std::ios::binary);

size_t keyLength = key.length();

registryEntry.write((char*)keyLength, sizeof(size_t));

registryEntry.write(key.c_str(), key.length());

size_t valueLength = value.length();

registryEntry.write((char*)valueLength, sizeof(size_t));

registryEntry.write(value.c_str(), value.length());

std::cout  Set entry with key:   key  std::endl;

} catch (std::ifstream::failure e) {
// todo throw exception
std::cerr  Failed to set registry entry. Error:   e.what() 
std::endl;
}

registryEntry.close();

}

void test2() {

int kq = kqueue();

if ( kq == -1 ) {
std::cerr  Failed to create kqueue. Error:   strerror(errno)
 std::endl;
return;
}

pthread_t worker;

wrapper wrap;
wrap.kq = kq;


if ( pthread_create(worker, 0, worker_thread, wrap) != 0 ) {
std::cerr  Failed to create listener thread. Error:  
strerror(errno)  std::endl;
}

int fd = open(/tmp/tt, O_RDONLY);
if ( fd == -1 ) {
std::cerr  Failed to open file:   /tmp/tt   Error:  
strerror(errno)  std::endl;
// todo throw exception
}

struct kevent ke;

EV_SET(ke, fd, EVFILT_VNODE, EV_ADD, NOTE_DELETE | NOTE_RENAME |
NOTE_EXTEND, 0, NULL);

if (kevent(kq, ke, 1, NULL, 0, NULL) == -1) {
std::cerr  kevent produced error:   strerror(errno) 
std::endl;
}

sleep(1);

writeToFile(/tmp/tt, key1, value1);

sleep(5);

}

/*
 *
 */
int main(int argc, char** argv) {

test2();


return 0;
}

On 10 April 2012 15:25, Ben Short b...@benshort.co.uk wrote:

 Hi,

 I'm trying to use a kqueue to listen for VNODE events on a worker thread.
 I want new events  to be registered with the kqueue by a separate thread.

 I have been referring to this example [URL=
 http://doc.geoffgarside.co.uk/kqueue/file.html;]
 http://doc.geoffgarside.co.uk/kqueue/file.html[/URL]

 Here are the relevant parts of code as it is at the moment.

 In my worker thread:

 [CODE]std::cerr  Started worker  std::endl;

 struct kevent ke;
 int i;

 while ( !mStopRequested ) {

 memset(ke, 0x00, sizeof(kevent));

  i = kevent(kq, NULL, 0, ke, 1, NULL);
 if ( i == -1 ) {
 std::cerr  kqueue produced error:   strerror(i) 
 std::endl;
 continue; // todo is this the best thing todo?
 }

 std::cerr  Beep:   i  std::endl;

 }

 std::cerr  Shutting down worker  std::endl;[/CODE]

 Other thread

 [CODE]int fd = open(fileName.c_str(), O_RDONLY);
 if ( fd == -1 ) {
 std::cerr  Failed to open file:   fileName   Error:  
 strerror(errno)  std::endl;
 // todo throw exception
 }

 struct kevent ke;

 EV_SET(ke, fd, EVFILT_VNODE, EV_ADD, NOTE_DELETE | NOTE_RENAME |
 NOTE_EXTEND, 0, NULL);

 if 

Re: cups slow when printing from firefox

2012-04-10 Thread markus . hoenicka
Leslie Jensen writes:
  Hi Markus.
  
  If you do a search in the archives you'll see that some of us have
  printing problems with Firefox. Some even suspect that printing in Firefox
  is broken.
  
  I myself has not been able to solve my specific printing problems which
  include both Firefox but also Libre office.
  
  I'm running Win7 in Virtualbox in order to fix my printing :-(
  

Hi Leslie,

good to know, I thought it's just me being too stupid to press the
right button. For the time being I'll resort to printing to a file and
sending that to lpr, instead of running Win7.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: pcmcia wifi adapter that can be purchased?

2012-04-10 Thread Chris Whitehouse

On 10/04/2012 18:37, Kendall Shaw wrote:


Do you happen to know of a PCMCIA Type II wireless adapter that is
currently being sold online that supports WPA under freebsd 9.0?
Alternately, a USB 1.0 adapter? I would rather keep the USB ports free
for other uses.


Linksys WPC54G works with malo driver (check the man page if you get 
one) and is available on ebay. I haven't had one in regular use but I 
just did a flood ping on 9.0R i386 and it showed less than 1% packet loss.


Chris



Kendall

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Kind OFF Topic. FreeBSD for Blocking URLS? Nanny?

2012-04-10 Thread Mark Felder
On Mon, 09 Apr 2012 23:21:58 -0500, Da Rock  
freebsd-questi...@herveybayaustralia.com.au wrote


For the interim (and as a POC), setup squid and dans guardian and point  
the browsers to proxy using that machine. Prove your point and then  
explain that this can be done transparently if you had some control of  
the routers.




He could just do a MITM on the default gateway via ettercap. Not very  
ethical, but it would certainly work ^_^

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: pcmcia wifi adapter that can be purchased?

2012-04-10 Thread ill...@gmail.com
On 10 April 2012 13:37, Kendall Shaw ks...@kendallshaw.com wrote:
 Hi,

 This is my first post in a decade or so. Hopefully, it is the start of a
 serious of decreasingly stupid questions...

 I've looked through the hardware notes for freebsd 9.0 which I have
 installed in my fujitsu lifebook p1110, and comparing the list of
 supported wireless adapters with what I can find for sale on the
 internet, I am still having trouble finding an adapter that I can
 actually buy that works.

 Do you happen to know of a PCMCIA Type II wireless adapter that is
 currently being sold online that supports WPA under freebsd 9.0?
 Alternately, a USB 1.0 adapter? I would rather keep the USB ports free
 for other uses.


bwi(4)  bwn(4) list a few possibilities,

-- 
--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: pcmcia wifi adapter that can be purchased?

2012-04-10 Thread Kendall Shaw
Chris Whitehouse cwhi...@onetel.com writes:

 On 10/04/2012 18:37, Kendall Shaw wrote:

 Do you happen to know of a PCMCIA Type II wireless adapter that is
 currently being sold online that supports WPA under freebsd 9.0?
 Alternately, a USB 1.0 adapter? I would rather keep the USB ports free
 for other uses.

 Linksys WPC54G works with malo driver (check the man page if you get
 one) and is available on ebay. I haven't had one in regular use but I
 just did a flood ping on 9.0R i386 and it showed less than 1% packet
 loss.

 Chris

Thanks. Oops... I clicked too soon and bought from Amazon. The bwi/bwn
man pages say the version 3 of the adapter is supported. Amazon doesn't
say what version. Is the malo driver for newer versions of the adapter?

Thanks to the other poster for suggesting looking at the bwi/bmn man
pages.

Kendall
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Kind OFF Topic. FreeBSD for Blocking URLS? Nanny?

2012-04-10 Thread Erich Dollansky
Hi,

On Tuesday 10 April 2012 10:27:24 Jorge Biquez wrote:
 
 As I have mentioned before I am helping a school , non profit with 

non profit -- no cost?

 One of the managers asked me for help to block some web sites were 

Have you checked hosts?

A rough but easy way.

Erich
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org