Lolbuntu

So two issues with Ubuntu Server today (10.04 LTS):

1) visudo -> uses nano

2) apt-get install git

Reading package lists… Done

Building dependency tree

Reading state information… Done

Package git is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

E: Package git has no installation candidate

Okay, why don’t you tell me what the package that refers it is?

2 years ago  /  0 notes

Virtual Machine clocks get behind

So, like any good web monkey I do my development in a virtual machine (using good ol virtualbox).  It’s quite easy to suspend your session before you head home for the day and then reanimate it when you have to hack on it again.  An issue that arises from doing that is your VM’s clock starts to get out of date!  The suspend feature basically dumps all the contents of RAM to disk, and restores it from disk before reanimating.  This includes the part of memory that stores the current time.

I got bit in the butt today with that because a series of git commits I did just today were dated two weeks ago, which put them at the bottom of github’s commit message log (despite it being the HEAD of that branch).  There was quite a bit of confusion since I was seeing my recent commit in the command line git log but wasn’t seeing it in the github log.  El. Oh. El.

So of course, ntp was born for the sole purpose of resyncing clocks.  But how to do that automatically?  I didn’t want to put it in a cron job (unless I want it to run every minute or so), and there are no post-unsuspend hooks in virtualbox (or perhaps there are, but that would just be seriously complicated!).  So I figured, I always interact with my virtualmachine by SSH’ing in, so I might as well make a post login hook.  So away I go to edit my ~/.bash_profile

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH

/usr/sbin/ntpdate pool.ntp.org

Great, now every time I reanimate the VM and I ssh in then it’ll update the clock.  Problem solved!

Not so fast.  I also use tmux, and every time I create a new subshell the clock gets updated too!  That sorta sucks.  I don’t create new subshells all the time but 1) it’s pointless and 2) it slows me down by like half a second.  So now I have to figure out if I can fix this.  Luckily, some googling about brings me to a solution:

if [[ -z “$TMUX” ]]; then
  /usr/sbin/ntpdate pool.ntp.org
fi

This basically checks for the presence of an environment variable that tmux sets within its spawned shells.  Now the bash_profile script still gets run, but ntpdate doesn’t if I’m within tmux. Yay!

2 years ago  /  12 notes

Pacman, srsly?

[root@archy shuchen]# pacman -Syu

: : Synchronizing package databases...

testing 12.5K 17.1K/s 00: 00:01 [#####################################] 100%

core 37.3K 50.4K/s 00: 00:01 [#####################################] 100%

extra 467.8K 198.9K/s 00: 00:02 [#####################################] 100%

community-testing 16.0K 32.3K/s 00: 00:00 [#####################################] 100%

community 426.5K 194.9K/s 00: 00:02 [#####################################] 100%

archlinuxfr 26.4K 58.9K/s 00: 00:00 [#####################################] 100%

: : The following packages should be upgraded first :

pacman

: : Do you want to cancel the current operation

: : and upgrade these packages now? [Y/n] y

resolving dependencies...

looking for inter-conflicts...

error: failed to prepare transaction (could not satisfy dependencies)

: : package-query: requires pacman<3.5

: : pacman-color: requires pacman=3.4.3

3 years ago  /  0 notes

I'm still trying to figure out how you can expect ANY behavior when you have no idea how it works in the first place.

I'm serious, how do you make a prediction when your model is incomplete? This isn't weather, the model's behavior is actually DOCUMENTED.

sirpengi: jonez: sara golemon explains it best: http://blog.golemon.com/2007/01/youre-being-lied-to.html

sirpengi: you MUST read this

sirpengi: before you write another line of php

jonez: and who is "sara golemon"?

sirpengi: one of the core developers of php

kon: lets write her some hatemail

sirpengi: no, you should write her a thank you card with chocolates for bringing light to how references work

jonez: yuck.

jonez: I really don't care that php is a hack under the covers.. I care that the code does what I expect.

jonez: I am not trying to "outsmart the engine" by using references.

sirpengi: no, you're not trying to do anything but use references when you don't need to

sirpengi: the only thing you net when you use references needlessly is hidden bugs

jonez: only because php is doing magical crap in certain cases.

jonez: there aren't any bugs in my code though :)

sirpengi: no, php ISN'T doing magical crap

jonez: the darn thing works :)

sirpengi: the article explains exactly how it works

jonez: yes, but I don't care how it works.

jonez: I care that my code does what I expect.

kon: :D

sirpengi: how can you expect to know what your code does when you don't understand references?

jonez: *rolls eyes*

3 years ago  /  0 notes

I &lt;3 Heff. Taken at a Fourth of July double-birthday celebration at the Gordon Biersh at Aloha Tower Marketplace.

I <3 Heff. Taken at a Fourth of July double-birthday celebration at the Gordon Biersh at Aloha Tower Marketplace.

3 years ago  /  1 note

Went out to First Friday tonight with a friend from the mainland. Mostly walked around and checked out the local scene (see what all the hip young people are up to). Didn&#8217;t buy anything, drink anything, or spend any money except for parking. Here&#8217;s me contributing to the economic recovery.

Went out to First Friday tonight with a friend from the mainland. Mostly walked around and checked out the local scene (see what all the hip young people are up to). Didn’t buy anything, drink anything, or spend any money except for parking. Here’s me contributing to the economic recovery.

3 years ago  /  1 note

IRC makes me cry sometimes

<myrk> hi, i have made a filter: http://pastebin.ubuntu.com/440142/ but it doesnt work. can you please help?

<myrk> any help? lol

<sirPengi> myrk: file returns an array with the line endings, unless you use the proper flags or manually trim them

<sirPengi> myrk: you'll need to do that

<sirPengi> myrk: otherwise it'll do a search and replace for strings that contain the word you want + followed by a line break

<myrk> ok.

<myrk> so what should i do?

<myrk> add line break?

<sirPengi> myrk: no, I just advised you to strip out the line breaks

<sirPengi> how does adding them help?

<myrk> sirpengi i dont think i have line breaks

<sirPengi> myrk: and after you figure that out, read up on the docs for str_replace, because you can just pass the entire array in

<sirPengi> rather than needlessly iterating

<myrk> ok

<myrk> but i tried that already

<sirPengi> you have line breaks. I'm 99.99% certain

<myrk> by line breaks you mean i have each word on a new line instead of a single line?

<sirPengi> myrk: so you have all your words on one line in that file?

<myrk> no...

<sirPengi> then you have line breaks

<myrk> should i?

<myrk> oh ok

<myrk> should i remove them?

<sirPengi> no, but you need to strip them out of your $badwords variable

<myrk> ok

<sirPengi> myrk: or the easy way is to read the docs for file() and figure out the flags to pass so that the function will strip it out for you

<myrk> so lets say the badwords file was: word word1 word2 word3 word4 is that correct?

<myrk> :)

<sirPengi> myrk: no, that'd be all words on one line with no line breaks

<sirPengi> you'll need to get the file contents and explode or parse it somehow

<myrk> so lets say the badwords file was: word;word1;word2;word3;word4 is that correct? lol

* sirPengi explodes

* myrk is sorry lol

3 years ago  /  0 notes

At risk of turning this into a bird watcher photo blog (where all I do is take photos of the same 5 types of common birds) I&#8217;ve decided to put one of the gourds that my mother grows.
This is the gourd. I don&#8217;t like eating it. But there exists people that do.

At risk of turning this into a bird watcher photo blog (where all I do is take photos of the same 5 types of common birds) I’ve decided to put one of the gourds that my mother grows.

This is the gourd. I don’t like eating it. But there exists people that do.

3 years ago  /  0 notes

Another photo from the walk. This was in front of the Sheraton. One of their decorations.

Another photo from the walk. This was in front of the Sheraton. One of their decorations.

4 years ago  /  3 notes

I must have the worst job ever. All my co-workers are way too cool and my boss is super lenient/understanding of the usual programmer habits.
If you didn&#8217;t catch the sarcasm there, I&#8217;ll like to point it out right now. Well, part of my job DOES involve hacking our sites to work in IE6, so I may have the worst job ever after all.
And another dreadful thing—we had a company dinner last night at Nobu, this swanky Japanese-fusion place out at the Waikiki Parc. It was pretty good as far as fusion food goes. Note to self: I need to teach the company folks about having fish ala fish. Sauce and garnish is pretty good, but raw fish unaltered is the experience to level up to.
One thing at a time. I need to convince them to switch over to nginx from Apache first.
Well, after a whole lot of drinks and food, I decided I had to take a little walk around Waikiki before hitting the short road back home. I went around a bit and took a few photos. This one was the creepiest. Everything else was also too blurry or unrecoverable.
Another note to self: Lightroom does wonders. I&#8217;ve been playing with the public Beta and it&#8217;s pretty sweet. Just today I first saw how it takes advantage of a dual monitor setup. I think that is precisely what sells it for me.

I must have the worst job ever. All my co-workers are way too cool and my boss is super lenient/understanding of the usual programmer habits.

If you didn’t catch the sarcasm there, I’ll like to point it out right now. Well, part of my job DOES involve hacking our sites to work in IE6, so I may have the worst job ever after all.

And another dreadful thing—we had a company dinner last night at Nobu, this swanky Japanese-fusion place out at the Waikiki Parc. It was pretty good as far as fusion food goes. Note to self: I need to teach the company folks about having fish ala fish. Sauce and garnish is pretty good, but raw fish unaltered is the experience to level up to.

One thing at a time. I need to convince them to switch over to nginx from Apache first.

Well, after a whole lot of drinks and food, I decided I had to take a little walk around Waikiki before hitting the short road back home. I went around a bit and took a few photos. This one was the creepiest. Everything else was also too blurry or unrecoverable.

Another note to self: Lightroom does wonders. I’ve been playing with the public Beta and it’s pretty sweet. Just today I first saw how it takes advantage of a dual monitor setup. I think that is precisely what sells it for me.

4 years ago  /  0 notes