Re: [vox-tech] Bash completion mystery

2012-02-25 Thread Chanoch (Ken) Bloom
On Fri, 2012-02-24 at 07:55 -0800, Wes Hardaker wrote:
> > On Thu, 23 Feb 2012 19:51:27 -0800, Bryan Richter 
> >  said:
> 
> BR> Functions can be discovered with 'declare -f'.
> 
> The problem with todays environment is that there is real-executables,
> aliases and functions.  Aliases are pretty much lame in bash so everyone
> uses functions (which can take arguments, etc).
> 
> But in the end, there are in fact 3 places to look for a definition.  So
> about a month ago I wrote this:
> 
> wh()   {
> prog="$1"
> if [ "`declare -F $prog`" != "" ] ; then
> declare -f $prog
> elif alias $prog > /dev/null 2>&1 ; then
> alias $prog
> else
> which $prog
> fi
> }
> 
> Which if you use in replace of `which` checks all three sources and
> reports the definition or location to you.


Just use bash's `type` builtin instead. It covers everything you must
mentioned, plus it identifies bash builtins.



type: type [-afptP] name [name ...]
Display information about command type.

For each NAME, indicate how it would be interpreted if used as a
command name.

Options:
  -adisplay all locations containing an executable named NAME;
includes aliases, builtins, and functions, if and only if
the `-p' option is not also used
  -fsuppress shell function lookup
  -Pforce a PATH search for each NAME, even if it is an alias,
builtin, or function, and returns the name of the disk file
that would be executed
  -preturns either the name of the disk file that would be
executed,
or nothing if `type -t NAME' would not return `file'.
  -toutput a single word which is one of `alias', `keyword',
`function', `builtin', `file' or `', if NAME is an alias, shell
reserved word, shell function, shell builtin, disk file, or not
found, respectively

Arguments:
  NAME  Command name to be interpreted.

Exit Status:
Returns success if all of the NAMEs are found; fails if any are not
found.

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Directory name changed out from underneath me.

2011-08-01 Thread Chanoch (Ken) Bloom
I was just navigating around on one of the machines in my lab, when I
noticed something wierd: bash is getting the name of one of my
directories wrong when it tries to print it in the prompt.

[bloom@zuni ~]$ cd /
[bloom@zuni /]$ ls
bin/   etc/ lib/ media/proc/ srv/  var/
boot/  home/lib32/   mnt/  root/ sys/  vmlinuz@
data/  home-raid/   lib64@   nonexistent/  sbin/ tmp/
dev/   initrd.img@  lost+found/  opt/  selinux/  usr/
[bloom@zuni /]$ cd data
[bloom@zuni dtaa]$ pwd
/data
[bloom@zuni dtaa]$ echo ~+
/data
[bloom@zuni dtaa]$ mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc 
(rw,noexec,nosuid,nodev)
nas.lingcog.iit.edu:/home2 on /home-raid type nfs 
(rw,nosuid,noatime,addr=216.47.152.22)
nas.lingcog.iit.edu:/data on /data type nfs 
(rw,nosuid,noatime,addr=216.47.152.22)

It's correctly spelled in the pwd command, and bash's ~+ expansion, and
also in the mount command (/data happens to be a mountpoint), so
basically it's correctly spelled everywhere except for the prompt. Any
ideas why?

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Problems with missing 'missing' file

2011-06-24 Thread Chanoch (Ken) Bloom
On Thu, 2011-06-23 at 19:18 -0700, Rick Moen wrote:
> Quoting Shwaine (shwa...@shwaine.com):
> 
> > So wait, this whole argument is because I clarified that all the advice 
> > given by you, and added upon by myself, rests on the assumption that the 
> > OP meant a carriage return instead of literally a "\r" string?
> 
> No.  That is doubly mistaken, both in parsing what I originally said and 
> parsing what I recently said.  You'll have to re-read upthread, though,
> because in fact I was not and am not seeking an argument.

Hasn't Khendon's law kicked in on this thread already?
"If the same point is made twice by the same person, the thread is
over." http://lugod.org/mailinglists/#rules

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] how to modify .htaccess to prevent wget or the likes from downing my site?

2011-05-25 Thread Chanoch (Ken) Bloom
On Wed, 2011-05-25 at 13:51 -0700, Tony Cratz wrote:
> On 05/25/2011 11:50 AM, Hai Yi wrote:
> > I first asked this question to the support of my web host, and they
> > redirected me to this link:
> > http://www.webhostingtalk.com/showthread.php?t=437549
> > 
> > and the snippet on that page looks like:
> > 
> > 
> > SetEnvIfNoCase User-Agent "^Wget" bad_bot
> > 
> > 
> >Order Allow,Deny
> >Allow from all
> >Deny from env=bad_bot
> > 
> 
> 
>   From reading this message and latter ones I have to ask, would
>   it be better to do a deny from all and allow only the browser
>   you want? At times it is easier to do things the reverse way
>   of doing things as it can be must simplier to set up.

While allowing only user agents beginning with "Mozilla" would be an
attractive option, there are two big problems:

First, this wouldn't allow search engines to index his site. He could
allow specific search engines based on their user-agents, but then he'd
risk missing the next new big search engine if its indexing bot had a
brand new user-agent that wasn't on his white list.

He'd probably forget to allow text-based browsers like lynx, Links, and
w3m.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] how to modify .htaccess to prevent wget or the likes from downing my site?

2011-05-25 Thread Chanoch (Ken) Bloom
On Wed, 2011-05-25 at 14:50 -0400, Hai Yi wrote:
> Hello all:
> 
> I first asked this question to the support of my web host, and they
> redirected me to this link:
> http://www.webhostingtalk.com/showthread.php?t=437549
> 
> and the snippet on that page looks like:
> 
> 
> SetEnvIfNoCase User-Agent "^Wget" bad_bot
> 
> 
>Order Allow,Deny
>Allow from all
>Deny from env=bad_bot
> 

This snippet will only block wget, if wget deigns to identify itself as
wget by saying so in the user-agent string.

> 
> I copied and pasted it to the .htaccess under /public_html. Still, I
> am able to use this command to fetch my site:
> 
> wget --wait=20 --limit-rate=20K -r -p -U Mozilla www.my_iste.com

Yup. Wget decided to identify itself as Mozilla in the user-agent
string. That means you have no way at all of knowing that someone's
trying to use Wget to download from your site.

> However, if I  tried the same wget with a slight change in the command
> line (without " -U Mozilla ")
> 
>  wget --wait=20 --limit-rate=20K -r -p www.my_site.com
> 
> I get this:
> 
> --2011-05-25 14:30:36--  http://www.my_site.com/
> Resolving www.my_site.com... xxx.xx.xxx.xx
> Connecting to www.my_site.com|xxx.xx.xxx.xx|:80... connected.
> HTTP request sent, awaiting response... 403 Forbidden
> 2011-05-25 14:30:37 ERROR 403: Forbidden.

Wget deigned to identify itself as wget this time.

> Now I have three questions:

> 1. Why didn't the code in .htaccess prevent the downloading? Did I
> miss something?

(See my explanation above.)

> 2. Do we have other tools acting like wget, how can we prevent them
> all from downing the site content?

There are other tools that act like wget. You can't prevent them *all*
from downloading, though you could blacklist specific ones the way you
did with Wget. Of course, they may also decide to change the User-Agent
string, then you have no way of telling at all.

> 3. If someone is downloading, can we have some log file that can
> expose the downloader's info?

Your web browser logs will have their IP address, but I doubt you could
do anything useful with that information. If your user logs in to the
site, you could try to keep track of that yourself somehow, but that
could be very complex depending what you're trying to prevent.

...


In other words, the protection you're asking for is basically impossible
against a determined downloader.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Bad blocks on my hard drive

2011-05-24 Thread Chanoch (Ken) Bloom
I discovered bad blocks on my laptop hard drive today -- the laptop is
nearly 6 years old. I ran e2fsck -c the drive to mark the bad blocks as
bad, and everything seems to be working now.

How long do I have before I need to replace the hard drive and/or
laptop?

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Extremely slow bootup

2011-05-01 Thread Chanoch (Ken) Bloom
My laptop is running Debian's 2.6.38-2-amd64 kernel, and when booting it
today, I discovered it was extremely slow to boot up (like 5 to 10
minutes). There's no particular obvious culprit -- it just seems each of
the initscripts takes longer. When debugging I tried to debug this, I
noticed that programs are also slow to load. The system is also very
slow to shut down. Again, there's no particular obvious culprit -- it
just seems each of the initscripts takes longer.

Using kernel 2.6.38-1-amd64 is much speedier (within a couple of
minutes). I think kernel 2.6.38-1-amd64 has an older init ramdisk,
becuase I don't see the same udev errors between the two kernels.

Any ideas how to debug this? My thought was that there might be a
problem with DMA, but "hdparm -d /dev/sda" complains that the IOCTL
isn't supported. I also don't see any suggestive differences between the
dmesg dumps between the kernels.

One possibly relevant kernel difference is that 2.6.38-2-amd64 has
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y

It also has
CONFIG_BOOT_PRINTK_DELAY=y

2.6.38-1-amd64 doesn't have any of these.
My desktop computer is using 2.6.38-2-amd64 without problems.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Do Apt GUI's Clean?

2011-03-24 Thread Chanoch (Ken) Bloom
On Thu, 2011-03-24 at 21:33 -0700, Bob Scofield wrote:
> There have been GUI's for apt such as Adept, Synaptic, and now there 
> are "update managers."  I haven't used them very much.  I use aptitude.  
> Aptitude and Apt-Get have the "clean" and "autoclean" commands.

Just to be clear, we're talking about cleaning out the package cache of
packages that you've downloaded but possibly not yet installed.

> While I have not seen autoclean do much for the last couple of years,

Autoclean deletes packages that are no longer available for download
since there's no way that the apt-get package list will ask to install
themn, but keeps around packages that are still in the package list in
case you decide to uninstall and reinstall them for some reason.

> clean 
> really makes room.  After a recent install my system went from being 38% full 
> to being 30% full after executing clean.
> 
> Do the apt GUI's have a clean feature?  If not, it would seem to me that 
> those 
> who use them should occasionally use the command line to clean their systems. 
>  
> Is that right?

In synaptic, it's "Settings > Preferences > Files > Clear cache" (I
don't use synaptic myself, so that's all according to this article from
2009 http://www.cyberciti.biz/faq/ubuntu-clean-aptitude-cache/ )

I'm sure the others do too.

It's not automatic, because people have reasons for wanting to keep the
cache around. For example, most recently-installed Debian systems  have
a cron job to download the lastest updates in the background. Where are
those updates stored until they're installed? The package cache.

> On I side note, some years ago Karsten Self did some posts here on why 
> aptitude was better than apt.  I notice that aptitude does not come on the 
> initial installs of the most recent version of Ubuntu and Kabuntu.  You have 
> to use apt-get to get aptitude.  I thought this strange.

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Ubuntu 10.10 S-video out on Dell Inspiron 1525 ???

2011-03-12 Thread Chanoch (Ken) Bloom
On Thu, 2011-02-03 at 20:52 -0800, Bill Kendrick wrote:
> ... Uh... WTF?  How does one get S-Video out to work on an Inspiron nowadays?
> 
> It looks like xorg.conf has been split up into a .d directory.
> Any clues?  Anyone done this?  THis is seriously pissing me off.
> (Google doesn't help by giving me nothing but 5 year old forum pages
> with no answers, or about other laptops.)

You use xrandr. (or one of the GUI control panels designed to interact
with xrandr.)


___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Iceweasel that will not die

2011-03-10 Thread Chanoch (Ken) Bloom
On Wed, 2011-03-09 at 22:37 -0800, Richard Harke wrote:
> This is basically correct. But I had deleted the strangely named
> directory that held
> the lock file and apparently that was the problem. I don't understand
> why this wasn't
> removed and recreated during the purge/install cycle. But its good
> now.
> Thanks for replying.
> Richard

The strangely named directory contains all of your configuration --
bookmarks, history, cookies, etc. I'm not sure why they use the
strangely named directory -- probably some sort of security through
obscurity. You saw how my use of a * circumvented that pretty easily.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Iceweasel that will not die

2011-03-09 Thread Chanoch (Ken) Bloom
On Wed, Mar 09, 2011 at 05:11:55PM -0800, jdnew...@gmail.com wrote:
> That message indicates that a lock file is still present in a
> configuration directory in your home directory. I don't use
> Iceweasel, so I leave it to you to figure out which directory (I
> would guess .iceweasel) and file are involved, and delete the file.

It's .mozilla/firefox/*/.parentlock

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Netflix

2011-03-08 Thread Chanoch (Ken) Bloom
On Tue, 2011-03-08 at 12:28 -0800, jim wrote:
> how do you know online petitions are not worth...? 
> if i were in charge of a company or department, i'd 
> make sure y group was attentive to incoming electronic 
> info. i'd at least try to ensure that the filters were 
> sufficiently granular and produced useful statistics. 
> it's a question: do you have info or are you jaded 
> or some such? 

I'm jaded. But seriously online positions are a perfect example of
slacktivism -- all someone needs to do to sign it is spend a couple
minutes of their time and go on the way. Someone may come along later
and present this petition to the company in question, but most likely
the CEO will (a) only waste a couple minutes of his time looking at it
and (b) have no idea whether this is a lot of people. But I suspect a
lot of these petitions never make it to the decision makers.

If you want Netflix on Linux, why not write your own letter to someone
in the support staff asking for help (as though you assume it should
work). That forces someone in the company to respond and makes them take
some time talking about it. And by continuing a conversation for as long
as you canm it makes it clear that you're interested enough to put in
some effort.

But really, you often need someone with leverage to go talk to them. If
Mark Shuttleworth thought that being able to watch Netflix on Linux was
important for his business, and could try to make an appointment with
the CEO of netflix, and address them personally that would make a big
impact. Likewise, someone who's a principal developer in a Linux video
app could also make the case. But he has do discuss why DRM problems are
non-issues (or unlikely issues).

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Netflix

2011-03-08 Thread Chanoch (Ken) Bloom
On Tue, Mar 08, 2011 at 09:13:08AM -0800, Bob Scofield wrote:
> On Tuesday 08 March 2011, Darth Borehd wrote:
> > Netflix intentional denies Linux clients from using their streaming service
> > because of DRM.  Please send them letters and phone calls expressing why
> > this is stupid.
> 
> There's an online petition out there somewhere.  I've signed it.

Online petitions generally aren't worth the paper they're printed on.

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Apache: 2, Me: 0.

2011-02-21 Thread Chanoch (Ken) Bloom
On Mon, 2011-02-21 at 19:32 -0800, Shwaine wrote: 
> On Mon, 21 Feb 2011, Chanoch (Ken) Bloom wrote:
> 
> > On Sun, 2011-02-20 at 14:34 -0800, Shwaine wrote:
> >> Sorry for the late reply, I've been swamped with program reviews,
> >> candidate interviews, paper writing and teaching all week (the things
> >> we do for academia, heh)
> >
> > A *very* late reply. Where were you in August, to translate the
> > implications for me when I made the same observations back then?
> >
> > http://lugod.org/mailinglists/archives/vox-tech/2010-08/msg6.html
> >
> 
> Same topic, but not the same thread. This thread was started by Peter on 
> February 15, 2011, with the last reply prior to mine on that same day. 
> Ergo, my reply was only 5 days late to his current thread. So if you want 
> to get snippy at someone for bringing back up an old topic, get snippy at 
> Peter for posting it again (and apparently not seeing your explanation the 
> last time around), not at me for replying to his current post.

Sorry. I meant a more playful tone, but forgot that sarcasm doesn't work
on the 'net. I know very well that it was an old thread.

--Ken 
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Apache: 2, Me: 0.

2011-02-21 Thread Chanoch (Ken) Bloom
On Sun, 2011-02-20 at 14:34 -0800, Shwaine wrote:
> Sorry for the late reply, I've been swamped with program reviews, 
> candidate interviews, paper writing and teaching all week (the things 
> we do for academia, heh)

A *very* late reply. Where were you in August, to translate the
implications for me when I made the same observations back then?

http://lugod.org/mailinglists/archives/vox-tech/2010-08/msg6.html

> To follow-up on the TCP 3-way handshake issue, in particular, the ACK 
> packet is not getting through. If you look at the original tcpdump log, 
> the SYN from the outside world gets in, the SYN/ACK from satan gets out, 
> but the final ACK from the outside world never arrives.
> 
> I sincerely doubt this is an Apache issue. It looks more like an iptables 
> issue to me. Try what Troy recommends to confirm that netcat also gets 
> blocked (which I suspect it will) just to be sure it isn't Apache. If you 
> cannot get through with netcat, the next thing to do is check iptables 
> with the following command:
> 
> iptables -L -n
> 
> Forward the output from that command to the list and we can see if its 
> your iptable rules that are preventing the connection from establishing. 
> In particular, I would bet you don't have an "allow RELATED,ESTABLISHED" 
> rule in place. You probably only have an "allow SYN to port 80" in place. 
> Without the corresponding related/established rule, your TCP 3-way 
> handshake would get cut off on sending the final ACK, just as was seen in 
> your tcpdump output.
> 
> For example, for my webserver, you would see the following in the iptables 
> INPUT chain with the above iptables command:
> 
> Chain INPUT (policy DROP)
> target prot opt source   destination
> ACCEPT tcp  --  0.0.0.0/0 tcp 
> spts:1024:65535 dpt:80 flags:0x17/0x02
> ACCEPT all  --  0.0.0.0/00.0.0.0/0   state 
> RELATED,ESTABLISHED
> 
> If you are missing that second line while having the "flags" on the first 
> line (allow SYN flag only) and your default policy on INPUT is to DROP, 
> then you've found your culprit.
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Ubuntu 10.04 LTS upgrade woes

2011-01-18 Thread Chanoch (Ken) Bloom
On Tue, 2011-01-18 at 18:07 -0800, Bill Broadley wrote:
> On 01/18/2011 03:43 PM, Brian Lavender wrote:
> > tar cf dotfiles.tar .[!.]* || exit 2
> 
> I agreed with most of Brian's post, but the above seems unnecessarily complex 
> and useless.  My best guess is that someone is paranoid, doesn't understand 
> that ".." is a special case, or maybe it's portable to some broken version of 
> tar like solaris's.
> 
> To demonstrate:
> bill@kona:~/tmp/t2$ tar cvzf ../t1.tar .[!.]*
> .bar
> .blarg
> .foo
> .zoop/
> bill@kona:~/tmp/t2$ tar cvzf ../t2.tar .
> ./
> ./.foo
> ./.bar
> ./.blarg
> ./.zoop/
> bill@kona:~/tmp/t2$
> 
> No protecting against ".." necessary.  Nor would ~/..foo be accidentally
> excluded (unlikely but legal).  Nor am I sure what || exit 2 is supposed to 
> do.  Well I know about return values... but why?
> 
> Does anyone know of a Linux tar that doesn't behave like the above?

I think you're misreading his intent.

He wants *only* the dotfiles (and none of the regular files), so what he
wants is 

tar zcf dotfiles.tar .*

However, when you ask for .*, the expansion includes . so your entire
home directory is tarred up in the tarball. He should change it to 

tar zcf dotfiles.tar .?*

which will require at least an additional character. But when you do
this, .. is included in the glob expansion, and so .. and all its
children get included in the tarball. (Yes, I tested on GNU tar)

That's why he changed it to the following, which requires there be a
non-dot character after the dot

tar zcfv dotfiles.tar .[!.]*

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Formatting a disk for Macintosh using Linux

2011-01-08 Thread Chanoch (Ken) Bloom
I've been asked to move data from an old external hard drive to a new
one, and to make the new one compatible with the Macintosh. (The old
drive's USB connection has died, and I'm connecting to old the drive using
a PC card that provieds an eSATA to the drive. The recipient's 
Macintosh doesn't have a PC card slot, so she can't access the old
drive anymore. Hence, the new drive.)

Naturally, I'm doing this data transfer using Linux. I've discovered
that I can format the drive as HFS+ using mkfs.hfsplus from the
hfsprogs package. But I need to know: do I need to do anything special
with the partition table? Is there a special Macintosh partition table
format that I need to format this disk to? If so, what tools can I use
to get the right format for the partition table?

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Vipre and ESET Antivirus

2010-12-04 Thread Chanoch (Ken) Bloom
On Fri, 2010-12-03 at 17:23 -0800, Rick Moen wrote:
> Quoting Bill Kendrick (n...@sonic.net):
> 
> > Tsk tsk, this is off-topic for a Linux group! ;)
> 
> You know, that's actually something I've until now understood to be
> (idiosyncratically to LUGOD) not the case, because of the way the
> mailing list was chartered.  (Please note, I'm not challenging what
> you're saying, Bill.  I'm just saying I've previously heard
> differently.) 
> 
> Specifically, the listinfo page says 'All Linux and computer related
> technical questions and discussions go here', and the page title says
> 'vox-tech -- lugod's technical discussion forum'.  Over the years, it
> has seemed as if 'computer related technical questions' had been
> construed to encompass non-Linux OSes and applications as well, which is
> why until today I'd not been surprised to see those discussions occur
> frequently without objection.
> 
> Again, no problem whatsoever if you want to see concentration on Linux.
> I'm just saying it looks like a small shift from prior policy, as I
> understood it.

I've seen non-Linux stuff here from time to time, but I think there's a
gentlemen's agreement that it should be relatively rare, and that the
more Linux relevant it is, the better (e.g. I doubt anyone would beven
think to complain that a question about Debian GNU/KFreeBSD or Debian
GNU/Hurd was off topic).

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Idea for 'tee' -- shut up already!

2010-12-04 Thread Chanoch (Ken) Bloom
On Fri, 2010-12-03 at 14:13 -0800, Bill Kendrick wrote:
> So I'm grepping & cut'ing a huge log file (6.4 million lines)
> and made the mistake of deciding to pipe it through "tee" to
> watch for a while.  I forgot to do this from within a "screen"
> session, so I'm kind of stuck staring at it in a terminal.  *sigh* :)
> 
> I don't want to watch any more, and wish I could do something like,
> I dunno maybe like this...?
> 
> 
>   $ cat hugefile.log | grep whatever | cut -f 1,2,3 | tee output.txt
>   {huge dump of data}
>   ^Z
>   [1]+  Stoppedcat hugefile.log | grep whatever | cut -f 1,2,3 | tee 
> output.txt
>   $ kill -SIGUSR1 %1
> 
> And then resume:
> 
>   $ fg
>   {wonderful silence}
> 
> 
> or background:
> 
>   $ bg
>   [1]+cat hugefile.log | grep whatever | cut -f 1,2,3 | tee output.txt &
>   $ 
> 
> 
> In other words, a way to tell tee to "shut up" and stop dumping to stdout
> any more (but keep copying from stdin to the file specified).
> 
> 
> I wonder, is there any other Linux'y trick I can use in the meantime?
> (Maybe fiddling in /proc ? ;) )

Once upon a time, I hacked tee to do this, but I can't find my source
code anymore. I think it even responded to SIGUSR1.

However, I still have the binary in my git history. It's attached.

--Ken



tee2
Description: application/executable
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] scp bandwidth limit

2010-12-01 Thread Chanoch (Ken) Bloom
On Wed, 2010-12-01 at 16:03 -0800, Bill Kendrick wrote:
> My DSL is assymetric.  Uploads slow down everything else (most
> notably, my SSH sessions).
> 
> This is particularly noticable now that I have a WiFi router that does
> more than just 802.11b.  (In other words, it's a lot easier for my
> laptop to saturate my DSL bandwitdh now ;) )
> 
> 
> I find that things work nice if I limit the upload speed using
> "scp -l 240" (30KB/s, since it seems to max out at about 50-60KB/s).
> However, I'd like to do this only when uploading, not downloading.
> So setting up an alias (e.g., "alias scp scp -l" in my ~/.bashrc)
> isn't the best solution.
> 
> Is there a config somewhere that I can use to limit 'local -> remote'
> transfers (uploads), while not limiting 'remote -> local' transfers
> (downloads)?  I don't see _anything_ related to bandwidth limiting
> in "man ssh_config" (which kinda makes sense, since the "-l" option
> is specific to scp).
> 
> Is there some scp config file that I'm not discovering? :)

Perhaps you'd like to look at traffic shaping at the kernel level
instead. See http://www.tldp.org/HOWTO/ADSL-Bandwidth-Management-HOWTO/

(You should be able to just install apt-get install wondershaper, read
the readme, tell it your upload and download speed, and get good
results.)
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] 32 bit versus 64 bit linux

2010-11-23 Thread Chanoch (Ken) Bloom
On Tue, 2010-11-23 at 18:19 -0800, Jason Snyder wrote:
> How do I know what linux I have?  Whether it is 32 or 64.  I have
> ubuntu 9.10 but upgraded it to 10.4.
> 
> I typed the following and got the following results:
> 
> snyde...@snyderjm-laptop:~$ uname -a
> Linux snyderjm-laptop 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16
> 19:48:22 UTC 2010 i686 GNU/Linux
> snyde...@snyderjm-laptop:~$ 

32-bit

The i686 tells you that.

If it were 64-bit, it would say x86_64 like my system does:

Linux cat-in-the-hat 2.6.36-trunk-amd64 #1 SMP Wed Oct 27 14:28:29 UTC
2010 x86_64 GNU/Linux
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] ifort and icc compilers

2010-11-23 Thread Chanoch (Ken) Bloom
On Tue, 2010-11-23 at 17:50 -0800, Jason Snyder wrote:
> this program is flawed they do have have any uninstalled thing.  Am I
> going to have to reformat the disk partition where ubuntu is and then
> reinstall ubuntu in order to resolve  this problem?  Should I contact
> LERT and make an appointment with them or see if I can meet with
> someone from the Lugod's to have them go through my system to weed out
> any bugs?
> 
> I need a detailed list of instructions on how to install and run the
> ifort and icc programs for I am encountering WAY too many bugs trying
> to get these programs.  There is no reason why this should be so
> complicated.

If you installed into /opt, then you should be able to just delete the
appropriate subdirectory of /opt.

My general rule is that whenever I install unpackaged software, the
software gets installed into its own subdirectory in /opt (unless I'm
installing for just myself, in which case it's a subdirectory of
~/scratch). If something should be accessable systemwide (in your
$PATH), I symlink the binaries into /usr/local/bin. When I need to
delete something, I can just delete the appropriate subdirectory
of /opt.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Program Compilation WRF_prep_chem_sources

2010-11-20 Thread Chanoch (Ken) Bloom
On Fri, 2010-11-19 at 14:57 -0800, Jason Snyder wrote:
> I now get the following warning messages:
> 
> cp -f ..//lib/modules/an_header.f90 an_header.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> an_header.f90
> rm -f an_header.f90
> cp -f ..//lib/charutils.f90 charutils.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> charutils.f90
> rm -f charutils.f90
> cp -f ..//lib/dateutils.f90 dateutils.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> dateutils.f90
> rm -f dateutils.f90
> gcc -c -O2  -DPC_LINUX1 -I..//include   ..//lib/dted.c
> ..//lib/dted.c: In function ‘readdted1_’:
> ..//lib/dted.c:230: warning: ignoring return value of ‘fscanf’,
> declared with attribute warn_unused_result
> ..//lib/dted.c:249: warning: ignoring return value of ‘fread’,
> declared with attribute warn_unused_result
> gcc -c -O2  -DPC_LINUX1 -I..//include   ..//eff/eenviron.c
> ..//eff/eenviron.c: In function ‘fegetenv_’:
> ..//eff/eenviron.c:144: warning: incompatible implicit declaration of
> built-in function ‘exit’
> cp -f ..//lib/error_mess.f90 error_mess.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> error_mess.f90
> rm -f error_mess.f90
> cp -f ..//lib/filelist.F90 filelist.F90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> -DPC_LINUX1 filelist.F90
> f951: warning: command line option "-FR" is valid for C/C++/ObjC/ObjC
> ++ but not for Fortran
> rm -f filelist.F90
> cp -f ..//lib/getvar.f90 getvar.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include  getvar.f90
> rm -f getvar.f90
> cp -f ..//lib/htint-opt.f90 htint-opt.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> htint-opt.f90
> rm -f htint-opt.f90
> cp -f ..//lib/interp_lib.f90 interp_lib.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> interp_lib.f90
> rm -f interp_lib.f90
> cp -f ..//lib/map_proj.f90 map_proj.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> map_proj.f90
> rm -f map_proj.f90
> cp -f ..//lib/numutils.f90 numutils.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> numutils.f90
> rm -f numutils.f90
> gcc -c -O2  -DPC_LINUX1 -I..//include   ..//lib/parlib.c
> cp -f ..//lib/polarst.f90 polarst.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> polarst.f90
> rm -f polarst.f90
> cp -f ..//lib/rsys.F90 rsys.F90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> -DPC_LINUX1 rsys.F90
> f951: warning: command line option "-FR" is valid for C/C++/ObjC/ObjC
> ++ but not for Fortran
> rm -f rsys.F90
> cp -f ..//lib/therm_lib.f90 therm_lib.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> therm_lib.f90
> rm -f therm_lib.f90
> gcc -c -O2  -DPC_LINUX1 -I..//include   ..//lib/tmpname.c
> ..//lib/tmpname.c: In function ‘form_tmpname_’:
> ..//lib/tmpname.c:29: warning: incompatible implicit declaration of
> built-in function ‘strlen’
> gcc -c -O2  -DPC_LINUX1 -I..//include   ..//lib/utils_c.c
> ..//lib/utils_c.c: In function ‘rams_c_read_’:
> ..//lib/utils_c.c:169: warning: ignoring return value of ‘fread’,
> declared with attribute warn_unused_result
> ..//lib/utils_c.c: In function ‘rams_c_read_char_’:
> ..//lib/utils_c.c:181: warning: ignoring return value of ‘fread’,
> declared with attribute warn_unused_result
> ..//lib/utils_c.c: In function ‘vfirecr_’:
> ..//lib/utils_c.c:213: warning: ignoring return value of ‘fread’,
> declared with attribute warn_unused_result
> ..//lib/utils_c.c:217: warning: ignoring return value of ‘fread’,
> declared with attribute warn_unused_result
> cp -f ..//lib/utils_f.f90 utils_f.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> utils_f.f90
> rm -f utils_f.f90
> cp -f ..//lib/vformat.f90 vformat.f90
> gfortran -c -FR -O2 -fconvert=big-endian  -g -I..//include
> vformat.f90
> rm -f vformat.f90
> ar
> rs 
> /media/WRFDisk/WRF3.2/WRFV3/Prep_sources_chem_cptec_wrf/utils/bin//libutils-2.0-opt.a
>  an_header.o charutils.o dateutils.o dted.o eenviron.o error_mess.o 
> filelist.o getvar.o htint-opt.o interp_lib.o map_proj.o numutils.o parlib.o 
> polarst.o rsys.o therm_lib.o tmpname.o utils_c.o utils_f.o vformat.o  
> ar:
> creating 
> /media/WRFDisk/WRF3.2/WRFV3/Prep_sources_chem_cptec_wrf/utils/bin//libutils-2.0-opt.a
> 
> Finished building
> === 
> /media/WRFDisk/WRF3.2/WRFV3/Prep_sources_chem_cptec_wrf/utils/bin//libutils-2.0-opt.a
> 
> How should I go about fixing these error/warming messages?

Your compilation completed successfully. There are no error messages --
only warnings.

Warning messages ususally mean that the programmer did something that's
technically allowed in the language, but usually isn't a good idea. If
you were writing this software yourself, I'd tell you to go fix them,
but since you're running software that someone else wrote, and it's been
tested an awful lot, you don't need to do anything. Just run the
software.
___
vox-tech mailing list

Re: [vox-tech] entering a prolog program?

2010-11-20 Thread Chanoch (Ken) Bloom
On Fri, 2010-11-19 at 20:05 -0800, Brian Lavender wrote:
> Can you type in axioms into prolog from the command line? All I seem to
> be able to do is load a program and query it. 
> 
> Can I just enter the following program at the prolog prompt?
> 
> factorial(0,1).
>   
> factorial(A,B) :-  
>A > 0, 
>C is A-1,
>factorial(C,D),
>B is A*D. 
> 
> 
> All I seem to be able to do is load it. I am using SWI prolog.
> 
> $ swipl
> ?- ['factorial.pl'].
> true.
> 
> If I try the following, I get an error. 
> 
> ?- factorial(0, 1).
> ERROR: toplevel: Undefined procedure: factorial/2 (DWIM could not correct 
> goal)

Typing [user]. the way you typed ['factorial.pl']. will enter an
interactive rule entry mode. When you're finished with that mode, hit
Ctrl-D to return to query mode.

--Ken


___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Program Compilation WRF_prep_chem_sources

2010-11-19 Thread Chanoch (Ken) Bloom
On Fri, 2010-11-19 at 08:11 -0800, Jason Snyder wrote:
> I found this program this bit of code that I need to use when running
> a part of the WRF model:
> 
>  #-  LINUX INTEL FORTRAN-95 Compiler/GCC  -
> CMACH=PC_LINUX1
> F_COMP=gfortran
> C_COMP=gcc
> LOADER=gfortran
> C_LOADER=gcc
> LIBS=
> MOD_EXT=mod
> #Compiler options
> F_OPTS=-FR -O2 -convert big_endian $(NCDF_LIBS) -g
> C_OPTS=-O2
> LOADER_OPTS=
> C_LOADER_OPTS=-v
> #-
> 
> I have both the gfortran and gcc compilers on my computer but when I
> run this code I get the following error message:
> 
> cp -f ..//lib/modules/an_header.f90 an_header.f90
> gfortran -c -FR -O2 -convert big_endian  -g -I..//include
> an_header.f90
> gfortran: big_endian: No such file or directory
> gfortran: unrecognized option '-convert'
> make: *** [an_header.o] Error 1
> 
> I evidently need the command F_OPTS=-FR -O2 -convert big_endian
> $(NCDF_LIBS) -g to make the rest of the programs for this model
> including the prep_chem_sources to run properly so I am not sure how
> to resolve this program.  Is it something having to do with the netcdf
> libraries that i have to add?  (ncdf_libs is netcdf?).
> 
> Anyway, let me know how to resolve this issue.

Replace "-convert big_endian" with "-fconvert=big-endian"
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] git tag?

2010-11-05 Thread Chanoch (Ken) Bloom
On Fri, 2010-11-05 at 11:34 -0700, Brian Lavender wrote:
> How do you tag a group of files with git?

What do you mean by tag a group of files?
You can tag a revision -- that is, give it a human-readable name using
the git tag command.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] procmail question

2010-10-23 Thread Chanoch (Ken) Bloom
On Sat, 2010-10-23 at 14:07 -0700, Tony Cratz wrote:

> On 10/21/2010 11:21 AM, Ken Bloom wrote:
> > That's why I suggested GNU mailutils. It has a "sieve" command that
> > looks like it's a standalone filter (procmail replacement).
> 
> 
>   I would like to come back to this and ask a question just
>   in case I did not see what I should have.
> 
>   Do you know if Sieve can rewrite headers. For example can I
>   change the To: header, or the Subject: header.


A quick googling suggests it doesn't know how to do it in-process, but
you could use the GNU mailutils pipe extension to do such things (in
conjunction with a program like formail or reformail, or of course a
spam filter like spamassassin). You can look in /usr/lib/mailutils/ to
see what extensions are available, and you can write your own as a
shared library.

> And if the
>   answer is yeas, then can I take the new message and send it
>   to my SMTP server (such as Sendmail) to redeliver the message
>   to the new list?



>   Maildrop was also mention, I only took a quick and dirty look
>   at it. Can it also solve the above questions?


I don't actually use Sieve for my email. I suggested it because it was a
standard.

I've used maildrop in the past (rewriting headers, and running spam
filters with its xfilter command), and my mail filters looked like (for
example)


if (/Mailing-List: list some.mailinglist.org; contact/:h || \
/From:.*...@bar.com/ || \
/From:.*...@foo.com/ || \
/From:.*...@bar.com/ || \
/From:@some.domain.org/ || \
/Mailing-List: list some-other-mailingl...@yahoogroups.com; / || \
/From:.*afi...@email.org/ )
{
  to $MAILBOX/.util.probably-spam
}

# spam filtering
if ($SIZE < 1048576)
{
   xfilter 'spamassassin'
}

if (/^X-Spam-Status: Yes/)
{
   xfilter 'reformail -I"Status: RO"'
   to '| $HOME/bin/maildir-deliverread $MAILBOX/.util.probably-spam'
}



I didn't like this (I didn't find it concise enough), and the
backslashes as line continuations and mandatory braces annoyed me. (I
was always forgetting them when I made changes, and it would break my
email for days on end.)

So I changed to a solution in Ruby. I tried Perl first, but Perl
performs variable interpolation with the @ sigil, so you can't put email
addresses in a regular expression in Perl without escaping them. You'll
notice that I don't bother to escape the period metacharacter in my
regular expressions. Though technically, it can match any character,
that possibility for false positives doesn't seem to matter much.

 First, here's the skeleton that you need to write your own version.
(You'll probably want to redefine the saveread function so that it
doesn't depend on an external script.)


#!/usr/bin/env ruby
require 'rfilter/delivery_agent'
class RFilter::DeliveryAgent

   def myfilter
  #RULES GO IN HERE
   end

   #SUPPORT CODE FOLLOWS
  

   def self.header_accessor name,field
  class_eval <<-"end;"
 def #{name}
header["#{field}"] || ""
 end
  end;
   end

   header_accessor :from, "From"
   header_accessor :to, "To"
   header_accessor :listid, "List-Id"
   header_accessor :spam, "X-Spam-Status"
   header_accessor :subject, "Subject"
   header_accessor :msgid, "Message-id"
   header_accessor :cc, "CC"

   def isto? pattern
 not [to,cc].grep(pattern).empty?
   end
   def involves? pattern
 not [from,to,cc].grep(pattern).empty?
   end

   def ignore mailbox
  saveread ".ignored-summer"
   end

   alias_method :internal_save, :save
   def saveto mailbox
  internal_save "#{ENV['HOME']}/Maildir/#{mailbox}/"
   end
   alias_method :save, :saveto

   def saveread mailbox
  pipe "#{ENV['HOME']}/bin/maildir-deliverread 
#{ENV['HOME']}/Maildir/#{mailbox}/"
   end

   def discard
  pipe "true"
   end

   def main
  myfilter
   end

end

begin
   RFilter::DeliveryAgent.process(STDIN,nil) { |agent| agent.main }
rescue RFilter::DeliveryAgent::DeliverySuccess
end


Then you can write really concise rules that look like this. (Any call
to a save function or discard function stops the filter right there.)


  discard if from =~ /nore...@studygroup.com/
  discard if from =~ /walgre...@email.walgreens.com/
  saveto ".computer" if header["Return-Path"] =

Re: [vox-tech] Webserver Woes: Lost Packets

2010-10-18 Thread Chanoch (Ken) Bloom
On Mon, 2010-10-18 at 00:34 -0400, Peter Salzman wrote:
> On Mon, Oct 18, 2010 at 12:18 AM, Chanoch (Ken) Bloom  
> wrote:
> > On Mon, 2010-10-18 at 00:07 -0400, Peter Salzman wrote:
> >> On Sun, Oct 17, 2010 at 11:25 PM, Chanoch (Ken) Bloom  
> >> wrote:
> >> > On Sun, 2010-10-17 at 22:18 -0400, Peter Salzman wrote:
> >> >> > Your apache configuration has nothing to do with a problem at this
> >> >> > level.
> >> >
> >> >> If it's not an Apache or firewall problem, then you should be able to
> >> >> connect to dirac.org.   Can you reach it?
> >> >
> >> > No, I can't.
> >> >
> >> > Here's some potentially relevant info:
> >> >
> >> > [bl...@cat-in-the-hat ~]$ dig dirac.org
> >> >
> >> > ; <<>> DiG 9.7.1-P2 <<>> dirac.org
> >> > ;; global options: +cmd
> >> > ;; Got answer:
> >> > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17811
> >> > ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
> >> >
> >> > ;; QUESTION SECTION:
> >> > ;dirac.org. IN  A
> >> >
> >> > ;; ANSWER SECTION:
> >> > dirac.org.  3590IN  A   24.189.162.69
> >> >
> >> > ;; Query time: 17 msec
> >> > ;; SERVER: 192.168.1.1#53(192.168.1.1)
> >> > ;; WHEN: Sun Oct 17 22:23:24 2010
> >> > ;; MSG SIZE  rcvd: 43
> >> >
> >> > [bl...@cat-in-the-hat ~]$ traceroute dirac.org
> >> > traceroute to dirac.org (24.189.162.69), 30 hops max, 60 byte packets
> >> >  1  DD-WRT (192.168.1.1)  0.969 ms  1.961 ms  2.354 ms
> >> >  2  24-148-9-1.arm-bsr1.chi-arm.il.cable.rcn.com (24.148.9.1)  12.839 ms 
> >> >  13.204 ms  13.440 ms
> >> >  3  mart-h1.chi-mart.il.cable.rcn.net (207.229.191.130)  14.296 ms  
> >> > 14.540 ms  14.768 ms
> >> >  4  tge3-1.border2.eqnx.il.rcn.net (207.172.19.159)  217.065 ms  217.437 
> >> > ms  217.673 ms
> >> >  5  r1-ge9-0-0.in.chcgildt.cv.net (206.223.119.13)  19.001 ms  19.378 ms 
> >> >  19.611 ms
> >> >  6  64.15.1.6 (64.15.1.6)  44.633 ms  39.785 ms  40.078 ms
> >> >  7  64.15.5.137 (64.15.5.137)  45.814 ms  44.587 ms  41.395 ms
> >> >  8  ool-4353dd8e.dyn.optonline.net (67.83.221.142)  40.295 ms  45.014 ms 
> >> >  45.359 ms
> >> >  9  ubr101-ge1-0-0.cmts.nyk4ny.cv.net (67.83.221.171)  42.448 ms  42.691 
> >> > ms  42.922 ms
> >> > 10  * * *
> >> > 11  * * *
> >>
> >>
> >> Well, it looks OK, I guess.  However, if I see the request coming in
> >> with tcpdump, yet Apache doesn't log the request, doesn't that point
> >> to some kind Apache misconfiguration?
> >
> > The traceroute stops somewhere before it ever reaches your dirac.org.
> > (or it *does* reach your machine, but the responses are getting eaten
> > somewhere in the middle.)
> >
> > So you need to get on the phone with your ISP.
> >
> > --Ken
> 
> 
> Not to belabor the point, but we know the packets are received by
> dirac.org because I see them with tcpdump.

Then something's dropping the packets that satan is sending as a
response, and it looks from the traceroute like it's the machine just
before ubr101-ge1-0-0.cmts.nyk4ny.cv.net. ("before" from your
perspective)
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Webserver Woes: Lost Packets

2010-10-17 Thread Chanoch (Ken) Bloom
On Mon, 2010-10-18 at 00:07 -0400, Peter Salzman wrote:
> On Sun, Oct 17, 2010 at 11:25 PM, Chanoch (Ken) Bloom  
> wrote:
> > On Sun, 2010-10-17 at 22:18 -0400, Peter Salzman wrote:
> >> > Your apache configuration has nothing to do with a problem at this
> >> > level.
> >
> >> If it's not an Apache or firewall problem, then you should be able to
> >> connect to dirac.org.   Can you reach it?
> >
> > No, I can't.
> >
> > Here's some potentially relevant info:
> >
> > [bl...@cat-in-the-hat ~]$ dig dirac.org
> >
> > ; <<>> DiG 9.7.1-P2 <<>> dirac.org
> > ;; global options: +cmd
> > ;; Got answer:
> > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17811
> > ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
> >
> > ;; QUESTION SECTION:
> > ;dirac.org. IN  A
> >
> > ;; ANSWER SECTION:
> > dirac.org.  3590IN  A   24.189.162.69
> >
> > ;; Query time: 17 msec
> > ;; SERVER: 192.168.1.1#53(192.168.1.1)
> > ;; WHEN: Sun Oct 17 22:23:24 2010
> > ;; MSG SIZE  rcvd: 43
> >
> > [bl...@cat-in-the-hat ~]$ traceroute dirac.org
> > traceroute to dirac.org (24.189.162.69), 30 hops max, 60 byte packets
> >  1  DD-WRT (192.168.1.1)  0.969 ms  1.961 ms  2.354 ms
> >  2  24-148-9-1.arm-bsr1.chi-arm.il.cable.rcn.com (24.148.9.1)  12.839 ms  
> > 13.204 ms  13.440 ms
> >  3  mart-h1.chi-mart.il.cable.rcn.net (207.229.191.130)  14.296 ms  14.540 
> > ms  14.768 ms
> >  4  tge3-1.border2.eqnx.il.rcn.net (207.172.19.159)  217.065 ms  217.437 ms 
> >  217.673 ms
> >  5  r1-ge9-0-0.in.chcgildt.cv.net (206.223.119.13)  19.001 ms  19.378 ms  
> > 19.611 ms
> >  6  64.15.1.6 (64.15.1.6)  44.633 ms  39.785 ms  40.078 ms
> >  7  64.15.5.137 (64.15.5.137)  45.814 ms  44.587 ms  41.395 ms
> >  8  ool-4353dd8e.dyn.optonline.net (67.83.221.142)  40.295 ms  45.014 ms  
> > 45.359 ms
> >  9  ubr101-ge1-0-0.cmts.nyk4ny.cv.net (67.83.221.171)  42.448 ms  42.691 ms 
> >  42.922 ms
> > 10  * * *
> > 11  * * *
> 
> 
> Well, it looks OK, I guess.  However, if I see the request coming in
> with tcpdump, yet Apache doesn't log the request, doesn't that point
> to some kind Apache misconfiguration?

The traceroute stops somewhere before it ever reaches your dirac.org.
(or it *does* reach your machine, but the responses are getting eaten
somewhere in the middle.)

So you need to get on the phone with your ISP.

--Ken

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Webserver Woes: Lost Packets

2010-10-17 Thread Chanoch (Ken) Bloom
On Sun, 2010-10-17 at 22:18 -0400, Peter Salzman wrote:
> > Your apache configuration has nothing to do with a problem at this
> > level.

> If it's not an Apache or firewall problem, then you should be able to
> connect to dirac.org.   Can you reach it? 

No, I can't.

Here's some potentially relevant info:

[bl...@cat-in-the-hat ~]$ dig dirac.org

; <<>> DiG 9.7.1-P2 <<>> dirac.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17811
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;dirac.org. IN  A

;; ANSWER SECTION:
dirac.org.  3590IN  A   24.189.162.69

;; Query time: 17 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sun Oct 17 22:23:24 2010
;; MSG SIZE  rcvd: 43

[bl...@cat-in-the-hat ~]$ traceroute dirac.org
traceroute to dirac.org (24.189.162.69), 30 hops max, 60 byte packets
 1  DD-WRT (192.168.1.1)  0.969 ms  1.961 ms  2.354 ms
 2  24-148-9-1.arm-bsr1.chi-arm.il.cable.rcn.com (24.148.9.1)  12.839 ms  
13.204 ms  13.440 ms
 3  mart-h1.chi-mart.il.cable.rcn.net (207.229.191.130)  14.296 ms  14.540 ms  
14.768 ms
 4  tge3-1.border2.eqnx.il.rcn.net (207.172.19.159)  217.065 ms  217.437 ms  
217.673 ms
 5  r1-ge9-0-0.in.chcgildt.cv.net (206.223.119.13)  19.001 ms  19.378 ms  
19.611 ms
 6  64.15.1.6 (64.15.1.6)  44.633 ms  39.785 ms  40.078 ms
 7  64.15.5.137 (64.15.5.137)  45.814 ms  44.587 ms  41.395 ms
 8  ool-4353dd8e.dyn.optonline.net (67.83.221.142)  40.295 ms  45.014 ms  
45.359 ms
 9  ubr101-ge1-0-0.cmts.nyk4ny.cv.net (67.83.221.171)  42.448 ms  42.691 ms  
42.922 ms
10  * * *
11  * * *

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Webserver Woes: Lost Packets

2010-10-17 Thread Chanoch (Ken) Bloom
On Sun, Oct 17, 2010 at 06:04:58PM -0400, Peter Salzman wrote:
> I'm having trouble with Apache running on satan (192.162.0.2).  At
> some point I must have changed something, and it stopped working.
> 
> There are two virtual hosts:
> 
> 1. /etc/apache2/sites-enabled/000-default
> 
> 
>ServerAdmin p...@dirac.org
>DocumentRoot /var/www
>
>   Options FollowSymLinks
>   AllowOverride None
>
> 
>
>   Options Indexes FollowSymLinks MultiViews
>   AllowOverride None
>   Order allow,deny
>   allow from all
>
> 
>ErrorLog /var/log/apache2/error.log
>LogLevel debug
> 
>CustomLog /var/log/apache2/access.log combined
> 
> 
> 
> 
> 2. /etc/apache2/sites-enabled/001-dirac.org  (the one I want to work)
> 
> 
>ServerAdmin p...@dirac.org
>ServerName  www.dirac.org
>ServerAlias dirac.org
> 
>DirectoryIndex index.html
>DocumentRoot /var/www/
> 
>LogLevel debug
>ErrorLog  /var/log/apache2/dirac.org.error
>CustomLog //var/log/apache2/dirac.org.access combined
> 
> 
> The /etc/hostname file contains "satan".   The /etc/hosts file contains:
> 
> 192.168.0.2  satan
> 192.168.0.2  dirac.org
> 192.168.0.2  www.dirac.org
> 
> 
> 
> 
> I'm seeing different behaviors depending on whether I'm on the home
> network or outside the home network.
> 
> From the home network I can access the webserver from any computer by
> pointing a browser to http://dirac.org, http://www.dirac.org,
> http://192.168.0.2, http://24.189.162.69/, or http://satan.   When I
> access www.dirac.org or dirac.org, /var/log/apache/dirac.org.access
> gets larger.   When I access satan, 192.168.0.2, or 24.189.162.69 (my
> external IP),  /var/log/apache2/access.log gets larger.  No surprises
> here.
> 
> From outside the home network, I can't access the webserver at all,
> and as expected, none of the logs get larger.  It's clear that Apache
> simply isn't seeing anything, otherwise, the logs would increase in
> size.
> 
> I don't think it's a firewall issue because tcpdump sees external www
> requests coming from.  From external IP 10.37.247.64 (an iPhone on the
> 3G network), I point Safari to "http://www.dirac.org"; and this is what
> tcpdump reports:
> 
> r...@satan:/var/log/apache2# tcpdump -vv -i eth0 tcp port 80 | grep cingular
> tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
> satan.www > mobile-166-137-137-082.mycingular.net.4445: Flags
> [S.], cksum 0x4d17 (correct), seq 305106526, ack 4022190454, win 5792,
> options [mss 1460,sackOK,TS val 1210510762 ecr 842475580,nop,wscale
> 6], length 0
> mobile-166-137-137-082.mycingular.net.5878 > satan.www: Flags [S],
> cksum 0x3dc6 (correct), seq 1346585780, win 65535, options [mss
> 1410,nop,wscale 2,nop,nop,TS val 842476145 ecr 0,sackOK,eol], length 0
> satan.www > mobile-166-137-137-082.mycingular.net.5878: Flags
> [S.], cksum 0xcafe (correct), seq 1206576348, ack 1346585781, win
> 5792, options [mss 1460,sackOK,TS val 1210513399 ecr
> 842476145,nop,wscale 6], length 0
> mobile-166-137-137-082.mycingular.net.5878 > satan.www: Flags [S],
> cksum 0x3dbc (correct), seq 1346585780, win 65535, options [mss
> 1410,nop,wscale 2,nop,nop,TS val 842476155 ecr 0,sackOK,eol], length 0
> satan.www > mobile-166-137-137-082.mycingular.net.5878: Flags
> [S.], cksum 0xcafe (correct), seq 1206576348, ack 1346585781, win
> 5792, options [mss 1460,sackOK,TS val 1210513399 ecr
> 842476145,nop,wscale 6], length 0
> 
> Packets from the iPhone are seen coming in.  And packets are being
> sent back out to the iPhone.  However, Safari errors out with a
> "Cannot open Page" error.  Furthermore, neither
> /var/log/apache2/access.log no /var/log/apache2/dirac.org.access get
> larger.
> 
> On one hand it's "obvious" that Apache isn't seeing these packets from
> the iPhone because the logs aren't increasing in size.  On the other
> hand, it's not "obvious" because .. why are packets being sent from
> satan.www to mycingular.net?
> 
> I'm really stumped.  Any ideas?

The packets you see going from satan.www to mycingular.net are SYN-ACK
packets, which are the second part of the three-way handshake used to
open a TCP connection. That is, satan is responding to the iPhone and
agreeing to open a connection. For some reason, the iPhone doesn't see
this response (or just doesn't respond with the ACK that is the third
part of the three-way handshake).

Your apache configuration has nothing to do with a problem at this
level.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] mit-scheme in Ubuntu AMD64?

2010-10-10 Thread Chanoch (Ken) Bloom
On Sun, Oct 10, 2010 at 06:30:18PM -0700, Brian Lavender wrote:
> Anyone know why there is not mit-scheme in Ubuntu Lucid Lynx 10.04
> on AMD64 architecture?

The answer is because it's not in Debian, but we have no idea why anymore.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365530

They probably need someone to download the Debian source, patch it to
generate an AMD64 version, test it, and contribute the patch to
Debian.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] a "Bus Error" C++ issue, platform, compiler or STL?

2010-08-24 Thread Chanoch (Ken) Bloom
On Tue, 2010-08-24 at 22:17 -0400, Hai Yi wrote:
> Thanks Jeff and Bill.
> Jeff, how do you know that the value,0xba7bfff, is corrupted? Because
> it's only 3.5 bytes? Could it be possible a value with zero stripped?
> Also, what's the mapping of the argument list b/w the code and that in
> the stack?

Because it's odd. Or more accurately, because it's not a multiple of 4.
Many processors (x86 and amd64 not included) require that memory access
be word-aligned. On a 32-bit machine, that means every 4 bytes. So every
pointer needs to be a multiple of 4 (unless it's being used with special
slower instructions) or a SIGBUS will result.

(x86 and amd64 are special -- they just do the slower access using the
same instructions as you use for word-aligned accesses.)

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Suggestions for cleaning up repetitive HTML tags?

2010-08-18 Thread Chanoch (Ken) Bloom
On Wed, 2010-08-18 at 16:23 -0700, Bill Kendrick wrote:
> On Wed, Aug 18, 2010 at 01:29:14PM -0500, Chanoch (Ken) Bloom wrote:
> > Consider writing a SAX filter that just drops the offending  and
> > .
> 
> Well, we want the style info to remain... there's just no reason in
> the world for the document to specify it over and over again on
> a per-word or per-character(!) basis. :)

It doesn't have to drop all of them. I'm not sure how easy or hard it
will be to model the state that you need to do this correctly though.
That depends on the structure of your data.

> 
> > Also consider using XPath, like my following example in Ruby (using the
> > Nokogiri XML library)
> 
> Ooooh.  Thanks, I'll poke at this.  (I know there's some some Xpath stuff
> in PHP that I know nothing about, since I've only spoken to it about
> XML via its DOMDocument stuff, so far.

Note that part of the challenge here is dealing with the spaces that
come between the font tags -- deciding which ones should be included in
the newly-merged font tags, and which shouldn't. So for both techniques,
experimentation is in order.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Suggestions for cleaning up repetitive HTML tags?

2010-08-18 Thread Chanoch (Ken) Bloom
On Wed, 2010-08-18 at 10:48 -0700, Bill Kendrick wrote:
> I've come across some documents that are formatted in
> such a way that, when converted to HTML, they come out
> something like this:
> 
>   And then
>   they looked
> 
> or even worse:
> 
>   An   face="Arial">d
>   ...
> 
> 
> I've come up with a way, using PHP's DOMDocument system, to
> scrape a file clear of these, but it's very slow, and it's
> basically something that can be done on a stream of text
> (rather than having to worry about the document's structure).
> 
> I'm thinking of writing something in PHP or C to clean stuff
> like this up, but am wondering if anyone else has any experience
> and suggestions?
> 
> (And yes, I've used "htmltidy", but while that can merge _nested_
> styles, e.g., a "" get
> combined into its own CSS stype, e.g., "",
> it doesn't seem to be able to merge _consecutive_ styles,
> as shown in the examples above. :^/ )

Consider writing a SAX filter that just drops the offending  and
.

Also consider using XPath, like my following example in Ruby (using the
Nokogiri XML library)

require 'nokogiri'
def reform xml
  xml.xpath('//font[1]').each do |x|
newcontent=x.content.to_s.dup
textnodes=x.xpath('(following-sibling::text() | 
following-sibling::font/text())')
x.content=x.content+textnodes.map{|y| y.to_s}.join
textnodes.unlink
x.xpath('following-sibling::font').unlink
  end
  xml
end

xml=Nokogiri::XML('And then')
puts reform(xml).to_xml

xml=Nokogiri::XML('And then More')
puts reform(xml).to_xml

xml=Nokogiri::XML('And then More')
puts reform(xml).to_xml

#That last example probably does the wrong thing
#to fix that you might want the following more complicated version of
#the XPath

def reform xml
  xml.xpath('//font[1]').each do |x|
newcontent=x.content.to_s.dup

textnodes=x.xpath('(following-sibling::text()[following-sibling::node()[1][self::font]]
 | following-sibling::font/text())')
x.content=x.content+textnodes.map{|y| y.to_s}.join
textnodes.unlink
x.xpath('following-sibling::font').unlink
  end
  xml
end

#More hackage may be necessary depending on the exact structure of your data.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Apache2 problems

2010-08-10 Thread Chanoch (Ken) Bloom
On Tue, 2010-08-10 at 16:49 -0400, Peter Salzman wrote:
> Interesting -- I didn't know that the sites were read in alpha order.
> Also, I guess the wildcard for the NameVirtualHost is a better idea.
> 
> Unfortunately, didn't fix the problem, but more weirdness came up.   I
> can't telnet to dirac.org port 80, which would explain why the logs
> aren't being touched.   But then I'm at a loss as to how tcpdump
> apparently sees the connection:
> 
>  tcpdump -i eth0 tcp port 80
> 
> 16:40:32.104293 IP ny-131.foo.com.10096 > satan.www: Flags [S], seq
> 1653467397, win 64512, options [mss 1460,nop,nop,sackOK], length 0
> 
> 16:40:32.104314 IP satan.www > ny-131.foo.com.10096: Flags [S.], seq
> 329481650, ack 1653467398, win 5840, options [mss
> 1460,nop,nop,sackOK], length 0

You're running tcpdump on your server. The first packet is the SYN that
ny-131.foo.com sends to request the connection. The second packet is
satan.www's response. I'm not familiar with tcpdump output, but this
looks like satan.www's is a valid SYN -ACK packet agreeing to open the
connection, and acknowledging ny-131.foo.com's request. The next packet
is missing: that's supposed to be a packet from ny-131.foo.com ACKing
satan.www's response and starting to send data.

If you have those three packets, then a connection was never started,
and telnet would quite reasonably think it can't reach the port.

> It looks like the packets are getting forwarded correctly, but nobody
> is listening.  The port is set correctly in /etc/apache2/ports.conf
> and I verified that apache2 is indeed running.   It's such a
> mystery!  :-(

Why not take a look at it with Wireshark and see if that sheds any light
on the matter -- the Wireshark GUI can show much more information abut
these packets including their data, and it can dissect individual
packets for you, or show you the text content of a TCP connection.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Apache2 problems

2010-08-10 Thread Chanoch (Ken) Bloom
On Tue, Aug 10, 2010 at 03:50:00PM -0400, Peter Salzman wrote:
> I set up Apache2 on home Kubuntu box.   I defined one named virtual host in
> addition to "default" that came with the installation.  When I try to access
> the server from work, Firefox responds with "The connection timed out".
> 
> When I run tcpdump -i eth0 tcp port 80, I see the incoming request from work
> to http://www.dirac.org:
> 
> 14:30:42.219003 IP ny-131.foo.com.33188 > satan.www: Flags [S], seq
> 3646786876, win 64512, options [mss 1460,nop,nop,sackOK], length 0
> 
> I also see (what looks to be) the outgoing packets from satan to work:
> 
> 14:30:42.219027 IP satan.www > ny-131.foo.com.33188: Flags [S.], seq
> 2741002130, ack 3646786877, win 5840, options [mss 1460,nop,nop,sackOK],
> length 0
> 
> However, *nothing* is getting written to the logs:
> 
> -rw-r- 1 root root   0 2010-08-10 12:21 access.log
> -rw-r- 1 root root   0 2010-08-10 12:21 dirac.org.access
> -rw-r- 1 root root   0 2010-08-10 12:21 dirac.org.error
> -rw-r- 1 root root 330 2010-08-10 12:21 error.log
> 
> 
> The file error.log doesn't have anything interesting in it:
> 
> 
> [Tue Aug 10 12:21:00 2010] [notice] Apache/2.2.12 (Ubuntu)
> PHP/5.2.10-2ubuntu6.4 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0
> configured -- resuming normal operations
> [Tue Aug 10 12:21:00 2010] [info] Server built: Mar  9 2010 21:20:44
> [Tue Aug 10 12:21:00 2010] [debug] prefork.c(1013): AcceptMutex: sysvsem
> (default: sysvsem)
> 
> 
> From the lack of entries in the log file, it looks like Apache isn't seeing
> the incoming request.  However, tcpdump seems to be showing otherwise.  Port
> 80 is forwarded to the Linux box by the router.

First, we *need* to know the names of the files involved, since the
alphabetical order of the files determines which is the default host
(the first host is default, so you should have
sites-enabled/000-default and sites-enabled/001-dirac).

> In sites.enabled:

Did you verify that this is the correct IP address? (You probably want
to use "*:80" instead.)

> 
>ServerAdmin p...@dirac.org
>ServerName  www.dirac.org
>ServerAlias dirac.org
> 
># Indexes + Directory Root.
>DirectoryIndex index.html
>DocumentRoot /var/www/
> 
># Logfiles
>ErrorLog  /var/log/apache2/dirac.org.error
>CustomLog //var/log/apache2/dirac.org.access combined
> 
> 
> The default enabled site starts off as:

You don't have a ServerName for the default site. Is it
possible that the default is catching all of the requests since it has
no name? Give it a name. Since it's the default (its configuration
file comes first alphabetically), it will still respond
to any unknown hostnames passed in the host header.

The link I quote below says:
"ServerName should always be set for each vhost. Otherwise A DNS lookup
is required for each vhost."

> 
>ServerAdmin p...@dirac.org
>    DocumentRoot /var/www
>. . .
> 
> 
> 
> Any ideas what could be preventing this from working?

For more information about Apache virtual host ordering, see
http://httpd.apache.org/docs/2.2/vhosts/details.html

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Wireless Networking

2010-07-28 Thread Chanoch (Ken) Bloom
On Wed, 2010-07-28 at 15:23 -0400, Peter Salzman wrote:


> So you're saying that if the interface can be brought up, say, by
> "ifconfig wlan1 192.168.0.5 up" then I can safely cross driver off the
> list of possible things that went wrong?

Yes.

--Ken


___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Wireless Networking

2010-07-28 Thread Chanoch (Ken) Bloom
On Wed, Jul 28, 2010 at 12:42:36PM -0400, Peter Salzman wrote:
> I'm having a horrendously awful time getting wireless networking working on
> my Kubuntu box.   I've never played around with wireless networking on Linux
> before and wanted to consolidate my knowledge and see if I understand it
> correctly.   My two wireless cards are:
> 
> Edimax EW-7318usg
>  148F:2573 Ralink Technology, Corp. RT2501USB wireless adapter
> 
> Alfa AWUS050NH
>  148F:2770 Ralink Technology, Corp.
> 
> If this were wired networking, the steps I would take would be:
> 
> 1. Plug in the card into the computer and connect it to the router.
> 2. Load the correct driver.
> 3. Bring the interface up and assign an IP addr, either manually with
> ifconfig or automatically with dhclient.
> 3a. If manual was used in step 3, resolv.conf must contain the DNS servers
> and a gateway must be specified with "route".
> 
> I assume wireless networking must work more or less the same way.   The two
> things that are causing me grief are:
> 
> 1. I don't know if the drivers are correct.

dmesg should clue you in to that.
You can also run ifconfig -a or iwconfig to see whether the interface
appears in the list. If that works, then your driver works. (Well, if
it appears in the list but doesn't work, then you're into bug hunting,
really.)

> 2. Security details (WEP, WPA, etc)

Use wpasupplicant.

wpasupplicant maintains a configuration file with a list of networks
and their encryption types and passwords. When you run wpasupplicant,
it looks to see what's available that it knows about, picks one and
connects (to the wireless router -- then it's your job to set up the
IP address yourself.) If it doesn't know about any of the available
networks, it doesn't connect to any of them, even if they're
unencrypted.

For some security confiurations (pretty much only WEP), you can use
iwconfig.  iwconfig is the low level tool for connecting
to the network.  It doesn't remember anything about any networks (kinda
like how ifconfig works) 

Either way, you can check whether it worked by running iwconfig -- it
it says "Access Point: Not-Associated", you failed. If it gives a MAC
address, then you succeded.

Your new set of steps:

1. Plug in the card into the computer and connect it to the router.
  (check by looking at dmesg to see the USB subsystem recognizes that
  it was plugged in.)
2. Load the correct driver. (May happen automatically by udev)
  (check by running ifconfig -a to see what name the interface was
  given)
3. Bring the interface up and connect to a wireless network
  option 1: use wpa_supplicant for all of this.
  option 2: use ifconfig/iwconfig for the various steps
  (check by running iwconfig to see whether it's associated with a
  particular MAC address. Maybe you could do some kind of arp lookup
  at this point also.)
4. Assign an IP address
  option 1: dhclient
  option 2: ifconfig/route/vi resolv.conf
  (check by pinging something)

In general, you probably want to use something like network-manager or
wicd to handle connecting to wireless networks. Even if you'd
ordinarily prefer to write your own networking configuration script,
or hard code information in  /etc/network/interfaces, and let Debian
do it for you you're most likely going to be using a lot more
different networks (with a lot more varied configurations) with your
wireless card than you typically do with your wired ethernet.

If you've reached the driver step and successfully loaded the driver,
you can watch the state of your wireless card in real time using wavemon
It will show you signal strength, which AP you're associated with, and
your IP address as they change (which can be useful to have in another
window while you're fighting through the details of configuring the
network.)

> Part of the problem is that there seems to be a LOT of information out
> there, and some of it is conflicting.  For example, which drivers to use for
> these wireless cards.  When I load a driver, is there some way of finding
> out if the driver is functional for the card?   It would remove a lot of the
> later guesswork if I had confidence that the driver loaded is correct and
> working.
> 
> The 2nd question concerns security.  If you want to use WPA2/AES, is
> wpa_supplicant mandatory to use?
> 
> Since the obvious way to know if networking is functional is to ping a
> remote host, if it doesn't work, it's not clear at what stage the process is
> failing at.   Is there a way to detect that everything is AOK up to
> wpa_suplicant without having to switch the router's security completely off?
> 
> Thanks!
> Pete

> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists

Re: [vox-tech] Regular expression help

2010-06-30 Thread Chanoch (Ken) Bloom
On Wed, 2010-06-30 at 15:01 -0700, David Spencer, Internet Handyman
wrote:
> Guys, I'm sorry about asking this on the list; but I seem to have a mental
> block when it comes to regular expressions. Here's what I'm trying to do:
> 
> I have a lot of directories with a vast number of files, some of which I wish
> to delete based on the month they were created. I've built a file from some
> full directory listings that has all the files I wish to delete. (Just go with
> me on this and don't suggest alternative methods of performing the task - I'm
> simplfying the job so it can be explained more easily.)
> 
> A snippet of the file would look like this:
> 
> -rw---  1 auser auser 3.7K Apr 12 10:11 auser/folder/new/127109228.file
> -rw---  1 auser auser  16K Apr 12 12:32 auser/folder/new/127110076.file
> 
> I would like to write either single-line perl command or a nano search and
> replace to substitute the directory info and replace it with a file delete
> so it would look like this:
> 
> rm -f auser/folder/new/127109228.file
> rm -f auser/folder/new/127110076.file
> 
> Then I can just execute converted directory file as a shell script and
> delete my files. But I'm having a brain-freeze on what a valid regex would
> look like to match. Help??

Just use vim's visual block mode to delete the text that's already there
and insert new text.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] NAS/Printer Server/Web Server?

2010-06-24 Thread Chanoch (Ken) Bloom
On Thu, Jun 24, 2010 at 04:20:40PM -0700, Alex Mandel wrote:
> I may have found answers to my own questions.
> 
> Option 1: a fit-pc-slim or similar with a usb enclosure for hard drives.
> Cons- would have to configure printer share, file share etc all from
> scratch.
> Pro runs straight ubuntu or gentoo and is super low power. (Though the
> drive enclosure may make it equivalent)
> 
> Option 2: A Netgear ReadyNAS Duo
> Cons- it's a netgear hacked version of debian (actually sounds better
> than the ipkg based other NAS systems so it's almost a Pro). Uses a lot
> more power 30-40 Watts. It's a 32 bit Sparc based processor, guess thats
> not that odd considering the other NAS I've seen are ARM or PPC. Nobody
> seems to use x86, atom etc in NAS, any idea why?
> Pro - simpler setup for most use cases, larger drive support and RAID
> features than simple 2 drive enclosures. Automatic usage of usb APC UPS
> units.
> 
> Cost for both methods seem to come out about the same.

I have a different model of ReadyNAS in my lab, and when the UPS runs
out of power, the ReadyNAS shuts down (obviously), but the ReadyNAS
doesn't have the firmware to turn itself back on when the power starts
up again (so someone has to actually get down to the lab and start it
up again, and then we have to wait several hours for it to fsck,
before we can actually use it again).

Make sure they've fixed these problems in your model before buying.

--Ken

> Note to self: For some reason I'd never really thought about the fact
> that you should put such a device on a UPS. In hindsite this is probably
> what killed my previous NAS drive. So in all this the key is now I'm
> getting a UPS specifically for my NAS, router since they are in a common
> room where printers can be attached.
> 
> 
> For those curious I'm probably going Option 2, for the price it just
> seems easier to manage and since it takes most debs from standard lenny
> repos should be able to run all my python based web stuff.
> 
> Hope these notes help others find their way.


-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Memory addressing?

2010-06-22 Thread Chanoch (Ken) Bloom
On Tue, 2010-06-22 at 18:05 -0700, Bill Broadley wrote:
> On 06/22/2010 09:46 AM, Chanoch (Ken) Bloom wrote:
> > On Tue, Jun 22, 2010 at 09:11:44AM -0700, Brian Lavender wrote:
> >> Can someone confirm what is correct? 
> >>
> >> Tim and I were discussing memory addressing at Crepeville last night
> >> and we had a disagreement about how memory is addressable. I say that
> >> on today's common intel i386 32 bit architecture (in case you are one of
> >> those souls who builds your hardware from scratch), that memory is byte
> >> (octet) addressable. You can load a byte from memory into the lower 8
> >> bits of a register. Tim says that memory is only addressable on 32 bit
> >> word boundaries.
> 
> Heh, there are many tiny details that depending on your perspective could
> justify either answer.
> 
> Ken is of course correct that a pointer can address a byte.  There are
> performance penalties for unaligned byte accesses, but they work.
> 
> On the other hand from the offchip view you can't load less than a cache line
> from main memory and that's usually 64-128 bytes.  Additionally those requests
> have to be aligned on cache line boundaries.
> 
> Kinda related to the question "is an i386 a 32 bit architecture?"  Well it can
> address 40 bits (with PAE), read/write 64 bit values from main memory
> (doubles), and allow for machines with over 4GB ram.  Granted PAE is gross,
> the segment register bites again.
> 
> > (I don't know of any modern architectures that aren't
> > byte addressable, though MIPS takes some shortcuts in its various jump
> > instructions because the instructions have to be word-aligned.)
> 
> Well, depending on your definition of modern ;-).  The alpha architecture is
> IMO rather modern... even if dead.
>
> [SNIP the history of the Alpha platform]
> 
> To allow for increased CPU performance they simplified the CPU so they could
> not restrict the clock rate and spend the transistors where they would help
> performance the most.  The original didn't have byte addressing.  To write a
> byte on the original alpha you had to read 64 bits, modify the byte you wanted
> and write 64 bits.
> 
> BTW, I believe this wasn't that a pointer addresses 2^64 64 bit quantities,
> but that the bottom 6 bits of a pointer were mandated by the architecture to
> be zero.

Alpha has the BWX instructions designed to make it easy to load 8-bit
and 16-bit values into memory, but those instructions came to the
architecture 4 years into the product line.

MIPS (the first assembly language a lot of CS students learn) likewise
has special instructions for reading characters, halfwords, and
unaligned parts of words into memory as well. It also requires the
lowest bits of a pointer to be 0 when you use the lw instruction, but
can uses those for the (slower) instructions involved in smaller reads.

All of these fall into the category of what are called alignment
requirements -- you need to use special, slower instructions to read
unaligned data.

The Alpha sounds unique in omitting those features for the first 4
years, but even they had to bow to C's char in the end.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Memory addressing?

2010-06-22 Thread Chanoch (Ken) Bloom
On Tue, Jun 22, 2010 at 09:11:44AM -0700, Brian Lavender wrote:
> Can someone confirm what is correct? 
> 
> Tim and I were discussing memory addressing at Crepeville last night
> and we had a disagreement about how memory is addressable. I say that
> on today's common intel i386 32 bit architecture (in case you are one of
> those souls who builds your hardware from scratch), that memory is byte
> (octet) addressable. You can load a byte from memory into the lower 8
> bits of a register. Tim says that memory is only addressable on 32 bit
> word boundaries.
> 
> Say you look at memory in bits and then on the left is the memory
> address. 
> 
> I say that memory is normally byte addressable and the addressing
> corresponds to byte (octet) boundaries.
> 
> Address  bits
> 00 7  15 23 31
> 30 7  15 23 31
> 70 7  15 23 31
> 11   0 7  15 23 31
> 15   0 7  15 23 31
> 
> Tim says that memory is only 32 bit word addressable 
> 
> Address  bits
> 00 7  15 23 31
> 10 7  15 23 31
> 20 7  15 23 31
> 30 7  15 23 31
> 40 7  15 23 31


Consider the following program. The fact that you can get pointers to
arbitrary characers should be enough proof that the architecture is
byte addressable. (I don't know of any modern architectures that aren't
byte addressable, though MIPS takes some shortcuts in its various jump
instructions because the instructions have to be word-aligned.)

Now what can happen is that the computer crashes when dereferencing
the integer pointer, complaining that the access is unaligned -- the
addresses would still refer to individual bytes, but the computer
would crash if the two least significant bits were nonzero. MIPS
behaves this way, but since the following program works, you can see
that Intel doesn't even require word-aligned integer accesses.
(word-aligned integer accesses may be faster, but they don't require
special instructions to perform them).

And just to prove that the compiler isn't performing any funny
business, I included an assembly dump from this program.

#include 

int main(int argc, char** argv){
   char* mystring="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   int theint= *((int*)(mystring+1));
   printf("%x\n",theint);
}

$ ./test | xxd -r -p
EDCB


AMD64 assembly language:

.file   "test.c"
.section.rodata
.LC0:
.string "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
.LC1:
.string "%x\n"
.text
.globl main
.type   main, @function
main:
.LFB0:
.cfi_startproc
pushq   %rbp
.cfi_def_cfa_offset 16
movq%rsp, %rbp
.cfi_offset 6, -16
.cfi_def_cfa_register 6
subq$32, %rsp
movl%edi, -20(%rbp)
movq%rsi, -32(%rbp)
movq$.LC0, -16(%rbp)
movq-16(%rbp), %rax
addq$1, %rax  ; we're adding 1 to an address 
  ; for one character
movl(%rax), %eax  ; and here we're dereferencing it
  ; successfully
movl%eax, -4(%rbp)
movl$.LC1, %eax
movl-4(%rbp), %edx
movl%edx, %esi
movq%rax, %rdi
movl$0, %eax
callprintf
leave
ret
.cfi_endproc
.LFE0:
.size   main, .-main
.ident  "GCC: (Debian 4.4.4-5) 4.4.4"
.section.note.GNU-stack,"",@progbits

Intel 32-bit x86 assembly language:

.file   "test.c"
.section.rodata
.LC0:
.string "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
.LC1:
.string "%x\n"
.text
.globl main
.type   main, @function
main:
pushl   %ebp
movl%esp, %ebp
andl$-16, %esp
subl$32, %esp
movl$.LC0, 24(%esp)
movl24(%esp), %eax
addl$1, %eax   ; we're adding 1 to an address
   ; for one character
movl(%eax), %eax   ; and we're loading from that 
   ; address without a special instruction
movl%eax, 28(%esp)
movl$.LC1, %eax
movl28(%esp), %edx
    movl    %edx, 4(%esp)
movl%eax, (%esp)
callprintf
leave
ret
.size   main, .-main
.ident  "GCC: (Debian 4.4.4-5) 4.4.4"
.section.note.GNU-stack,"",@progbits



-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] boot failure with KDE

2010-06-14 Thread Chanoch (Ken) Bloom
On Sun, 2010-06-13 at 21:38 -0700, Thomas Johnston wrote:
> I am running Kubuntu 10.04 and I am no longer able to boot up as
> normal.  I make it to the login screen without any indication of a
> problem.  After typing in my user name and password, it continues to
> boot.  Normally the remaining boot sequence shows several icons
> appearing in the center of the screen; however, after the first icon
> appears the system now hangs.  After several minutes an error message
> pops up reading:
> 
> "The following installation problem was detected while trying to start KDE:
> No write access to $HOME directory (/home/thomas).
> KDE is unable to start."

I see you've tried fscking the drive to look for drive errors, but have
you tried looking to see whether an indiscriminate typo caused you to
change permissions on your home directory?

ls -l /home  and see whether you have write permission on /home/thomas
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] boot failure with KDE

2010-06-14 Thread Chanoch (Ken) Bloom
On Sun, 2010-06-13 at 23:51 -0700, Tony Cratz wrote:
> On 06/13/2010 11:47 PM, Thomas Johnston wrote:
> > after typing fsck /dev/sda1 I get the following:
> > 
> > "WARNING!!! The filesystem is mounted.  If you continue you ***WILL***
> > cause ***SEVERE*** filesystem damage.
> > Do you really want to continue (y/n)?
> > 
> > so I aborted.
> 
> 
>   umount /dev/sda1
>   fsck /dev/sda1

replace that umount command with

 umount -a
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] boot failure with KDE

2010-06-14 Thread Chanoch (Ken) Bloom
On Sun, 2010-06-13 at 23:20 -0700, Thomas Johnston wrote:
> update: I tried the failsafeX mode I mentioned in my last email and
> get the following error messages:
> 
> "Ubuntu is running in low-graphics mode.  The following error was
> encountered.  You may need to update your configuration to solve this.
> (EE) [drm] failed to open device
> (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not found)
> (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not 
> found)"

Do you get an actual graphics screen when you do that? I think that this
is the expected behavior when running in this mode, and I wouldn't worry
about it.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] inline keyword solves "undefined reference" issue

2010-06-09 Thread Chanoch (Ken) Bloom
On Wed, 2010-06-09 at 09:47 -0700, Jeff Newmiller wrote:
> Glad you fixed it okay.  After thinking about it for awhile, I think
> the inline keyword was simply masking the problem.  If you had not yet
> written any code that called new_video_stream,  then that method would
> not be instantiated in your object code, and the offending reference
> to av_new_stream would not be there needing to be resolved.
> 
> FWIW I recommend not modifying code from the ffmpeg C source to keep
> your C++ code better isolated from the C code.  If you follow this
> advice you should not need the ifdef at all, because the C compiler
> should never encounter the extern "C" syntax. 

I was going to suggest the same solution, but I couldn't figure out why
inlining the code made a difference. Thanks for explaining.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] how to find the self-installed libs?

2010-06-01 Thread Chanoch (Ken) Bloom
On Tue, 2010-06-01 at 23:41 -0400, Hai Yi wrote:
> Thanks to all for the helpful suggestions!
> 
> This is what I've done since after:
> 
> 1. I haven't figured out how checkinstall works, retry later...

You most definitely don't want to use checkinstall for this. You'll
probably break some other package that depends on the older version of
libx264.

If you're going to generate a debian package, then the best thing to do
is use "apt-get source" to download the source code for the version of
libx264 that's currently in Debian, and use uupdate to upgrade that
source package to the new upstream version. Build that package, and
install brand-new debian packages for the new version. (See the Debian
new maintainer's guide at http://www.debian.org/doc/maint-guide/ for
information on how this works.)

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] how to find the self-installed libs?

2010-05-31 Thread Chanoch (Ken) Bloom
On Mon, May 31, 2010 at 01:10:21PM -0700, Scott Miller wrote:
> On Mon, 2010-05-31 at 12:32 -0700, Jeff Newmiller wrote:
> > 
> > Configure scripts usually require -dev packages in order to work. 
> >
> Yeah you may simply need to install this:
> 
> libx264-dev
>
No, he doesn't need to install a -dev package, because he installed
from source in /usr/local. He needs to know how to force ffmpeg to
look in /usr/local.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] anything wrong with this code?

2010-05-27 Thread Chanoch (Ken) Bloom
On Thu, 2010-05-27 at 22:08 -0400, Hai Yi wrote:
> hi there:
> 
> can anyone look at these two small c++ snippets to see what's wrong
> with them? I was interviewed with them...
> 
> 1.
> A* createA(){ return new A();}
> void fun(){createA();}
> What's wrong with the above code?

It leaks memory.

> 2.
> for(iter=map.begin();iter!=map.end();iter++){
> erase(iter++);
> iter++;
> }
> anything wrong with the above code? What's happened for "iter++" internally?

 1. erase() is a member function of the map class. It is not a free
function. A free function named erase() wouldn't know what
container to erase the iterator from.
 2. The code only works if map.size() is a multiple of 3. If it
isn't, then one of the iter++ operations may try to put iter 2
or 3 past the end of the map. If you did this on a raw array, or
a vector (whose iterators are usually just pointers to the
elements, unless you're in some kind of debug mode),
  * then the standard doesn't guarantee that you can form
the address of the element 2 or 3 past the end of the
array, 
  * if you could form that address it would certainly no
longer be equal to array.end(), so you'd miss the
termination condition.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] ssd and swap

2010-05-26 Thread Chanoch (Ken) Bloom
On Wed, 2010-05-26 at 07:34 -0700, Scott Miller wrote:
> Anyone using an SSD? I've got one on the way to use as a boot drive,
> and am pondering not having swap at all. Is this crazy?
> 
> In the Windows world I see persons advising turning off the Windows
> page file when using an SSD.
> 
> I have a lot of ram: 8GB. :) But is it risky to not have a swap?
> Thanks for your input,

You'll want to allocate lots of swap if you plan on using suspend to
disk. (That's where Linux puts the RAM image on when you hibernate the
computer.)

Aside from that, I feel that swap is counterproductive if you have that
much RAM. I always advise people to have at least twice as much RAM as
the applications they *typically* use. I know that with 4 GB of RAM (and
a 500 MB typical working set -- I'm only using 250 MB right now), I
barely touch my swap, and may accumulate only a few megabytes of it over
the course of a day.

The time when I *do* touch swap is when I have some sort of memory leak
-- typically in a program I or one of my students wrote -- and the
computer allocates all of its RAM *very* quickly. In this case, having
swap only serves to make the computer completely unresponsive as the
computer marches toward having the out-of-memory process killer kill the
offending process. Without swap, the offending program would die after
consuming less RAM, and without wasting time swapping. (I know I should
use a ulimit to keep these programs under control, but I never remember
to set one until it happens to me. Then it's too late.)

(While people [1] will tell you that you should have swap since it
balances the VM algorithm, letting it put anonymous unused data on swap,
when the file-backed data it's caching is more valuable, but since I
never see that happen under normal circumstances, I don't think it's
worth it anymore.)

So IMO, swap is useless. If you can set up your computer without it,
more power to you.

--Ken

[1] http://sourcefrog.net/weblog/software/linux-kernel/swap.html,

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] man page for pthread_create

2010-05-22 Thread Chanoch (Ken) Bloom
On Sat, 2010-05-22 at 21:54 -0700, Brian Lavender wrote:
> I am missing the man page for pthread_create on Ubuntu 10.04. Anyone
> know in which package it is located?

manpages-posix-dev
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] logical operator precedence in C?

2010-05-22 Thread Chanoch (Ken) Bloom
On Sat, 2010-05-22 at 20:22 -0700, Brian Lavender wrote:
> in C. What is the order of precendence?
> 
> a || b || c && d || e || f
> 
> Is it just left to right?
> 
> brian

http://www.difranco.net/cop2220/op-prec.htm

&& has higher precedence than ||, so your expression is evaluted as 
a || b || (c && d) || e || f

Many other programming languages adopt C's precedence rules.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Looking for a Sunbird (Google Calendar) replacement

2010-05-12 Thread Chanoch (Ken) Bloom
On Wed, 2010-05-12 at 12:27 -0700, Brian Lavender wrote:
> On Wed, May 12, 2010 at 08:54:42AM -0500, Chanoch (Ken) Bloom wrote:
> > On Tue, 2010-05-11 at 22:10 -0700, Tony Cratz wrote:
> > 
> > Also, while searching Debian's apt repositories, I saw a package called
> > qorganizer. It appears that one of its saving graces is that it has a
> > very simple file format (that should sync well using git).
> > 
> > >   Now with all of that said (and what has been said before)
> > >   my ideal PIM is really more complex then what I have been
> > >   saying. Beside being iCal and Vcard base I would like to
> > >   be able to sync my laptop PIM with a PIM on my main server.
> > 
> > Use Funambol on your main server as a synchronization server, then use
> > SyncEvolution to synchronize events. You could also configure davical or
> > calendarserver as a CalDAV server, and configure evolution to talk to
> > that.
> 
> This Funambol looks interesting. Have you configured it? I am in the
> process of downloading the source. 

I downloaded a binary package of Funambol, and installed it in /opt. The
binary package is self-contained, so I start funambol
with /opt/Funambol/bin/funambol start and stop it
with /opt/Funambol/bin/funambol stop. I think that funambol's default
mode is to learn about its users automatically as they log in for the
first time. (There must be a way to turn that off if it poses a security
risk, but I don't know what that is.)

If you're using Debian the virtuoso-vad-syncml packages is another
SyncML server. I haven't used it myself, so I can't say anything about
it.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Looking for a Sunbird (Google Calendar) replacement

2010-05-12 Thread Chanoch (Ken) Bloom
On Tue, 2010-05-11 at 22:10 -0700, Tony Cratz wrote:

Also, while searching Debian's apt repositories, I saw a package called
qorganizer. It appears that one of its saving graces is that it has a
very simple file format (that should sync well using git).

>   Now with all of that said (and what has been said before)
>   my ideal PIM is really more complex then what I have been
>   saying. Beside being iCal and Vcard base I would like to
>   be able to sync my laptop PIM with a PIM on my main server.

Use Funambol on your main server as a synchronization server, then use
SyncEvolution to synchronize events. You could also configure davical or
calendarserver as a CalDAV server, and configure evolution to talk to
that.

Or use qorganizer and use git for synchronization. (I love git for
synchronization. If only everybody designed their file formats to
synchronize easily without requiring lots of work to resolve
conflicts...)

>   The main server PIM would handle most of the event reminders
>   for any client which currently has a live connection to
>   the main PIM. In the case where the laptop is away from the
>   main server it would handle the event reminders locally.

This level of intelligence is a tall order for any PIM with an offline
mode. If your PIM has an offline mode, then it's going to want to think
it's the only one that's available to remind you of each event. (Even on
the laptop.) I think when I was using KOrganizer/Kontact (in KDE 3) with
my PalmPilot, I solved this problem by just disabling the reminder
daemon (since PalmPilot would always remind me), but you need more
intelligence than that.

>   For both versions of the PIM I do not want to be forced to
>   use a web GUI. I really want a standalone GUI so my laptop
>   can be (as I'm calling it, as thin as possible. No
>   Apache/PHP|Perl|Ruby stack require. Just a standard Linux
>   program which can be started via the command line or the
>   menu via Gnome or KDE (with a very lite weight daemon
>   to handle events reminders).

Anything I've mentioned should be able to handle this (at least if it
can handle reminders).

>   Also as Rick mention I have seen a number of PIMs which
>   seem to bloat up and have creepy featurism. They start to
>   turn into a full E-mail client (such as Lightning/Thunderbird
>   and Evolution)

If you can ignore the mail component, is that such a problem?

> Also most are now moving toward web base requiring
>   a web server.

Not any of the ones I mentioned. (Evolution Data Server isn't a web
server -- I think it's either a DBUS or CORBA server that just acts as a
storage back end for the PIM on the local machine only. Akonadi, which
KOrganizer uses, is the same kind of DBUS server.)

> Myself I don't need to be able to store images
>   of a customer Gold Fish in my PIM. I also don't need to have
>   a 4 generation family history for a contact.

I don't know of any PIM that stores those things :)

>   I should also say, yes I know that if I have an address book
>   in my PIM I may/will desire to share it with the E-mail client
>   in the future. But the same could be said about a softphone.
>   To me the PIM should be the central core and the other clients
>   (E-mail, softphone, browser) should be able to query the PIM
>   database as needed. This would be a change of mind set from
>   the current method.

Then you either want the Kontact/Kmail/Kopete solution, or you want the
Evolution/Pidgin solution. (I don't think either of them can talk to
Skype, and I don't think either of them has a SIP phone application that
integrates with their data store.)

> 
>   BTW thanks for the discussion. I'm finding it helpful and I
>   hope others may also gain something from the discussion. At
>   present I'm not sure I will find the type of PIM I'm looking
>   for.


___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Looking for a Sunbird (Google Calendar) replacement

2010-05-11 Thread Chanoch (Ken) Bloom
On Sun, May 09, 2010 at 10:12:52PM -0700, Tony Cratz wrote:
> Hello:
> 
> 
>   I just updated today to Ubuntu 10.04 and found out the
>   Google calendar program Sunbird is no longer supported.
>   So I'm now looking for a replacement.
> 
>   I really like a standalone program and not a web base.
>   I also don't want it bundle with Evolution as I don't
>   use Evolution.
> 
>   Any suggestions?

Now that you've explained (elsewhere in the thread) that your concern
with Evolution is the email component, might I suggest having a look
at "dates", "contacts" and "tasks" which are very lightweight
PIM apps (really designed for small PDA devices -- I use it on my
Nokia 770). Their data store is the Evolution Data Server, so they're
fully interoperable with Evolution (they're basically another frontend
to the same data). For synchronizing to other places, you can use
SyncEvolution, which speaks SyncML. (I don't think Google calendar
supports synchronizing by SyncML yet, but there are a number of other
services that do.)

While I'm on the subject, why wouldn't Evolution work in offline mode,
without configuring email at all. Each of Evolution's different
functions (Tasks, Calendar, Notes, Contacts, Email) gets equal billing
in the interface -- they're all equally important citizens, so if you
don't want it to do email, you won't find that you're always starting
in email mode, or anything like that.

You might also consider KOrganizer.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] MTA

2010-04-29 Thread Chanoch (Ken) Bloom
On Thu, Apr 29, 2010 at 09:50:56AM -0700, Rick Moen wrote:
> Quoting Chanoch (Ken) Bloom (kbl...@gmail.com):
> 
> > The best thing to do is probably to install a lightweight non-daemon
> > mailer like esmtp-run so that programs that need it can still have
> > access to a sendmail command.
> 
> Note that esmtp is no longer being maintained, but may still be useful
> nonetheless.  I maintain a list of similar software, here:
> http://linuxmafia.com/faq/Mail/nullmailers.html

esmtp is the most capable in terms of outgoing encryption and
authentication (It's been a while, so I don't exactly remember the
details), so it's a good match for Google's SMTP servers which require
those.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] MTA

2010-04-29 Thread Chanoch (Ken) Bloom
On Thu, 2010-04-29 at 01:04 -0700, Richard Harke wrote:
> Not the MTA Charlie got stuck on. I'm running Debian and every recent
> (and maybe not so recent) install has installed exim4 as a Mail Transfer
> Agent. But is not clear that this is doing anything for me. I normally do 
> email
> through my ISP or in some cases through gmail. When I take my laptop
> out for coffee, it takes a really long time to decide to skip the MTA startup
> because it doesn't have internet access. Is there any reason I can't or 
> shouldn't
> disable it?

AFAICT, nothing important *depends* on an MTA, but several potentially
important pieces of software recommend it, including at and cron which
use it to notify of the output of their jobs.

The best thing to do is probably to install a lightweight non-daemon
mailer like esmtp-run so that programs that need it can still have
access to a sendmail command.

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Journal recovery on every reboot

2010-04-23 Thread Chanoch (Ken) Bloom
On Fri, 2010-04-23 at 09:21 -0700, Brian Lavender wrote:
> On Fri, Apr 23, 2010 at 10:49:47AM -0500, Chanoch (Ken) Bloom wrote:
> > OK. Poking around a bit more, innserv seems to be the
> > culprit. /etc/init.d/umountroot isn't getting run on shutdown, because
> > both /etc/init.d/halt and /etc/init.d/umountroot are getting the same
> > priority to start in runlevels 0 and 6 (i.e. S01halt, and
> > S01umountroot), so you can guess which one gets run first.
> 
> Did that fix it?

Yeah. I added Required-Start: $all to both /etc/init.d/halt
and /etc/init.d/reboot, and that fixed it.

This is Debian bug 549260. http://bugs.debian.org/549260

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Journal recovery on every reboot

2010-04-23 Thread Chanoch (Ken) Bloom
On Fri, 2010-04-23 at 08:33 -0700, Brian Lavender wrote:
> On Fri, Apr 23, 2010 at 09:03:05AM -0500, Chanoch (Ken) Bloom wrote:
> > My laptop (running Debian sid) running EXT-4 journal recovery on every
> > reboot, even when I shut down properly.
> > 
> > Any idea why this is happening, and how to fix it?
>
> I would think that the kernel unmounts the root file system at every
> shutdown, but I forget where that happens. 
> 
> I would start by running a rescue disk and attempting to mount and
> unmount it. Here are some ext4 commands including a tunefs command, but
> it is indicated for ext3 -> ext4 migration. 

I should clarify. It has nothing to do with ext3 -> ext4 migration,
unless the fstab is sensitive to it. The disk is ext3, and so the kernel
was detecting the drive as ext3 -- and when that happened, I got EXT-3
journal recovery on every reboot. So on the thought that maybe the fstab
was sensitive to that (and becasue I really would like the ext4 driver)
I added rootfstype=ext4 to my bootup options. It didn't fix the problem,
it just changed it from EXT-3 journal recovery to EXT-4 journal
recovery.
OK. Poking around a bit more, innserv seems to be the
culprit. /etc/init.d/umountroot isn't getting run on shutdown, because
both /etc/init.d/halt and /etc/init.d/umountroot are getting the same
priority to start in runlevels 0 and 6 (i.e. S01halt, and
S01umountroot), so you can guess which one gets run first.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Journal recovery on every reboot

2010-04-23 Thread Chanoch (Ken) Bloom
My laptop (running Debian sid) running EXT-4 journal recovery on every
reboot, even when I shut down properly.

Any idea why this is happening, and how to fix it?

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] loop never exits!

2010-04-22 Thread Chanoch (Ken) Bloom
On Wed, 2010-04-21 at 19:20 -0700, Matthew Van Gundy wrote:
> On 4/21/10 3:26 PM, Jeff Newmiller wrote:
> >> There are many ways to skin a cat, here's one:
> >>
> >> void reverse(int forward[], int backward[], unsigned int n) {
> >>unsigned i = n;
> >>while(i-->  0) {
> >>  backward[n-i-1] = forward[i];
> >>}
> >> }
> >
> > This reverses and then re-reverses it.
> 
> Nope, just reverses it once.  I'll admit, it isn't an idiomatic 
> construction, but it uses an unsigned index that counts down to reverse 
> an array since that's what Brian seemed to be after.

The most idiomatic construction in C for writing an iterator is to use
pointer arithmetic. i.e.

int* thearray;
size_t itssize;

for(int* iterator=thearray; iterator=thearray;--iterator){
  /* do something with the iterator */
}

The following idiom must be used instead:

int* iterator=thearray+itssize;
while( iterator-- > thearray){
  /* do something with the iterator. */
}

The asymmetry you're noticing with unsigned int indices is a similar
problem.

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Loop variants should be integers!

2010-04-21 Thread Chanoch (Ken) Bloom
On Wed, 2010-04-21 at 17:48 -0700, Brian Lavender wrote:
> So, I am switching my loop variants ("i" in this case) to integers. Here
> is convincing evidence. ;-)
> 
> http://archive.eiffel.com/doc/faq/variant.html
> 
> I recently met a guy at SacJUG who lived next door to Bertrand Meyer! He
> said he might be able to convince him to come and speak here in the
> Sacramento Area. Would that be cool or what?!!!
> 
> Of course, if I had used Eiffel for this program, I could have put an
> invariant condition on i, such that it is never less than zero greater
> than the number of elements in the array.
> 
> brian

This requires that they be integers as opposed to floating point
numbers. It doesn't require that they be signed ints (as opposed to
unsigned).

--Ken
(Who's TA'ing a class on this right now.)
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] time.h in Solaris

2010-03-23 Thread Chanoch (Ken) Bloom
On Tue, 2010-03-23 at 07:44 -0400, Hai Yi wrote:
> Hello, I am on a project that migrates applications from Solaris to
> Linux; most are Java but one is in C++. There is a log class including
> a , its a system header file in Solaris (might be in
> /usr/include, I don't remember), the question is, do we have a Linux
> counterpart? How can I handle this during the porting process?

time.h is a standard header file, mandated by the ISO C standard. It's
definitely available on Linux.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] how to separate e-mail spool file into individual messages?

2010-03-02 Thread Chanoch (Ken) Bloom
On Tue, 2010-03-02 at 18:13 -0800, Norm Matloff wrote:
> The title says it all.  I want a program x such that I can run something
> like
> 
> $ x /var/mail/mine
> 
> with the result that all the messages in /var/mail/mine get copied to
> individual files in the current directory.
> 
> My guess is that there is an easy answer.  Please let me know.

I think that you would use the inc command from mh.
http://www.faqs.org/faqs/mail/mh-faq/part1/ gives examples

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] error with g_printf

2010-02-23 Thread Chanoch (Ken) Bloom
On Mon, 2010-02-22 at 21:58 -0800, Brian Lavender wrote:
> rint.c:20: warning: implicit declaration of function 'g_printf'
> 
> I have include in my code.
> 
> #include 
> 
> What am I missing? It still runs.

#include 

http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] LINUX installation question windows Vista

2010-02-10 Thread Chanoch (Ken) Bloom
On Wed, 2010-02-10 at 13:09 -0800, Eric Lin wrote:
> On Wed, Feb 10, 2010 at 12:55:19PM -0800, Jason Snyder wrote:
> > how do you set up the external hard drive so that I can boot from it?
> 
> You connect the drive, pull up the bios boot order menu or enter bios
> setup, and change it to boot from USB. Make USB the first option in the
> boot order if you're using bios setup.
> 
> On my Dell, temporarily choosing the boot device is done by holding down
> F12 after turning on the computer. To change the boot order, I hold down
> F2, enter BIOS setup, and change the boot order.
> 
> Note that the computer won't actually boot from the USB device until you
> install an OS on it.
> 
> -Eric

You would need to put the CD Drive first (or have a USB thumb drive with
the installer on it), the USB drive second, and your hard drive third.

When you got to the appropriate place in the installer, you would be
sure to select to partition the USB hard drive and install Linux there. 

  * For Ubuntu, see
http://help.ubuntu.com/community/GraphicalInstall step 8 that
there will be a radio button for each disk that you can install
on to -- you'll want to chose the one that says USB, and is the
right size.

You'll will want to keep the boot order you set in the BIOS permenantly
(don't go into the BIOS setup to change it back) otherwise the computer
will want to boot Windows first and won't look for Linux.

With this setup, the computer will boot Linux whenever the drive is
plugged in (the boot menu may give you an option to boot Windows), and
it will go directly to Windows when the drive is not plugged in.

--Ken
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Size of long int?

2010-01-09 Thread Chanoch (Ken) Bloom
On Fri, 2010-01-08 at 23:00 -0800, Brian Lavender wrote:
> It seems that long int on 32 bit is 4 bytes on my 32 bit machines with
> gcc and on my 64 bit machine is 8 bytes.
> 
> There is no standard on long int, is there? 
> 
> #include 
> 
> int main()
> {
>printf("Size of int is %ld\n",sizeof(long int));
>return 0;
> }
> 
> 
> brian

We had a presentation about the AMD64 at LUGOD (in 1131 EUII as I
recall) when it was first coming out, and this was one of the points
they mentioned.

Typically, char is 8 bits, short is 16, and long are 32, and int is the
machine word size, though no standard guarantees any of this.
On x86 they made int 32bits wide for that reason.

On AMD64, they kept the normal int at 32 bits wide, and widened the long
to 64bits. 

If you need exact-sized types, look in , which defines
int8_t, int16_t, int32_t, int64_t,
uint8_t, uint16_t, uint32_t, uint64_t,
and other potentially useful variations (int_least#_t, and int_fast#_t)
that guarantee exact sizes, or minimum sizes (not to mention lots of
#defines for the limits)
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] MySQL question: making stats out of orders

2009-12-01 Thread Chanoch (Ken) Bloom
On Tue, 2009-12-01 at 22:33 -0800, Bill Kendrick wrote:
> On Wed, Dec 02, 2009 at 12:20:25AM -0600, Chanoch (Ken) Bloom wrote:
> > INSERT into orderstats(productid, date, orders)
> > SELECT
> >  orderitem.productid, orders.timestamp, SUM(orderitem.qty)
> > FROM orderitem
> >   JOIN orders ON orders.id = orderitem.orderid
> >   WHERE orders.timestamp >= { 90 days ago }
> > group by orderitem.productid, orders.timestamp
> > 
> > assuming orders.timestamp has one-day granularity
> 
> Timestamp is actually a timestamp (down the second).

Then you have to throw in a conversion function that truncates it to the
date in order for the `group by` to work correctly. I'm not sure what
function that is, but you can play around with the functions listed at 
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] MySQL question: making stats out of orders

2009-12-01 Thread Chanoch (Ken) Bloom
On Tue, 2009-12-01 at 22:14 -0800, Bill Kendrick wrote:
> > It would seem pretty simple to create the analagous table for orders:
> > 
> > orderstats consisting of productid, date, orders
> > 
> > and every time you complete an order, you run the query:
> > 
> > insert into orderstats(productid, date, orders) VALUES (###, NOW(),
> > QTY) on duplicate key update orders=orders+QTY
> 
> Yes, that's great for today-on, but the moment I switch to using this
> new way of recording purchases, there won't be any data.
> 
> That is, unless I start collecting data for the next 90 days BEFORE
> changing how the "top sellers" are determined.
> 
> What I'm looking for is a way to populate a new 'order stats' table
> based on the [last 90 days', or whatever, of] existing orders.

The one time command to fill the orderstats table for the first time
would be

INSERT into orderstats(productid, date, orders)
SELECT
 orderitem.productid, orders.timestamp, SUM(orderitem.qty)
FROM orderitem
  JOIN orders ON orders.id = orderitem.orderid
  WHERE orders.timestamp >= { 90 days ago }
group by orderitem.productid, orders.timestamp

assuming orders.timestamp has one-day granularity

T

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] MySQL question: making stats out of orders

2009-12-01 Thread Chanoch (Ken) Bloom
On Tue, Dec 01, 2009 at 05:32:20PM -0800, Bill Kendrick wrote:
> 
> Ok, so I've got a few queries our website does that
> are used to determine which products are 'top sellers'
> in the past 90 days' worth of sales.
> 
> Right now, this involves joining the product table
> with the orders table, by way of an items-in-the-order table.
> 
> In other words, to figure out what sold the best in the
> last 90 days, it's something like:
> 
>   SELECT * FROM products
>   JOIN orderitem ON products.id = orderitem.productid
>   JOIN orders ON orders.id = orderitem.orderid
>   WHERE orders.timestamp >= { 90 days ago }
> 
> As time goes on, our records or orders, order items, and
> actual products all keep growing.  That means this task
> gets more and more intensive.

Is this task getting more intensive? If is (and the number of
transactions per day hasn't grown significantly), then you probably
don't have indices set up correctly.

I think that having an an index on orders.timestamp,
and an index on orderitem.orderid (in addition to the primary keys
products.id and orders.id) should optimize this query, but it always
pays to determine what's going on with EXPLAIN SELECT.

If that still doesn't speed things up enough, maybe consider using a
table with the MERGE storage engine to move old entries from the
orders table and the orderitem table into archives. Then only query
the table full of recent order data for queries, and only query the
other tables in the merge when you need to.

> Now, we've got some statistics tables set up for other
> purposes -- how many times a product was viewed,
> as well as when any particular logged-in-users last
> visited particular items, which allows us to do the
> "people who recently looked at X also recently looked at Y".
> 
> I'm thinking we could do something similar for sales,
> to simplify the "top sellers" queries.  They'd hit
> a single stats table (which could, on a daily basis,
> be cleared of any >90-days-ago entries), rather than
> having to JOIN two large tables that go back to day 1.
> 
> 
> My current problem -- no doubt due to lack of brain power
> at the end of the day -- is how to take the CURRENT data
> from the orders and orderitem tables so that I can do an
> initial population of a new stats table.
> 
> Our "views" stats table, for example, is something
> along the lines of:
> 
>   productid, date, views
> 
> where those first two columns act as a key.  (Date is at the
> 'day' level of granularity.)
> 
> 
> And we count a view like so:
> 
>   INSERT INTO views (productid, date, views) VALUES (###, NOW(), 1)
>   ON DUPLICATE KEY UPDATE views=views+1
> 
> In other words, the first time a product is viewed on any given day,
> we insert a new row, otherwise we update its existing row.
> 
> 
> Anyone feel like flexing their MySQL muscles and provide some
> ideas on how to populate a similar table (tracking sales) based
> on the orders/orderitem table combo explained above?

I'm not really clear on what you're looking for here. We need a better
idea of what stats you're running to know how to structure the table.

It would seem pretty simple to create the analagous table for orders:

orderstats consisting of productid, date, orders

and every time you complete an order, you run the query:

insert into orderstats(productid, date, orders) VALUES (###, NOW(),
QTY) on duplicate key update orders=orders+QTY

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Most efficient way to wipe hard drives

2009-09-10 Thread Chanoch (Ken) Bloom
On Thu, Sep 10, 2009 at 09:56:54AM -0700, Brian Lavender wrote:
> On Wed, Sep 09, 2009 at 09:20:30PM -0700, Bill Broadley wrote:
> > 
> > Short answer, one wipe is enough (At least for NIST, and one of the British
> > Infosec standards), wipes miss bad sectors, the ATA secure erase command is
> > worth checking out.
> [snip]
> I think caching is a concern on some systems, so more wipes seems to
> magically make the write go to the actual media. But I would agree with
> one wipe is probably enough. I had not thought about bad blocks. 
> 
> > 
> > So if you don't use secure wipe and won't lose sleep at night over a few bad
> > blocks being potentially recovered I'd recommend something like:
> > 
> > dd if=/dev/urandom of=/dev/sd
> 
> Your computer must have a lot of entropy! Note that that device gathers
> entropy from the system. When an event happens, it may be worth one or
> two bits. Last time I wrote a program that read from that device, it
> seemed that I got a number of bytes, and then I had to wait as various
> events occured to the system. That is why they often tell you to move the
> mouse around when generating keys. It generates entropy for the system.

/dev/random, blocks waiting for entropy.
/dev/urandom doesn't wait for entropy. It uses entropy if it's
avalable, and switches to a PRNG if there isn't enough entropy. I
think it's similar to what you suggest doing with AES.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] libstdc++ and sgi and hp?

2009-09-01 Thread Chanoch (Ken) Bloom
On Tue, Sep 01, 2009 at 09:56:40AM -0400, Hai Yi wrote:
> it seems to me Stepanov is good at convincing people so that he was
> able to push his ideas and make his marks no matter where he was,
> hehe.

Well, I've definitely looked at the HP STL, and the SGI STL, and SGI's
definitely has some differences and SGI's version matches the
standard, there's no question that at some point the cutting edge work
on the STL moved from HP to SGI. The only question was why. When I
read in one of Stepanov's interviews that he was part of the SGI
group, I understood why.

Having a project like this follow its creator from company to company
is actually not so unusual.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


signature.asc
Description: Digital signature
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Window Managers

2009-04-22 Thread Chanoch (Ken) Bloom
On Wed, 2009-04-22 at 11:31 -0700, Brian Lavender wrote:
> 
> Dumb question. How do you have [X] ignore Alt-Tab?

It's not X that intercepts the Alt-Tab. It's your window manager. So it
will depend on which window manager you're using.

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Blu-ray: How crazy would I be if...

2009-04-21 Thread Chanoch (Ken) Bloom
On Tue, Apr 21, 2009 at 08:32:38AM -0700, Chris Jenks wrote:
> 
> On Mon, 20 Apr 2009, Peter Jay Salzman wrote:
> 
> > I *really* want disk storage that's larger than 4.7GB.
> >
> > I've been looking at Blu-ray, and thought maybe it's worth investigating.
> 
>Maybe I've been extremely unlucky, but I've found optical media to be 
> extremely unreliable when the whole disk has to read perfectly. It may be 
> OK to have a few frames missing from a movie, but even just yesterday I 
> had to finish an Ubuntu install by hand because the desktop files were 
> corrupted on the CD.
> 
>You could get 9GB by going to dual layer DVD, but I would recommend 
> using USB hard drives for your storage. The cost should be no more than 
> ten cents/GB (about the same cost as blu-ray), but it should be much more 
> reliable and more versatile too since you can rewrite. I just bought a 
> 1.5GB USB drive at Fry's for $129 with no rebate. You could probably save 
> slightly more by using an enclosure and internal SATA drives for storing 
> data.

I hope you mean a 1.5TB USB drive.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


signature.asc
Description: Digital signature
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] tags with mutt

2009-04-21 Thread Chanoch (Ken) Bloom
On Tue, Apr 21, 2009 at 07:19:14AM -0700, Gandalf  Parker wrote:
> On Mon, Apr 20, 2009 at 11:31:32PM -0700, Mike Simons wrote:
> > > 
> > > Is there a way to use tags with email and mutt?
> > 
> > First search, using mutt's limit "l" command you can filter a 
> > folder based on most anything ... header searches are fairly fast.
> 
> Thanks for this. This is something I should try. I havent been using
> tags because other than the spam tag I saw no use for it. But now I
> think I do.
> 
> > Searching on headers was the easy but adding/deleting tags from
> > messages seems to requires a little elbow grease.
> > 
> > Hunting through the manual, I didn't see an obvious way to update
> > any specific mail headers.  However there are ways to edit the whole 
> > message ... and ways to switch the editor ... so we'll combine those.
> 
> I have to say Im really surprised at this from this group. Usually
> everything is over my head. But on the subject of presort and
> handling of mail I thought that the standard answer was always
> procmail. It seems as though every ISP forum or gaming group Ive
> been in where the question came up that was always the answer.
> Something like "you can do your own but procmail is almost always
> available so why"
> 
> Procmail is even part of the instructions of many spam handlers and
> game processors for turn files. As in "turn on procmail handling
> then include these 4 lines in your procmailrc file. I think its even
> part of default installation on many linux altho I dont have a way
> of checking that.

I personally feel that Procmail is a tad verbose, requiring 4 lines
per email address to filter a message, and some kinds of conditional
logic are difficult. So I use Ruby's 'rfilter' package, and have a
filter that looks much more compact:

  if from =~ /messa...@frumster.com/
saveto ".shidduchim" if subject =~ /sent you a message/i
saveread ".shidduchim"
  end
  if from =~ /supp...@sawyouatsinai.com/i
saveto ".shidduchim" if subject =~ /You have received/i
saveread ".shidduchim"
  end
  discard if from =~ /offers.s...@sawyouatsinai.com/i
  discard if from =~ /adverti[sz]eme...@sawyouatsinai.com/i

  saveto ".lists.admin" if from =~ /lists...@shamash.org/i
  saveto ".lists.admin" if header["X-List-Administrivia"] == "yes"

  if from =~ /a...@aclweb.org/
message.header.subject=subject.sub('[na_memb...@aclweb.org] ','')
saveto ".lists.ACL"
  end
  saveto ".lists.ACL" if from =~ /rasmu...@cs.rutgers.edu/
  saveto ".lists.ACL" if from =~ /carla...@mccsis.org/
  saveto ".lists.ACL" if from =~ /aha...@mac.com/
  saveto ".lists.AppraisalAnalysis" if listid =~ 
//
  saveto ".lists.AppraisalAnalysis" if listid =~ 
/SentimentAI.yahoogroups.com/

  saveto ".lists.linux" if listid =~ /.*vox.*lugod/
  saveto ".lists.linux" if listid =~ /bad.bad.debian.net/
  saveto ".lists.linux" if listid =~ /luni.luni.org/
  saveto ".lists.linux" if listid =~/vcs-home.lists.madduck.net/
  saveto ".lists.linux" if listid =~ /chicagolug.org/

(I think I tried perl first, but in perl the @ does variable interpolation.
Mind you the . in my regular expressions matches any character, but I've never
really had a problem leaving it unescaped)

> It was such a common answer that I drug my feet for a long time
> before looking into it (I tend to hate the pat answers). Once I did
> it got kinda fun. Like many linux programs it goes more for power
> than ease of use. It allows you to do pretty much anything you want
> in pre-handling mail but that can be confusing. Lots of googling
> required.
> 
> I see lots of examples for procmail snippets to do tags. Mostly as a
> way to presort spam. Checking for various subject lines or IP groups
> it comes from or words in the body, tagging it by changing one of
> the headers to add a tag like SPAM to the subject or an x-header,
> then letting it continue into your mailbox for your mail program to
> handle.
> 
> Gandalf  Parker
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


signature.asc
Description: Digital signature
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Window Managers

2009-04-21 Thread Chanoch (Ken) Bloom
On Tue, Apr 21, 2009 at 07:47:16AM -0700, Rod Roark wrote:
> I have a hosted server running Ubuntu 8.04 and would like to install
> a simple, lightweight window manager for use with VNC.  Mostly this
> is so I can conduct shared sessions for working with others.  Ideally
> it would be reasonably intuitive for those familiar with Windows,
> Gnome or KDE.
> 
> Problem is, there are too many choices!  aewm, blackbox, evilwm,
> flwm, fvwm, icewm, jwm, lwm, metacity, tinywm, twm, and more.
> 
> I tried twm and metacity so far.  twm is ugly.  metacity is nice but 
> doesn't do much by itself (e.g. no task bar or launcher), and adding
> gnome-panel or gnome-control-center brings in a whole bunch of stuff
> that I don't want or need.

I think fluxbox, blackbox, or openbox is probalby what you need. Nice
tiny taskbar, simple customizable menu when you right-click on the
desktop for launching things (and Debian and Ubuntu fully stock the
menu thanks to their menu system), and relatively standard overlapping
windows, with enough customization of behavior to accomodate pretty
much any other window manager you might be used to (e.g. focus policy,
click-to-raise and the like.)

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


signature.asc
Description: Digital signature
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] tags with mutt

2009-04-18 Thread Chanoch (Ken) Bloom
On Sat, 2009-04-18 at 17:46 -0400, Peter Jay Salzman wrote:
> FireFox and GMail have sort-of recently (past year) converted me from the
> directory paradigm to the tag paradigm.
> 
> Is there a way to use tags with email and mutt?
> 
> I might be able to roll my own system if there's a convenient way to add a
> header line to the email (I'd rather not do control-E and hand write the
> header line -- after all, tagging is to increase efficiency/convenience).
> 
> Is there a way to maybe type control-t, then type something like
> "linux,email,tags" and have the header
> 
>X-tags: linux, email, tags
> 
> added to the headers?
> 
> Then when I delete, I can probably use some kind of hook to save the
> email-to-be-deleted to a backup file.
> 
> Maybe an email tagged as "spam" could be auto-fed into bogofilter and
> deleted without backing it up...

http://madduck.net/blog/2006.09.08:mutt-tagging/ discusses this problem.
He hasn't found a perfect solution yet, but he says that
http://www.steve.org.uk/Software/mutt-tagging/ comes close.

I think an even better solution might be to create a LUFS filesystem to
expose a single mail directory as a collection of directories
representing tags, and to propagate updates automatically, but I don't
care enough to build such a thing. The plus side of this solution would
be that it would work with any mail client, and you could even expose
the results via an IMAP server.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Fwd: Trouble installing Matlab in Debian

2009-04-08 Thread Chanoch (Ken) Bloom
On Wed, 2009-04-08 at 11:09 -0700, Bill Kendrick wrote:
> Date: Wed, 8 Apr 2009 07:26:52 -0700
> From: Thomas Johnston 
> Subject: Trouble installing Matlab in Debian
> To: vox-tech@lists.lugod.org
> 
> I attended the LUGOD social gathering yesterday evening and
> some of the members suggested I pitch my question here.
> 
> I converted to Linux (Debian lenny) about 1 week ago and attempted to
> install Matlab.  I have an ISO of the Matlab CD on my hard drive.  I
> mount the ISO and attempt to install the software by issuing the
> command:
> 
> sh install
> 
> The error that is generated reads:
> 
> An error status was returned by the program 'xsetup', the X Window
> System version of 'install'. The following messages were written to
> standard error:
> 
> No protocol specified
> Can't open display.
> 
> Attempt to fix the problem and try again.  If X is not available or
> 'xsetup' cannot be made to work then try the terminal version of
> 'install' using the command:
> 
> install* -t or INSTALL* -t
> 
> Sorry! Setup aborted ...
> 
> 
> yes, the install attempt was done while under root.  I could a
> relevant fix via a Google search nor in the archived tech messages on
> this mailing list.
> 
> Thanks in advance,
> 
> Thomas
> 
> "Speak slowly, I am windows user."

What command are you using to become root?

If you're using su to become root, this is a common problem. X11 uses a
"magic cookie file" to determine who's allowed to access the screen.
Programs read the magic cookie file, and if they present the right
contents to the X server, they're allowed to communicate with the x
server. The location of the magic cookie file is determined by an
environment variable. When you su to root, su wipes out the environment
variables, causing the installer to not know where to find the magic
cookie. Thus, you're denied access to the x server, and the installer
prints out the error "No protocol specified"

There are several solutions, and I'm not sure which ones are configured
to work correctly on a default debian install.

First, I think there's a difference between "su" and "su -". One
sanitizes the environment to mimic a brand new login, and the other does
not. I don't remember which is which, so if you were doing one, try the
other.

You can ssh to the machine as root, by running "ssh -X r...@localhost",
which should act almost identically to running "su -", but the -X option
gives you X11 forwarding (really cool when you're dealing with other
machines), which will let the installer work. (This depends on the ssh
server having X forwarding enabled, and I don't remember if that's the
debian default. Years ago, when I first installed my desktop machines,
it wasn't.)

You can use sudo to run the installer. ("sudo sh install") If sudo is
configured to allow you to do this, then it should get X11 forwarding
correct.

You can log out from whatever user you are right now, and log in as
root. (Not recommended in this day an age, but it's always good as a
last resort.)

Install "sux" (apt-get install sux), then use sux to become root. It
should work just like su, but get the X11 stuff right.

I'm going to be away from the keyboard for the next few days, maybe a
whole week, so if you have followup questions and want a timely answer,
direct them to vox-tech, not to me.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] [OT] Math question: help me make a rainbow

2009-04-01 Thread Chanoch (Ken) Bloom
On Wed, 2009-04-01 at 20:19 -0700, Bill Broadley wrote:
> Bill Kendrick wrote:
> > On Wed, Apr 01, 2009 at 10:37:37AM -0700, Harold Lee wrote:
> >>Not sure if the formulas you've set out do this, but couldn't the 
> >> rainbow
> >>tool treat the difference between y coordinates as depth, the way that 
> >> the
> >>grass tool does? When y1 == y2, you get a semi-circle with the height ==
> >>1/2 * abs(x2 - x1), i.e. the radius. Otherwise you get a rainbow with a
> >>wider base at the point closer to the bottom of the screen that arcs 
> >> back
> >>to the other point.
> > 
> > Neat idea, but I worry about kitchensinkness. :)
> 
> How about doing it like xfig, it's really simple just 3 clicks, lets you do
> any kind of arc as you want, I can try it out on my 4 year old if ya want.
> 

He uses the drag-click for the shape tool (drag to set the size and
aspect ratio, click afterwards to set the rotation), so he could use a
drag to set the end points, and a click to set the intermediate point
that the circle has to pass through. Fitting these points to a circle
would be pretty easy [just solve (x-x')^2+(y-y')^2=r^2 for x', y', and
r]. Note that xfig probably uses quadratic splines instead of circles
for their curve tool.

If he wants to make the thickness configurable, he could introduce the
size slider used for the stamp tool for that.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Insomniac laptop (was Hard drive dying?)

2009-02-26 Thread Chanoch (Ken) Bloom
On Thu, 2009-02-26 at 08:54 -0800, Wes Hardaker wrote:
> > On Wed, 25 Feb 2009 14:32:16 -0800, Bill Kendrick  said:
> 
> BK> Yes, this laptop has the habit of heating up, esp. when it's closed.
> BK> (i.e., I'm not even interacting with it!)
> 
> They're really not designed to run with the lid closed (ever).
> 
> I actually had a co-worker that shut their lid and thought it slept and
> put it into their backpack and walked around for an hour.  It was
> "blazing hot" when they pulled it out and amazingly didn't have any
> problems.

I unfortunately have such an insomniac laptop. I think that it's likely
that the lid button is too sensitive to bumps, and would like to know if
there's a way to work around this in software. (e.g. if the computer
wakes up to find that the lid button is closed, put the computer back to
sleep automatically.)

Any tips?

--Ken

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Help with USB Hard drive

2009-02-20 Thread Chanoch (Ken) Bloom
On Fri, 2009-02-20 at 11:49 -0500, ALLO (Alfredo Lopez De Leon) wrote:
> Hi,
> Thank you very much for all your answers.  After testing some of your
> suggestions I "discovered" that It is after all a USB drive and as
> root I have to umount it before logging out so the other users can
> mount it and use it...
> 
> Too bad USB drives do not behave like "real attached drives".  Well.
> Like the Rolling Stones would say: You can't always get what you want.
> 
> Have a nice one!
> 
> Alfredo

That's an assumption the operating system makes because most USB drives
are thumb drives and the like, single-user disks that come and go. You
can change that, though.

Create a rule to identify the device uniquely in udev and to assign it a
permenant device node (I can't tell you exactly how to do this, it will
depend on being able to find something like a serial number that udev
can use to identify it.), then add that device node to /etc/fstab, with
appropriate mount options.

Just out of curiousity, what's the block size (the size occupied by a 1
byte file) on a 1 TB fat32 drive?

--Ken

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] powersupply + capacitor whine when CPU is idle

2009-02-16 Thread Chanoch (Ken) Bloom
On Mon, 2009-02-16 at 13:52 -0800, jim wrote:
> 
>i've never heard capacitors make noise and am 
> interested to know if that happens. my guess is 
> the noise is coming from a fan, either in the 
> power supply itself, or in the case, or on the 
> heatsink of the CPU, or 


Capacitor whine is real. Look at
http://en.wikipedia.org/wiki/Capacitor#Instability_of_capacitance

"Capacitors, especially older components, can absorb sound waves
resulting in a microphonic effect. Vibration moves the plates, causing
the capacitance to vary, in turn inducing AC current. Some dielectrics
also generate piezoelectricity. The resulting interference is especially
problematic in audio applications, potentially causing feedback or
unintended recording. In the reverse microphonic effect, the varying
electric field between the capacitor plates exerts a physical force,
moving them as a speaker. This can generate audible sound, but drains
energy and stresses the dielectric and the electrolyte, if any."

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Automatic wifi settings on boot?

2009-02-04 Thread Chanoch (Ken) Bloom
On Wed, 2009-02-04 at 10:56 -0800, Bill Kendrick wrote:
> Is there an easy way to get a Linux laptop to connect to one of
> a number of wireless networks, based on which ESSID it sees?
> 
> Last time I checked (kernel has upgraded since), my wifi gets kind of
> finicky if it tries to connect to a WAP that isn't there.
> (e.g., if I leave my home WAP, which requires a key, in
> /etc/network/interfaces but then go boot up at Mishka's or Common Grounds,
> it seemed like I needed to alter 'interfaces' and then do a reboot to
> ever get it to work... just running 'sudo /etc/init.d/networking restart'
> didn't seem enough.)

`/etc/init.d/networking restart` is a bit drastic a hammer for just
about anything dealing with network interfaces. Use the `ifup` and
`ifdown` commands instead.

--Ken

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Automatic wifi settings on boot?

2009-02-04 Thread Chanoch (Ken) Bloom
On Wed, 2009-02-04 at 10:56 -0800, Bill Kendrick wrote:
> Is there an easy way to get a Linux laptop to connect to one of
> a number of wireless networks, based on which ESSID it sees?
> 
> Last time I checked (kernel has upgraded since), my wifi gets kind of
> finicky if it tries to connect to a WAP that isn't there.
> (e.g., if I leave my home WAP, which requires a key, in
> /etc/network/interfaces but then go boot up at Mishka's or Common Grounds,
> it seemed like I needed to alter 'interfaces' and then do a reboot to
> ever get it to work... just running 'sudo /etc/init.d/networking restart'
> didn't seem enough.)
> 
> Once upon a time, I tried providing various interface variations in
> /etc/network/interfaces (e.g., "eth1-home", "eth1-mishkas")
> but either did it wrong, or it didn't work. :)
> 
> Any tips or links to good howtos?  (This is on ubuntu 8.10 btw)

Install wpa_supplicant, set up the networks
in /etc/wpa_supplicant/wpa_supplicant.conf, then set
up /etc/network/interfaces to use wpa_supplicant. This doesn't make it
easy to connect to a new random network at-will (without root
privelages), so you have two tricks:

I have created two pseudo-interfaces "any" and "specified".
  * `ifup wlan0` will use wpa-supplicant to connect to any network
specified in wpa_supplicant.conf.
  * `ifup wlan0=any` will tell the kernel to connect to the
strongest open access point that it can see.
  * `iwconfig wlan0 ...; ifup wlan0=specified` (replacing ... with
whatever options you want for this specific connection) will
prevent ifup from overriding manual settings that I've specified
with the wlan0 command
Since your user needs sudo access to ifup and ifdown in this
configuration, you can also install wpa_gui and give your user access to
that for identifying other connections.

None of this is secure as NetworkManager, so you may want to use that
instead, but I've found my method to be more convenient and reliable,
and I have sudo access to anything on my laptop anyway. 

$ cat /etc/wpa_supplicant/wpa_supplicant.conf 
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=netdev

eapol_version=1
ap_scan=1
fast_reauth=1

network={
   ssid="kenapt"
   key_mgmt=NONE
   auth_alg=SHARED
   wep_key0=1234567890
   priority=5
}

network={
   ssid="iit"
   key_mgmt=NONE
   priority=5
}


$ cat /etc/network/interfaces 
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

iface wlan0 inet dhcp
   wpa-driver wext
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface specified inet dhcp

iface any inet dhcp
   wireless-essid any
   wireless-key open



-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Kernel not seeing all my RAM

2009-02-04 Thread Chanoch (Ken) Bloom
On Tue, 2009-02-03 at 23:49 -0800, Bill Broadley wrote:
> Chanoch (Ken) Bloom wrote:
> > On Tue, 2009-02-03 at 10:28 -0800, Bill Broadley wrote:
> >> Chanoch (Ken) Bloom wrote:
> >>> I'm upgrading an x86
> >> Not x86-64?
> > 
> > There's two machines with this problem. One is really an x86. The other
> > is an amd64, but it's running a totally 32-bit system since it shares
> > home directories by NFS with the first machine (and a couple other
> > 32-bit only machines).
> 
> There is no problem use a 64 bit NFS server and a 32 bit NFS client.

No there isn't, but when people are compiling binaries for one it can
can become confusing if they log in on the other and things don't work.

> > With regard to the amd64, I'd like to have it run a 64-bit kernel with a
> > 32-bit userspace
> 
> Why?  Things like mplayer (with a bunch of codecs), flash, java plugin, dvd
> playback, video encoding, etc "just work".  I've not seen any problems with
> google earth 5.0, picasa, firefox (with plugins), etc.
> 
> >, but the machines are running Gentoo, and I don't know
> > how to do that in Gentoo.
> 
> Unless recently I always installed 32 bit machines for anything with any sort
> of desktop duty.  I didn't want a chroot, didn't want to main two
> environments, didn't want alot of extra hassle... not to mention 4 or more GB
> of ram is pretty pricey.  These days 4GB ram cost $50 or so, things are much
> more mature.
> 
> > (I'm looking at switching these machines to Debian in the long run, and
> > I'll probably start testing that on one machine after lenny is released
> > in a couple weeks, so in the long run I may not need to solve the
> > kernel/userspace thing in Gentoo.)
> 
> I've heard of folks running hybrid with debian, personally I'm running ubuntu
> and it keeps me happy I was 100% redhat er, umm, for almost a decade.
> 
> > So you're saying that a 32-bit kernel will map devices in into the 4GB
> > address space in such a way that they hide physical RAM, regardless of
> > whether you're using CONFIG_HIGHMEM4G or CONFIG_HIGHMEM64G, and that a
> > 64-bit kernel will map devices differently. Is this right?
> 
> Er.  You are seeing 3GB or so of ram because some devices like video cards
> take memory in the bottom 4GB by default, some PCI devices can only address
> memory in the bottom 4GB.  There are various approaches to handling this,
> linux supports bounce buffers so an I/O device can write to the lower 4GB,
> then the kernel copies it to wherever user space expects it (which can be
> above or below 4GB).  PAE is definitely required, as Cam mentioned I'd try the
> HIGHMEM4G first.  If that doesn't work see if the BIOS mentions anything, then
> if that doesn't work try the 64G setting.
> 
> Unless of course you just want to upgrade to a 64 bit kernel.
> 
> > The definition is probably "Machine Register Size". Pointers, ints, and
> 
> Which registers?  Int?  Floating point?  SSE?

General registers, which are typically used for addresses and ints.

> > addressable memory should go along for the ride because it's convenient
> 
> Addressable memory isn't a particularly good one, after all the last 5
> generations or so of intel chips could address 64GB, but only had 32 bit
> pointers (4GB worth).

Sorry. I meant the memory addressable by a userspace process.

> > to do it that way, but note:
> >   * an int on amd64 gcc is 32 bits. It's a long that's 64 bits.
> 
> Indeed... although that's a language thing more than anything else.  GCC also
> supports 128 bit floats (long double), but that doesn't really say anything
> about the hardware.
> 
> >   * The DOS memory model (*sticks out tongue*) used 16-bit pointers
> > on 16-bit processors, but addressed 1MB of RAM by the use of a
> > segment register to choose which "paragraph" of memory pointers
> > would refer to.
> 
> Right, much like PAE.  Instead of a segment register they play tricks with the
> page tables.  Hopefully 64 bit pointers will prevent any new hacks in there
> area.  Lets so most system max out at around 8 Dimms.  2^64 bytes/8 = 2^61
> bytes.  So until something bigger than 2048 Petabyte dimms become common we
> should be safe.  Maybe then ZFS will makes sense ;-)

As I said above, I was referring to process-addressible memory. PAE is
an issue clearly confined to kernel space. The DOS memory model was in
what passed for userspace.

--Ken

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Kernel not seeing all my RAM

2009-02-03 Thread Chanoch (Ken) Bloom
On Tue, 2009-02-03 at 10:51 -0800, Bill Broadley wrote:
> Cam Ellison wrote:
> > Chanoch (Ken) Bloom wrote:
> >> I'm upgrading an x86 machine to 4 GB of RAM, and have compiled the
> >> kernel with CONFIG_HIGHMEM64G=y, but the kernel is only seeing 3283 MB
> >> of the RAM. Any idea what I'm doing wrong?
> >>
> >>   
> > 
> > You should use the 4GB setting, I think.  The 64G setting is for a 
> > 64-bit processor, and you appear to have a 32-bit.
> 
> Actually, I believe not.  The whole number of bits thing is rather confusing.
>  Is it the memory bus width?  Size of floating point?  Ints?
> Pointers/directly addressable ram?  Maximum addressable memory (ram)?
> 
> Actually the "32-bit" intels (back at least to the P Pro) can address around
> 36 bits of memory via a hack, but only 4GB per process.  But the kernel could
> have 4GB and any single process could have 4GB, so on a large 32-bit server
> might have 16GB ram and allow for numerous processes to run as long as the
> total does go over 16, and any single process doesn't go over 1GB.  The config
> description should for CONFIG_HIHMEM64G should mention PAE or similar.
> 
> Oh, as for the questions above:
> * it's not the memory width, 64-128 bits has been quite common for CPU
>   generations, currently it's often 192-256, and in a few weeks 384.
> * Floating point has been 64 bits for CPU generations
> * Ints aren't a bad approximation
> * Pointers aren't a bad approximation
> * addressable memory isn't

The definition is probably "Machine Register Size". Pointers, ints, and
addressable memory should go along for the ride because it's convenient
to do it that way, but note:
  * an int on amd64 gcc is 32 bits. It's a long that's 64 bits.
  * The DOS memory model (*sticks out tongue*) used 16-bit pointers
on 16-bit processors, but addressed 1MB of RAM by the use of a
segment register to choose which "paragraph" of memory pointers
would refer to.

--Ken

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Kernel not seeing all my RAM

2009-02-03 Thread Chanoch (Ken) Bloom
On Tue, 2009-02-03 at 10:28 -0800, Bill Broadley wrote:
> Chanoch (Ken) Bloom wrote:
> > I'm upgrading an x86
> 
> Not x86-64?

There's two machines with this problem. One is really an x86. The other
is an amd64, but it's running a totally 32-bit system since it shares
home directories by NFS with the first machine (and a couple other
32-bit only machines).

With regard to the amd64, I'd like to have it run a 64-bit kernel with a
32-bit userspace, but the machines are running Gentoo, and I don't know
how to do that in Gentoo.

(I'm looking at switching these machines to Debian in the long run, and
I'll probably start testing that on one machine after lenny is released
in a couple weeks, so in the long run I may not need to solve the
kernel/userspace thing in Gentoo.)

> > machine to 4 GB of RAM, and have compiled the
> > kernel with CONFIG_HIGHMEM64G=y, but the kernel is only seeing 3283 MB
> > of the RAM. Any idea what I'm doing wrong?
> 
> Nothing.  It's up to the motherboard to remap memory reserved for I/O to
> memory over 4GB.  Thinks like a 256MB video card often require 768MB of
> address space.
> 
> Check out BIOS for any hint of being able to remap memory, high memory, bounce
> buffers for I/O, etc.

So you're saying that a 32-bit kernel will map devices in into the 4GB
address space in such a way that they hide physical RAM, regardless of
whether you're using CONFIG_HIGHMEM4G or CONFIG_HIGHMEM64G, and that a
64-bit kernel will map devices differently. Is this right?

--Ken

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Kernel not seeing all my RAM

2009-02-03 Thread Chanoch (Ken) Bloom
On Tue, 2009-02-03 at 13:07 -0800, Cam Ellison wrote:
> Well, as I go back and read what it actually says in xconfig, it's for a 
> 32-bit processor with more than 4G of RAM:
> 
> 64GB (HIGHMEM64G)
> 
> Select this if you have a 32-bit processor and more than 4
> gigabytes of physical RAM.
> 
> The 4GB setting is thus, and I think that's what he needs if he has a 
> 32-bit processor:
> 
> 4GB (HIGHMEM4G)
> 
> Select this if you have a 32-bit processor and between 1 and 4
> gigabytes of physical RAM.
> 
> As to my comments about 64-bit processors, I stand corrected.  And thank 
> you, Bill, for the additional information.
> 
> I'm not going to quote what it says under "off" - it's too long - but 
> maybe he should read that and see if he can't find the answer.  My 
> interpretation is that it should be Off for a "64-bit processor".

In the kernel configuration, many times options are dependant on other
options (e.g. what good is it to ask about a broadcom wireless card if
you don't want WiFi support in your kernel at all). HIGHMEM4G and
HIGHMEM64G are defined in arch/x86/Kconfig and depend on X86_32, so the
choice doesn't apply to 64-bit kernels, to say nothing of non-Intel
kernels, and doesn't even appear in `make *config` for these kernels.

--Ken

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] Kernel not seeing all my RAM

2009-02-03 Thread Chanoch (Ken) Bloom
I'm upgrading an x86 machine to 4 GB of RAM, and have compiled the
kernel with CONFIG_HIGHMEM64G=y, but the kernel is only seeing 3283 MB
of the RAM. Any idea what I'm doing wrong?

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


signature.asc
Description: Digital signature
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


[vox-tech] When you can't add local printers in CUPS

2008-11-16 Thread Chanoch (Ken) Bloom

I bought a Samsung ML-2510 laser printer the other day, and when
installing using CUPS, I discovered that CUPS wasn't letting me add
local printers of any kind. After a fashion I discovered that this is
because the available printing backends in CUPS are determined by
which files are present in /usr/lib/cups/backend. So one can add a
missing backend by copying the missing backend from
/usr/lib/cups/backend-available to /usr/lib/cups/backend.

In Debian, one can also fix this by running dpkg-reconfigure cups, and
selecting the appropriate backends there. The reason for this is
explained by debconf: there are some circumstances in which selecting
backends that you don't have the hardware for can hang your machine.

--Ken

-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


signature.asc
Description: Digital signature
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Installfest Confirmation

2008-11-15 Thread Chanoch (Ken) Bloom
On Sun, 2008-11-09 at 12:09 -0800, Aaron Brayton wrote:
> Per Alex suggestion, here is the information I have:
> 
> [EMAIL PROTECTED]:~$ ifconfig
> eth1  Link encap:Ethernet  HWaddr 00:1c:26:92:6c:0e 
>   inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
>   inet6 addr: fe80::21c:26ff:fe92:6c0e/64 Scope:Link
>   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>   RX packets:2186 errors:0 dropped:0 overruns:0 frame:1745
>   TX packets:2098 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:1000
>   RX bytes:1007294 (1.0 MB)  TX bytes:330972 (330.9 KB)
>   Interrupt:17 Base address:0xc000
> 
> loLink encap:Local Loopback 
>   inet addr:127.0.0.1  Mask:255.0.0.0
>   inet6 addr: ::1/128 Scope:Host
>   UP LOOPBACK RUNNING  MTU:16436  Metric:1
>   RX packets:246 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:246 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:0
>   RX bytes:15416 (15.4 KB)  TX bytes:15416 (15.4 KB)
> 
> [EMAIL PROTECTED]:~$ sudo modprobe b44
> FATAL: Error inserting b44 
> (/lib/modules/2.6.27-7-generic/kernel/drivers/net/b44.ko): Unknown 
> symbol in module, or unknown parameter (see dmesg)
> 
> Nothing I tried with ifdown or ifup worked.  I'm probably using the 
> wrong names.

Run dmesg to see what the errors are.

Have a look at Ubuntu bug #287450

https://bugs.launchpad.net/ubuntu/+source/linux-backports-modules-2.6.27/+bug/287450

--Ken

-- 
Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/



signature.asc
Description: This is a digitally signed message part
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech