photo
Jordan Sissel
geek

Sat, 30 Apr 2005

better screen session completion in zsh

function screen-sessions {
   typeset -a sessions
   for i in /tmp/screens/S-${USER}/*(p:t);  do
      sessions+=(${i#*.})
   done

   reply=($sessions)
}

compctl -K screen-sessions screen
Completion chops off the PID of the screen session, so i can do:
screen -x log[TAB]
and it will complete to 'screen -x logwatch'

Hurray.

Comments: 0 (view comments)
Tags:
Permalink: /geekery/161
posted at: 21:48

Tue, 26 Apr 2005

zsh compctl

Got bored after doing some homework tonight and added a few more completions to my zsh config. The top two are yanked from petef's zshrc
compctl -g '/u9/psionic/Mail/*(/:t)' -P '+' folder
compctl -g '/var/db/pkg/*(/:t)' pkg_delete pkg_info
compctl -g "/tmp/screens/S-${USER}/*(p:t)" screen
compctl -g "*(-/D)" + -g "*.class(.:r)" java
What do they do? (Listed in order)
  • for the program 'folder' complete to any directory in /u9/psionic/Mail/ and drop the path above it (like basename(1)). Also prefix it with a '+' character.
    fury(~) [1] !127! % folder +TAB
    drafts      exec        inbox       lists       old         rtp         spam        
    duplicates  foo         jason       main        outbox      security    work        
    
  • complete package names under freebsd for pkg_delete and pkg_info
    nightfall(~/foo/project) [1021] % pkg_info TAB
    ORBit2-2.12.1_1               isc-dhcp3-server-3.0.1.r14_6  png-1.2.6
    adns-1.0_1                    jad-1.5.8c                    portupgrade-20041226_1
    aspell-0.60.2                 jpeg-6b_3                     ruby-1.8.2_3
    ... the list goes on ...
    
  • complete screen sessions
    nightfall(~/foo/project) [1022] !1! % screen -x TAB
    11950.ttyp6.nightfall  16783.ttyp2.nightfall  16852.ttypa.nightfall  709.ttyp8.nightfall
    16146.ttypn.nightfall  16801.ttyp4.nightfall  17336.ttyp0.nightfall  741.ttypc.nightfall
    
  • complete java class names without the '.class' extension
    nightfall(~/foo/project/os1/step1) [1024] % java sys/TAB
    ExitCode  Kernel    Panic
    

Comments: 1 (view comments)
Tags:
Permalink: /geekery/160
posted at: 05:41

Sun, 24 Apr 2005

log-watching expert system

I got bored and wrote an expert system for doing log analysis and reaction. It's original intention was to watch auth.log for brute-force login attempts and block them on the firewall. It has turned into a far more flexible system for doing generic log-based matching and reaction. Reactions are based on a threshold of hits over time. The 'reaction' section of the config file specifies what command is run (this could be a simple shell script you call, for example).

There are a few features I'll probably be adding soon such as multiple threshold/reactions per match type, but that's somewhat down the road for when I have more boredom to throw at the project. I also want to allow users to add their own meta globs (like %USERNAME%) into the config file so the program is even more flexible.

Currently it runs on my mirror server and blocks excess (brute force) ssh attempts, seems to be going good. The development process of this took me into learning a very slick perl module called Parse::RecDescent which parses documents based on a given grammar. I used this for the config file, it was pleasantly easy to use. Check out logwatch, download it

It requires the following perl modules:

  • File::Tail
  • Regexp::Common
  • Parse::RecDescent

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/159
posted at: 19:28

Mon, 18 Apr 2005

the search for the perfect developer blogware

My site is pretty much my ramblings, ideas, and projects regarding various computer technologies. I've always written my own website software myself becuase I needed features I couldn't find in blogging tools available at the time I was writing the code.

This time around, however, is a different story. There are plenty of blogware suites out there that have a varying array of features. A friend of mine recently started using Wordpress over his own software. I've checked it out and it's decent. However, it does simply blogging and little more by default. I need to explore more of it's options and i'll have to write a few of my own plugins, but it may be what I need.

Most of the work redesigning my current website has been regarding layout and extra content features. These being, specifically, cvs and darcs commit summaries, Furthermore, I tend to do one of many things, projects and blog entries. These are two different things, in my opinion. I need to be able to update project pages along with being able to write simple entries.

Wordpress seems to have these abilities via plugins and whatnot. So I'm going to be spending some time trying to configure it and write a few plugins so I can have various informations displayed on the front page, such as cvs and darcs repo commits, etc.

The search goes on, but for now we'll have to see how Wordpress fairs against my tests. Since Wordpress already meets one of my requirements, that it allows me to post things. It also has a plugin framework and themability, etc. I need a developer blog. And for me to consider using Wordpress I'm going to need to hack some functionality into it. So we'll see :)

Comments: 0 (view comments)
Tags:
Permalink: /site/158
posted at: 01:48

Search this site

Navigation

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials

Tag Cloud

Calendar

< April 2005 >
SuMoTuWeThFrSa
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati