I like this construct for searching through files in a directory and pulling out part of a line.
Just add the regular expression. The '?' designates a non-greedy expression, which means the finite statement machine will quit on the first successful match.
find . -name "*.xml" | xargs perl -ne '/(.*?)"/; print $1; print "\n";'
Wednesday, September 30, 2009
Tuesday, September 29, 2009
What I like about living in Atlanta, GA
I recently moved to the Atlanta area. @dneighbors on twitter asked the question "Why Do You Live Where You Live?" It may be that I just love Atlanta, or maybe cause it felt so good to get out of Phoenix. Let me paint a picture for you.
Here is my perspective. Being born and raised in Phoenix, AZ and then moving to the Atlanta area in my thirties was a monumental change. The culture, weather, terrain are all starkly different.
Phoenix: hot, dry, dusty, smoggy, transient culture, California rejects, kind-hearted souls, sunburn, sunny days, prickly cacti, rocky moon-like surfaces, smelly dairy farms, cotton fields, traffic cameras, migrants standing on corners, 90 degree low temperatures, blast oven heat in your face from April to November, the sweet smell of jasmine and orange blossoms on spring nights.
Atlanta: Cool breezes, smell of pine in the air, festivals in the park on beautiful days, a sense of community, long summer days by the pool, peach cobbler, wild rasberries, blackberries, and blueberries growing in summer, smell of chocolate in the spring when the Magnolias bloom, blooming wisteria, azelia flowers, the old narrow streets of mid town, the rolling hills of Atlanta, every street named "peachtree" downtown, the aquarium, the college football, the reddest red of the maples in the fall, the greeniest of green of the pines against the deep blue sky, the "oceans" of kudzu, the brisk autumn breezes delivering a blanket of red, brown, and yellow leaves, the southern hospitality, neighbors helping neighbors, the squirrels, the bright red cardinals, the shady paths in the park, the fireflies, the geese, the deer
Here is my perspective. Being born and raised in Phoenix, AZ and then moving to the Atlanta area in my thirties was a monumental change. The culture, weather, terrain are all starkly different.
Phoenix: hot, dry, dusty, smoggy, transient culture, California rejects, kind-hearted souls, sunburn, sunny days, prickly cacti, rocky moon-like surfaces, smelly dairy farms, cotton fields, traffic cameras, migrants standing on corners, 90 degree low temperatures, blast oven heat in your face from April to November, the sweet smell of jasmine and orange blossoms on spring nights.
Atlanta: Cool breezes, smell of pine in the air, festivals in the park on beautiful days, a sense of community, long summer days by the pool, peach cobbler, wild rasberries, blackberries, and blueberries growing in summer, smell of chocolate in the spring when the Magnolias bloom, blooming wisteria, azelia flowers, the old narrow streets of mid town, the rolling hills of Atlanta, every street named "peachtree" downtown, the aquarium, the college football, the reddest red of the maples in the fall, the greeniest of green of the pines against the deep blue sky, the "oceans" of kudzu, the brisk autumn breezes delivering a blanket of red, brown, and yellow leaves, the southern hospitality, neighbors helping neighbors, the squirrels, the bright red cardinals, the shady paths in the park, the fireflies, the geese, the deer
Monday, September 21, 2009
Out of work
I recently lost my job. I am looking for a new way to earn a living. I have a couple of leads right now and I am also reading a lot and hacking on some rails apps for some of the business ideas that I have had over the last few years. It feels good to get out of on my own. I am learning about some things that I have wanted to know about for quite some time. Some Erlang topics are really interesting me right now. It would be really nice to start a consulting firm. I have a feeling that jumping into a long term full time job is not the cards right now.
I had an idea for a documentary. It would follow a small software engineering firm from inception to consulting and producing a piece of software to trying to paid. All the things that small businesses have to deal with. It would cronical the times we live in. Our culture here is very enterprising and this where creative projects go from a concept to a real living thing. I dream that I could be the one who starts the company and filmmakers can just hang around and record everything. I would love to watch that kind of a movie. I was fascinated with the documentary, "The Staircase". I highly recommend this film. These are the best sort of movies, I think.
I had an idea for a documentary. It would follow a small software engineering firm from inception to consulting and producing a piece of software to trying to paid. All the things that small businesses have to deal with. It would cronical the times we live in. Our culture here is very enterprising and this where creative projects go from a concept to a real living thing. I dream that I could be the one who starts the company and filmmakers can just hang around and record everything. I would love to watch that kind of a movie. I was fascinated with the documentary, "The Staircase". I highly recommend this film. These are the best sort of movies, I think.
Friday, August 14, 2009
DNSMASQ and multiple DHCP networks with DHCP relay
I switched from MaraDNS to DNSMasq. DNSmasq is an excellent tool for small networks. Small networks are defined as something less than 1000 hosts. This is most networks! I love DNSMasq's simplicity. I also like how it bundles DHCP, DNS recursive server, DNS caching. The DHCP is surprisingly simple to use and configure and incredibly feature-full. For example, the DHCP server handles PXE clients requests for the next server. It also handles requests that are relayed, so you can provide multiple subnets DHCP service and do it based on the tag provided by the relayer. I also like how you can reuse the local (to the DNSmasq) machine's /etc/hosts and /etc/resolv.conf to gather static entries and upstream recursive DNS caches. It seems simple to just reuse these files for the server and clients. You are essentially exporting the server's /etc/hosts and /etc/resolv.conf to your clients.
Friday, May 29, 2009
Tail recursion in Python
Problem: When marshalling an object to be able to transmit to or from an XMLRPC server and the xmlrpc lib is insufficient to the task because the objects within the main object do not implement a marshal method.
Admittedly the datetime, mxDateTime and None objects should just know what to do if asked by the xmlrpclib to marshal themselves, but in this case, I want to do this myself.
Answer: Here is a tail recursive way to perform this task. This should not use any stack space, but I cannot confirm this since I am not sure what is going on in the interpreter.
Admittedly the datetime, mxDateTime and None objects should just know what to do if asked by the xmlrpclib to marshal themselves, but in this case, I want to do this myself.
Answer: Here is a tail recursive way to perform this task. This should not use any stack space, but I cannot confirm this since I am not sure what is going on in the interpreter.
def __convertNonMarshalables(self, obj):
if type(obj) == type({}):
for key, value in obj.items():
if value is None:
obj[key] = ""
elif type(value) is type(mx.DateTime.now()) or type(value) is type(datetime.datetime.now()):
obj[key] = value.strftime('%Y-%m-%d')
elif type(value) == type([]) or type(value) == type({}):
value = self.__convertNonMarshalables(value)
elif type(obj) == type([]):
for value in obj:
if value is None:
value = ""
elif type(value) is type(mx.DateTime.now()) or type(value) is type(datetime.datetime.now()):
value = value.strftime('%Y-%m-%d')
elif type(value) == type([]) or type(value) == type({}):
value = self.__convertNonMarshalables(value)
else:
if obj is None:
obj = ""
return obj
Tuesday, May 26, 2009
Leopard killed TextMate, sort of
Just updated Leopard and now having "#!/bin/sh" in the "command(s)" section of the bundle editor for any bundle yields "bad interpreter: no such file or directory" if I remove the directive, it works fine, but now on the shell bundle, the run command script is a ruby script and TextMate will not take #!/usr/bin/env ruby, yields bad interpreter again, but I really need to tell TextMate this is a ruby script. So I ran the script with ruby -e'do something'. That is weak sauce but it works. I also noticed circular dependencies in the bundles. You need ruby to run a python script in the python bundle; you need bash to run a ruby script, you need ruby to run a shell script.
I am not sure why this is because the text in command(s) should be treated as a shell script. Anyway, if anyone else has this problem, then removing the shell directive line should help.
I am not sure why this is because the text in command(s) should be treated as a shell script. Anyway, if anyone else has this problem, then removing the shell directive line should help.
Tuesday, March 10, 2009
Subscribe to:
Posts (Atom)
