Re: [dev] Re: coreutils / moreutils - DC a directory counter

2013-07-28 Thread Paul Hoffman
On Fri, Jul 26, 2013 at 01:17:54AM +, Thorsten Glaser wrote:
 Calvin Morrison dixit:
 
 I was sick of ls | wc -l being so damned slow on large directories, so
 
 What, besides the printing and sorting, is the slow part anyway?
 Is it the VFS API or just the filesystem code?
 
 In the latter case… could workarounds exist? Someone asked this…
 http://fenski.pl/2013/07/looking-for-a-specific-fuse-based-filesystem/
 … on Planet Debian this night.

Summarized:

Their 100+ Perl and bash scripts are slow because they're opening files 
in a humongous directory.  They can't subdivide the directory because 
they're afraid that they will break the scripts when modifying them.

I just read something about using LD_PRELOAD for this.  Write a library 
that implements open(2), munging the file path and then calling the 
real open(2).  Then you just set LD_PRELOAD in the environment of the 
scripts and Bob's your uncle.

Don't shoot me, I have no idea whether that's a good idea or not!

Paul.

-- 
Paul Hoffman nkui...@nkuitse.com



Re: [dev] [dwm] usage, was dwm 6.0 - separate taglists for muli-monitor setup

2013-04-23 Thread Paul Hoffman
On Tue, Apr 23, 2013 at 08:34:14PM +0200, Markus Teich wrote:
 It has been argued before that the use of named tags is somewhat a
 misunderstanding of dwm.
 
 Yeah, it's was a misnomer. Personally, I was thinking about workspaces, but
 I always called it tags.
 
 My tag usage is inspired by this blogpost [0].
 I have tags for:
 * generic terminal usage
 * web surfing
 * communication
 * media
 * development
 * office
 * three other generic tags
 However i use this tagnames rather as a guideline than as a strict
 rule. Sometimes when i have filled up my dev-tag with a few
 terminals, i open another terminal in the web tag (since it mostly
 only holds my web browser) to write some code with the docu in the
 browser on the side. This way i don't have the screen filled with
 unused terminals.
 
 Is there an even more efficient way of using dwm? How do _you_ use it?

I don't know why anyone would care, really, but since you ask...

I started with a similar arrangement, but after a while I got tired of 
tweaking things and just defined 30 different tags ( , a through 
z, 1 through 3).is for my main terminal window (running 
tmux) and 1 through 3 are places I stick windows to keep them out of 
the way; the others are topical (c for calendar stuff, m for mail) 
or host-specific (f for frodo, s for smaug, etc.).

It's not perfect but I like having a bunch of tags, and getting back to 
my main terminal window is quick and easy (Mod4-Space).  Also, I 
normally hide the status bar but occasionally I want to see it, and then 
the short tag names keep it from being too wide.

I've also patched dwm so that a window named +CHAR (e.g., +g) is 
assigned tag CHAR, which lets me do things like this:

$ urxvtc -name +f ...(something that f is a good mnemonic for)... 

(Yeah, I like st but I'm not ready to switch yet.)

Paul.

-- 
Paul Hoffman nkui...@nkuitse.com



Re: [dev] Xft patch dwm 6.0

2012-03-30 Thread Paul Hoffman
On Fri, Mar 30, 2012 at 01:41:47PM -0400, Lee Fallat wrote:
 Well I'm not sure how to put everything into one patch file, but here they
 are.

Generate a unified diff instead (diff -u), then you can just cat them 
together.

Paul.

-- 
Paul Hoffman nkui...@nkuitse.com



Re: [dev] interested in issue tracker dev

2012-01-25 Thread Paul Hoffman
On Fri, Jan 13, 2012 at 03:27:26PM +0100, Paul Onyschuk wrote:
 On Thu, 12 Jan 2012 19:34:09 +0200
 aecepoglu@ wrote:
 
  
  I might be interested in trying to help write one such suckless issue
  tracker as requested on the webpage.
  
  I just want to ask;
  What set of features are a must for you?
  
 
 After reading some discussion I have some ideas.  For small projects
 keeping TODO file in repository can work quite well.  What about
 extending this idea?
 
 Use one of the mbox mail formats to store data:
 
 - mbox file per issue
 - treat first message in mbox as meta: modify and store common
 informations (priority, short description, category of issue and so on)
 there

Ick.

 - store everything under version control system: closed/resolved issues
 can be moved to different branch (smaller checkout)

Interesting.

 This way data can be accessed very easily, some usage ideas:
 
 - searching for existing issues simple as checking out repository and
 greping files

Yay.

 - nice time-line provided by version control system (history of
 commits): when issue was updated, closed, new response was send

Double yay.

 - advanced usage e.g. search for issues with specific priority, cat
 them into one file and open with your email client

Excellent.

 I think that would make some people happy.

Sounds like some good ideas to me.

 Use mailing list as main interface, web interface could just send 
 messages to list. Every message would be automatically prefixed with 
 issue ID, ID would be also used as name for mbox file. Version control 
 system would provide some security against corruption (just rollback 
 to previous working checkout).

I'm not crazy about shoehorning issue tracking into e-mail like this, 
it's more complicated than it needs to be.  Concentrate on simple, basic 
storage and functions and let someone else who cares about a web 
interface write one.

 Anyway those are just random ideas, not sure if that is the way to go.

That's good for starters.  Here's a simple issue tracker repository 
using directories, key-value text files, and symlinks:

/path/to/repo/
ticket/
abc123/
+owner/
yolanda - ../../../user/yolanda
properties [status, description, whatever]
history [log of activity, append-only]
mail/ [maildir, mh mailbox, whatever]
+attachments/
hjk987 - ../../../attachment/hjk987
user/
yolanda/
+tickets/
abc123 - ../../../ticket/abc123
properties [name, e-mail address, etc.]
attachment/
hjk987/
properties
contents.foo [the file itself]

Simple, extensible (group/*, project/*, ticket/*/+watchers, 
ticket/*/+parent, whatever), and if for some reason you don't want 
symlinks you can manage the relationships between things some other way 
(hard links, plain text files, whatever).

Call it nfuit (non-fucked up issue tracker) and write some shell 
functions for convenience:

nfuit_create_repository  nfuit_create_repository /path/to/another/repo
nfuit_create nfuit_create user/bob -name Bob -email b...@example.net
nfuit_setnfuit_set user/$u -name $name -email $addr
nfuit_properties nfuit_properties user/bob | while read key val; do 
...; done
nfuit_lognfuit_log $(nfuit_now) ticket/123 created -by bob 
-status open
nfuit_exists if !nfuit_exists ticket/999; then ...; fi
nfuit_link   nfuit_link user/bob +tickets ticket/666
nfuit_unlink # obvious
nfuit_links  for t in $(nfuit_links user/yolanda +tickets); do ...; 
done
nfuit_is_linked  if nfuit_is_linked user/$u +tickets ticket/123; then 
...; fi
nfuit_lock   nfuit_lock user/bob/properties
nfuit_unlock nfuit_unlock user/bob/properties

I've done most of this (in zsh).  Then build the rest on top of this and 
utils like grep, find, munpack, etc.

Paul.

-- 
Paul Hoffman nkui...@nkuitse.com