photo
Jordan Sissel
geek

Tue, 21 Dec 2004

ipfallowme - Me vs Annoying IPF Rules

The dev box at work has a new, more strict set of ipf rules now. In an effort not to have to change the global rule set, I wrote a little script to pick out your ip from an ssh session and add a few rules based on that ip.

There are probably already scripts that do this out there, but I didn't bother looking.

How it works:
- Create a rule file
- Make sure none of these rules are in the existing ipf rule set
- Apply the generated ruleset (won't overwrite or delete any existing rules)
- Wait until you kill the process or logout if you've backgrounded it, then remove the new rules you added.

Click here to view ipfallowme

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/ipfallowme
posted at: 14:16

Wed, 15 Dec 2004

Suxus font change - Zero no longer looks like capital O

So yeah, the subject rather explains it - i got tired of always thinking "Is that a zero or a letter?" When reading text with suxus, so I changed it to have a small slash in the zero.

http://www.csh.rit.edu/~psionic/misc/suxus.pcf.gz

Necessary screenshot -

Comments: 0 (view comments)
Tags:
Permalink: /productivity/144
posted at: 16:00

Tue, 07 Dec 2004

Terminals and meta characters

So it seems that there's two ways your terminal can send "meta" key combinations.

One method is to send escape + the character. So hitting ALT+J will send an escape character followed by 'J'.
Alternatively, your terminal might simply read the character value in and set it's most significant bit high before sending that byte to the terminal. What does does that mean?
Let's say you were to hit ALT+J this time. J, in ascii is 74 in ascii. This number represented in binary is: 01101010. Having alt held down sets the left-most (most significant) bit high, becoming 11101010.

Many terminals allow you to set which method of input it uses. XTerm, for instance, allows you through the menu accessed by control+leftclicking on the terminal (anywhere). Select "Meta sends Escape" and alt-key combinations will send escape+character. If "Meta sends Escape" is unchecked, then your terminal will set-high the most significant bit before sending the character.

Here's a perl oneliner that'll let you see what's going on. The output for mat is: char / ascii / binary where ascii is the hexadecimal value of what you entered, and binary is the binary representation. You'll notice that if "Meta sends Escape" is unchecked, then your terminal will set-high the most significant bit before sending the character.

#!/usr/bin/perl

system("stty raw -echo"); 
while (sysread(STDIN,$foo,1)) {
        printf("%s / %2x - ", ($foo =~ /[[:print:]]/ ? $foo : " "), ord($foo)); 
        print unpack("B32", pack("n", ord($foo))) . "\r\n" 
}

Comments: 0 (view comments)
Tags:
Permalink: /geekery/141
posted at: 16:20

Mon, 06 Dec 2004

XML? Perhaps...

I've been recently considering moving away from the huge hack that is the code that makes this website go. Currently it is driven by mod_perl and HTML::Mason - hack upon hack, mostly due to how this website was done.
I rewrote this website from php into perl as an excuse to learn HTML::Mason. Now I know mason and as a result the code is poorly written and shoddily glued together. In an effort to move towards newer technologies I think I'm going to try rewriting the site in XML and use XSLT to render. For the HTML it generates I'm leaning towards some sort of css/javascript fanciness to make things pretty and useful.
I also want to trash the script that I use to post things to this site becuase frankly it doesn't handle things the proper way it should, among other excuses to want to rewrite it to be morebettergood and use cooler technologies.
I'll keep posting updates as progress happens and I learn new things.

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/138
posted at: 16:18

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

< December 2004 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 

Friends

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

Technorati