January 15, 2010

irssi follow-up: identd

Filed under:Uncategorized — ryan @ 8:52 pm

All my people on the irc, if the undernet is the place you be, let me see, let me hear you get FIRED UP….because of that QUOTE PASS BULL SHIT!

Did you know that if you provide an IDENT response, then irc servers will not bug you to type any quote pass stuff? If you use irssi as mentioned in my previous post, then you may discover that it doesn’t include any sort of ident daemon.

Luckily, it’s a pretty easy fix. Aside from making sure port 113 is reachable on your Mac from the outside world, you also have to install a working ident daemon (identd for short). This cool french fellow has made one that is controllable via a Prefpane! Cool!

Just follow that link and install. Next, go to the Apple Menu > System Preferences, and click ‘IdentD’ down under the ‘Other’ row. Click the lock to authorize yourself to make changes, then click ‘Activate’. Now, here’s the problem I’ve had sometimes, and how to repair it. If it appears as though identd is deactivating almost immediately after you click ‘activate’, then it’s affecting you.

You’ll have to edit a config file to fix this issue. If you’re a vi guy, simply type ‘sudo vi /etc/hostconfig‘ at a prompt and take a look at the file. We’re looking for the line that starts with … yep, IDENTD. If you notice that it seems to run into the next line (sometimes it does), then simply add a carriage return after it. Even if you don’t have this problem, it might be a good idea to add said carriage return, in the event that another line is added later.

You’ll be glad you did!

Here’s the current content of my /etc/hostconfig file. I also had a leading extra carriage return that I removed to tidy things up:

# This file is going away

AFPSERVER=-NO-
AUTHSERVER=-NO-
TIMESYNC=-NO-
QTSSERVER=-NO-
PARALLELS=-YES-
IDENTDSERVER=-YES-

November 7, 2009

Compiling Irssi for Mac OS X 10.6

Filed under:technology — ryan @ 12:04 am

When upgrading from 10.5 to 10.6, I noticed that my laboriously-compiled (okay, okay, I’m being dramatic, but it WAS a pain) irssi broke, due to some funkiness with Perl and 64-bit. Unfortunately, recompiling Irssi for 10.6 proved to be even more of a pain, and I know that I myself will have a hard time with it if I don’t write down exactly what I did here. I’m assuming this’ll be useful for other folks, too.

I’ll try to provide notes and reasoning for each step in the directions below. Keep in mind that you’ll need the developer tools installed (from the ‘Additional Installs’ folder on the Snow Leopard install disc), and that I am NOT using Fink or DarwinPorts (it would be much easier if I did, however I am not a fan of package managers and separate library paths, etc). I also assume that you’re familiar with basic terminal commands (cd, ls, etc) and navigating filesystem paths (mostly to downloaded/untarred folders in your ‘Downloads’ folder).

(more…)

July 3, 2009

Hello blog! And todo.sh

Filed under:Uncategorized — ryan @ 12:04 am

Hello blog.

I am currently unemployed. We’ll maybe delve into that some other time. Recession.

Remember this post? Well, I’ve been modifying bands.sh to become todo.sh and to be displayed on my desktop via GeekTool. It looks something like this.

So far, I’ve basically changed it so that you can delete a numbered line like this:

‘todo -d 4′ would delete post 4. Works for me! I’ve also written it in a way so that I can add re-ordering or re-prioritizing of items in the list. When I figure out how. Hehe.

Here’s the code:

#!/bin/bash

# you can change the textfile variable to anything you want
# this allows you to make various lists and have different scripts
# for each.  simple but useful.
# I use it to make a list of albums I wanna get.
# THIS VERSION: has been modified to work as a TODO type script
# p.s. I killed most of the comments.  Ask me if you wanna know
# what something does.  Like the sed and the awk.  Fuck that shit.

 
textfile=/Users/ryan/Documents/todo.txt        #edit this line!!
filename=`basename $textfile`                  #short version
 
if [ ${#} -lt 1 ]                  # if you are not adding something,
then                               # assumes you want to see file
    echo " "
    echo "     .:[$filename]:."
    echo " "                       # let’s make a nice header/footer
    cat -n $textfile               # show the file with line numbers  
    echo " "
elif [ "$1" = "-d" ]     
then
    showline=`awk "NR==$2" $textfile`   
    echo "`basename $0`: Removing ‘$showline‘ from $filename…"
    mv $textfile $textfile.tmp      
    sed "$2d" $textfile.tmp > $textfile    # dumb way to do it
    echo "Done!"
else
    echo "$1" >> $textfile                 # add a task        
    echo "`basename $0`: added ‘$1‘ to $filename!"       
fi

Damn, I found/fixed so many bugs while getting ready to post this entry. Cool, I guess.

March 14, 2008

logrotate/apache and web hosting

Filed under:organization, technology — ryan @ 5:52 pm

Logrotate is a simple program that can perform simple but much-needed features, such as keeping log files from growing to 5gb. Heh. Anyhow, usually, it’s a simple matter of pointing it to the files and letting it do it’s thing.

What if you are a hosting company and you like to allow each user/domain you host access to their own logfiles in their own log directory? Well, without rotation, it’s possible that their logs can grow to gargantuan proportions, for a variety of reasons.

Manually adding and deleting the four or five line entries for each domain could get cumbersome, if your users add/delete domains as often as ours do. This shell script I wrote yesterday helps. It’s got a static section for the ‘main’ apache logs (like most non-hosting apache server setups), and then it dynamically generates the rest given a listing of directories in the main ‘www’ directory. This is not foolproof, and picks up some directories that do not correspond to domains, but there’s also a flag that tells logrotate not to bitch if it encounters them.

#!/usr/bin/sh
#
# ask ryan how this works
# or blame him if it’s broken
#
# if this script is to be cron’d
# just comment out the 3 lines with # SILENT after them
# so the script doesn’t spit out crap

# various variables, only edit the one beginning with ‘file’
file=/www/test2.txt                         # edit this to match logrotate file
backup=/tmp/test2-bak                        
short=`basename $file`
wwwdir=`ls -Ap /www/ | grep "/"`

# backup old logrotate file, create new one
mv $file $backup
touch $file

echo "—– populating $short —–"  # SILENT

# add static header information
# this is constant between updates
echo "### Apache Access Log" >> $file
echo " " >> $file
echo "/www/logs/*log {" >> $file
echo "    missingok" >> $file
echo "    postrotate" >> $file
echo "        /usr/bin/killall -HUP httpd 2> /dev/null || true" >> $file
echo "    endscript" >> $file
echo "}" >> $file
echo " " >> $file
echo " " >> $file
echo "### WebSite Access Logs" >> $file

# now to read all the apparent directories in
# /www/ and treat them like domains, add them
# to the list!  note to ryan: further filter later
for domain in $wwwdir
do
    echo " " >> $file
    echo "/www/"$domain"logs/access_log {" >> $file
    echo "  missingok" >> $file
    echo "  postrotate" >> $file
    echo "      /usr/bin/killall -HUP httpd 2> /dev/null || true" >> $file
    echo "  endscript" >> $file
    echo "}" >> $file
    echo "  `basename $0`: Added ‘$domain‘ to log rotation!" # SILENT
done                                                             

rm -f $backup
echo "—– all done! —–"  # SILENT

Where I work, after we were satisfied that it was doing it’s job when we ran it manually, it was added to cron.weekly.

January 16, 2008

bands script (bash scripting tutorial of sorts)

Filed under:lifestyle, music, technology — ryan @ 4:30 pm

I like to keep little lists, lately. It keeps me organized, sort of. If anyone has heard of or used the GTD (getting things done) system, they know what I am talking about. Anyhow, I am sick of forgetting bands that I find online that I really like, and would like to keep a wish list of albums to buy, so they are fresh in my mind and I can refer to the list if I get any disposable income.

So I wrote this script:

#!/bin/bash

# you can change the textfile variable to anything you want
# this allows you to make various lists and have different scripts
# for each.  simple but useful.
# I use it to make a list of albums I wanna get.

textfile=/Users/ryan/Music/bands-to-find.txt        #edit this line!!
filename=`basename $textfile`

if [ ${#} -lt 1 ]                   # if you are not adding something,
then                                # assumes you want to see file contents
    echo " "
    echo "— Contents of $filename: —"
    echo " "                        # let’s make a nice header/footer and
    cat -n $textfile                # show the file with line numbers :)
    echo " "
    echo "— End of $filename —"
    echo " "
    echo "Usage (to add a line)"    # then tell the dummy how to use it              
    echo "$ `basename $0` ‘line of text to add’ (use quotes!)"
else
    echo "$1" >> $textfile          # the actual simple command        
    echo "`basename $0`: added ‘$1‘ to $filename!"          # be proud!
fi

 

Basically it allows you to add a line to a text file easily and quickly, and if you just call the program up without wanting to add anything, it organizes the list and shows it to you prettily. This doesn’t have to be used for an album wish list (yet)..I could see someone modifying it for any sort of list…upcoming birthdays, baby names (haha babies), to-do list, videogame wishlist, etc. This is a super simple, but well-commented script that might be a good tutorial for anyone who wonders what good a shellscript can do, or wants to learn.

December 28, 2007

Top 3 Albums of the Year

Filed under:music — ryan @ 1:31 am

I was asked in a last.fm community I am a part of so I thought about it. I figured, if I answered them there, I may as well post my answers here and on my lj.


1.) Architecture in Helsinki – Places Like This

These guys just sound like they are having a lot of fun. To see what kind of fun I am talking about, watch this video:


2.) The Fiery Furnaces – Widow City

I have always liked the fiery furnaces. For some reason, this time especially, I feel like a big overarching story is trying to come across…and I can almost piece it together.


3.) A Place to Bury Strangers – A Place To Bury Strangers

This is more a collection of remastered songs that are much older, but it’s a great collection of great noise and shoegaze style tracks.


There we go. Short, to the point, badly formatted, with a youtube video. Goodnight.

December 23, 2007

ruby

Filed under:technology — ryan @ 3:16 am

Ruby is a great language. It’s object-oriented in all the right ways, and the syntax is so simple, it reads like pseudocode.

I’ve been creating my very own roguelike using ruby. It took me a few false starts, but I am now using ruby’s built-in curses bindings. Click here to see the window setup I have decided to stick with. The big blank spot in the upper left is where the actual gameplay map will show up. The bottom is for narration/log of encounters and whatnot. The upper right is for character status, hp/mp/poisoned/hungry, that sort of thing. The lower right is for inventory, and the contents of chests/bags/etc.

For those interested in how I got that stuff to appear, it was as easy as this:

def draw_windows
    @map_win = Window.new(16, 60, 0, 0)
    @map_win.refresh
    
    border_win = Window.new(12, 20, 0, 60)
    border_win.box(0,0)
    border_win << ‘Status’
    border_win.refresh
    @stat_win = Window.new(10, 18, 1, 1)
    @stat_win.refresh
    
    border_win = Window.new(12, 20, 12, 60)
    border_win.box(0,0)
    border_win << ‘Stuff’
    border_win.refresh
    @stuff_win = Window.new(10, 18, 13, 61)
    @stuff_win.refresh
    
    border_win = Window.new(8, 60, 16, 0)
    border_win.box(0,0)
    border_win << ‘Travel Log’
    border_win.refresh
    @log_win = Window.new(6, 58, 17, 1)
    @log_win.scrollok(true)
    @log_win.refresh
end

October 11, 2007

midines mod complete

Filed under:music, technology — ryan @ 9:10 am

I forget if I posted pictures detailing the adding of gold-plated stereo rca jacks to my NES. Either way, this is the type of stuff I can do now

September 24, 2007

midines + logic = win

Filed under:music, technology — ryan @ 4:10 am

Hi, here’s an early example of how things are going to be from now on, now that I’ve got my midines kickin’ with logic 8 (which rocks, by the way).

And here’s how I look playing along with the midines, which is also providing glitchy-ass visuals on the tv behind me.

p.s. I am using a new flash player deal for the mp3s, so if you read this site through a rss reader it may not work.

September 4, 2007

doublet headphone amp and octopart.com

Filed under:music, technology — ryan @ 9:27 am

One of the blogs I read regarding DIY and/or audio linked me up to this post from Sam at octopart.com. Basically it is a headphone amp for two people. Well, it’s actually two headphone amps sharing an input and power, on the same board. It’s based on the design that my earlier amp was, and I already had a bunch of parts left over. Sam even sent me one of the pcbs for free as part of a promotion for their awesome site. If anyone who reads this is into DIY electronics, they should bookmark that site NOW. It’s very useful for part finding and pricing, and creating a parts list for a project. It helps you to combine orders and get the cheapest prices from various sellers.

So anyhow, here are a few pics of the thing. Since I can’t seem to poke proper holes in an altoids tin, we’re going to have to just look at it naked for now:




pay no attention to the terrible soldering on the capacitors

next page