SOPA, PIPA, and OPEN … oh my.

Now that Blackout Day has come and gone, I thought I’d put some thoughts here.  For once, I’m going to be really short, and to the point.  For reference the pertinent pieces of legislation are the Stop Online Privacy Act, the Preventing Real Online Threats to Economic Creativity and Theft of Intellectual Property Act of 2011, and Online Protection and Enforcement of Digital Trade Act.

  • SOPA (H.R. 3261) references one and two.
  • PIPA (S. 968) references one and two.
  • OPEN Act (S. 2029) references one and two.

First, the MPAA says the blackouts were an abuse of power. However, shutting down a site, without due process, because they supposedly host or link to illegal content is not.  This is hypocrisy at its finest.

Second, making viewing or linking illegal content a felony, like rape and murder, is absurd.

Third, the MPAA has given $94M (ninety four million dollars) to politicians in an effort to get these bills passed.  There was one hearing where limited representatives from the opposing view were permitted to speak or attend.

Finally, back to my point about piracy.  If pirating material is easier that using it legally, can you see the real problem?  The industry needs to change to make their products easier and better to use than illegally obtained copies.

Passing laws to supposedly fix a broken industry is not going to fix the broken industry.


Process killing BASH script

I enjoy the simplicity of shell scripting sometimes.  There are a million ways to do things, and this is how I’m presently shutting down something that isn’t being cooperative.

#!/bin/bash

ABC_PID=`ps | grep abc | awk '{print $1}'`
DEF_PID=`ps | grep def | awk '{print $1}'`

if [ -z $ABC_PID ] ; then
  echo "ABC PID is empty. Kill manually."
  exit
fi

if [ -z $DEF_PID ] ; then
  echo "DEF PID is empty. Kill manually."
  exit
fi

echo "ABC PID: " $ABC_PID
echo "DEF PID: " $DEF_PID

echo "Killing ABC and DEF with: kill -9" $ABC_PID $DEF_PID
kill -9 $ABC_PID $DEF_PID

exit

Out of necessity I changed the names to protect the … well, stuff.

See a way to improve that? Please share! Have a way you’d prefer to see it done? Share that too! Variety!


What are Teh Klowd? (IOW, What is the cloud?)

The cloud.

A nebulous frontier.

I tried to imagine the data.  What did it look like?  Were the collections like cumulus clouds?  Were the users like sky-divers?  Or were they hapless passengers thrown out the door, free-falling to their demise…

All apologies to Tron: Legacy there.  But I think my parody sums up the wacky vision promoted by so many sales people and executive-level mumbo-jumbo speakers.  They don’t know what it is.  They talk about it like is a the next best thing, but I haven’t yet heard a sales, technical, or architecture person describe it in a way that makes real sense — something that makes it more than just a big blob of storage “out there” that can be used for “lost of cool stuff”.

Then I read this post by Lee Dallas.  Nail, on, the, head … man.  Perfect.  This is what the cloud brings:  data + context, permitting you to use any device to access the same data and have awareness.  Whether it is a book, a paused movie, a spreadsheet, or whatever.  The next step, of course, is full-blown programs that allow you to disconnect and reconnect to their instances from any device.

That makes it sound cool, in a tangible way … in a way that I understand and can explain to others.

I could go off about privacy concerns, but for now I’ll let this serve as a lengthy pointer to Lee’s post which is such a nice explanation of what “the cloud” means.


Talk Like a Pirate Day

Yes, a day late.  Because I’m not going to talk like that kind of pirate, and I’m going to break my “non-controversial” seal a little bit.  This is going to be about piracy through technology.

Sometimes I marvel at the various technologies we have and the ability to receive entertainment through a variety of channels.  I can watch television shows, movies, and other videos on my phone, computer, or television via DVD, Blu-Ray, streaming video from my cable provider or from the Internet.  However, various and frustrating barriers remain preventing this from being easier, more convenient, diverse, and overall, practically useful.

Continue reading


Linux aliasing changing directories

Not terribly complicated or clever, but I wanted to try something different… and learn something.

alias u="cd .."
alias uu="u;u"
alias uuu="uu;u"
alias uuuu="uuu;u"
alias uuuuu="uuuu;u"
alias uuuuuu="for (( i=1; i<=6; i++ )) ; do cd .. ; done"
alias uuuuuuu="uuuuuu;u"

All this because I change directory levels like crazy, and often, in the shell. I worked out #6 when I was trying to figure out a way to count the number of U’s I typed. But then I reckoned that was too complicated, but didn’t want to completely lose it.

At least it is amusing to me.

I may try to figure out how to script this at some point and count the number of U’s or pass in a parameter.


UNIX find writable files

Way back when, I posted about using find and grep.  I have learned a couple of things since then.

1) find your critiera | xargs grep your grep criteria … is nicer to your processor, memory, and quickly returning the results.

2) finding writable files.  This has been particularly useful when using a really backwards SCS that doesn’t integrate nicely, cleanly, or usable with an IDE.

My command:  find . -type f -perm /u=w

So simple. So elegant. So simply says “find all files in this directory, recursively, that are writable by the user/owner”. The one confusing thing I had about this was /u instead of /o. I figured “owner, group, world”, but it is actually “user, group, other(s)”.

Anyway, this has improved my programming life.  Yeah, I’m gonna say it… take that, Windows.


The Robots Have Me (aka I switched to Android)

The positive reasons why I moved to Android are that it is new, I wanted to play with it, I love Linux, I think Google is on to a good thing, and I can put my music on my phone without the need for software that doesn’t run under Linux*.  I switched from an iPhone 3G to a Motorola Atrix … and wow the change is unbelievable.  I know I was using very old technology**, but even comparing the performance of this phone to various iPhone 4 phones, I haven’t yet seen one perform as well.  After about a month of ownership, I don’t think I can name anything I really dislike about this phone***.  There are, however, things I had trouble with at first and had to fix.

Edit (8/24):  Corrected “iPhone 4″ reference.  Added Amarok2 remote app to the “things I just love”.

Edit (8/24):  Added FTP app (like)!

Continue reading


diff in ‘nix environments

After a long silence… he surfaces!  I have a couple of things to say, but I’m going to start with a very simple pleasure: diff.  First, let me clarify that I generally love the command line.  But in a world of many different pieces that all have different importance, I have come to appreciate what GUI tools have to offer.  I find the compare functionality in something like eclipse to be handy in an efficiency++ way.  So when I go back to the command line for something like this, it is because nothing else can truly replace it… like the beauty that is vi.  ;D

The short story is this:  diff -w -B -y -W 200 {file1} {file2}

Now some of you are reading that and saying, “No kidding.  Welcome to the real world.”  The rest of you may be saying “gonk… gonk… goo gonk.”  So to quote the help on diff:

  • -w:  ignore all white space (like tab expansions and changes to white space)
  • -B:  ignore changes whose lines are all blank (just in case the above is finicky)
  • -y:  output in two columns
  • -W 200:  make the output 200 columns wide (this permits both files to be displayed in full width, with room, assuming 80 char width)

I have yet to find a graphical diff tool that can manage that so nicely.  The side-by-side output is very clean and I can redirect it to a file if I want to.  Smooth, simple, elegant.  And if there’s a way to improve on this, I hope a casual passerby will comment!

Ciao!


Acer AspireONE D255 Wireless Network and Kubuntu

One of the things I really love about the Ubuntu community is how helpful it is.  By following these easy directions,  I was able to get the wired network up and running on my netbook.  Yes, that’s right.  I have a situation where the wireless works and the wired doesn’t!  Even stranger, the fix is in an wireless network adapter package!

Because I’ve been burned by stale links, I’m going to repeat some information here.

Netbook:  Acer AspireONE D255

Wireless (lspci):
01:00.0 Ethernet controller: Atheros Communications AR8152 v1.1 Fast Ethernet (rev c1)
02:00.0 Network controller: Intel Corporation WiFi Link 1000 Series

The steps:

  1. Go here (http://linuxwireless.org/download/compat-wireless-2.6) and download “compat-wireless-2.6.tar.bz2″
  2. Run the following commands:
sudo apt-get update
sudo apt-get install build-essential
cd ~/Desktop
tar -xjvf compat-wireless-2.6.tar.bz2
cd compat-wireless*
scripts/driver-select atl1c
make
sudo make install

At this point a reboot should load the network driver.  For me, the “sudo make install” took a very long time.  Well, 10 minutes.  But it felt like an eternity.

If a reboot doesn’t load the module, try “modprobe atl1c” (that’s ay-tee-el-one-cee).

And that was it.  Lovely!  Again, I can’t promote the friendliness and helpfulness of the Ubuntu community enough.  They have been great.

Update 2011-03-30: I had to repeat these steps after upgrading to kernel 2.6.32-28 or -29.  But it worked.


Interview Techniques

Interview Techniques… you are probably wondering what that has to do with technology.  This is partly to do with technology, partly a way for me to remember these, and partly, well, a ramble as usual.  I have been exposed to some simple interview techniques for “software engineering” positions and they are worth remembering.  These have come in a variety of difficulties, so I will attempt to organize them as such.

First, technology!  See Mike Code, is cool.  It is a way an interviewer can ask simple questions over the phone and see the person write the code.  That gets a darn cool in my book.  Perhaps it is as modern as VHS is these days, but who says a technology needs to be on the order of Star Trek to warrant recognition?

Also, I recently found this:  http://formatmysourcecode.blogspot.com/.  It is excellent for automatically formatting HTML/XML and code for posting in a blog.

Beyond the technology is the questions I have either been asked or found in my own prowling around.  These are thing ones I find to be the most interesting.

Practical Questions:

  • fizz-buzz, written in any language — basically, for some multiplier of a loop print “fizz”, for a different multiplier write “buzz”.  For a multiplier equal to one divisible by A and B, write “fizzbuzz”.
  • given two lists (e.g., friends lists), and assuming list-2 represents changes affected upon list-1, who was added, who was removed, who is the same.  Written in any language.
  • Extend a standard Java class (e.g., HashMap) such that it meets new constraints such as, and using HashMap as an example:
    • limit the number of values that can be stored popping off the oldest when a newer one is inserted
    • disallow overwriting an existing key; key/value must be removed first
    • lock the list if three unsuccessful attempts are made to retrieve a value
    • lock the list if three unsuccessful attempts are make to insert a value (e.g., inserting an existing key)
  • web application to retrieve basic statistics from somewhere like flickr, using web app technology of choice

Conceptual Questions:

  • What information should a bug tracking system have?  How should it be stored?
  • What project did you make the most difference on?  What did you learn?  What would you do differently?
  • Create an interface from a legacy system to a newer UI.  Assume an API or web service exists.  Describe the architecture you would use; describe high-level design considerations; define milestones.
  • A database has been demonstrating progressively degrading performance (either via an application or reports).  What diagnostic steps would you take?

Mean Questions:

  • I file lists like this as mean because they contain a lot of questions that either a person knows from practical use, or can look up.  To put someone on-the-spot to answer deep details like this in an interview is merely a test in making the interviewee squirm.  To me, these questions are a lot like asking a mechanic about metallurgy — while they use metal in their daily work, but they don’t need to know the minute details about the metals they use to get their job done or do their job well.

Follow

Get every new post delivered to your Inbox.