Dropbox on Linux (namely, not on Ubuntu)

Alright, don’t get excited.  This giant repository of things for me to remember is getting another update.  It will be so dazzling, that I’m sure you will say “Well… DUH!!!”  Here it is anyway.

I was looking for directions on how to get Dropbox running under Linux.  I have had reasons on one of my machines to move to Linux Mint [1].  And so I went a’googlin’ for how to install this.  And I found this page.  It’s not such a big deal except it is.

  1. When you format text for the command line, it’s always polite to make sure it can be copied and pasted
  2. See 1
  3. See me take 20 [2] minutes to do something simple.

Here’s the text without special formatting:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

And now to break it down… because that’s what I do:

  • If I need to explain “cd ~” … um…
  • wget — FTW!
  • -O — that’s oh.  OH!  As in Output file
  • – — that’s dash, as in “standard out”
  • the url.  Yay!
  • pipe.  I like pipes.
  • tar extract g-zipped filename
  • – — standard out again

Right… and after that you run ./.dropbox-dist/dropboxd and it all works.

And there we have it.  It works.  We are happy.

[1] Stupid *&^%ing Kubuntu installer does not work with a Lenovo T440p with an SSD drive.  It’s a known problem.  It’s not an old laptop.  I’m really annoyed.  Yet, Linux Mint installed flawlessly.  -1 Canonical.  -1…

[2] That includes writing this post, FWIW.


Zero (One) writing a disk in Ubuntu

Or in any other Linux, from what I know.

Do a search and most of what you’ll find is this:

dd if=/dev/random of=/dev/sdX bs=1M

The intent is for that to fill a drive with random garbage.  You are also supposed to be able to use /dev/null or /dev/zero as the input to zero-write the drive.

Quite simply, that did not work for me.  I’ve had this problem before and again I spent too long getting around to the approach that actually worked.  As for the part that didn’t work, for all I can tell this command wasn’t actually doing anything even if I let it run for hours or pointed it to a specific partition (e.g., sdh1).

The command that worked!

tr ’00’ ‘\377’ < /dev/urandom | pipebench | sudo dd of=/dev/sdX

This required installing “pipebench” (sudo apt-get pipebench …).

Essentially, this fills a drive with ones instead of zeroes.  I think the idea of that — mostly “just because”.  Piping the translation of the zeroes to ones through “pipebench” gives a benchmark of the data rate.  That allows you to estimate how long until you are done.  Finally, the output is sent to the outfile (of) which is the mount for the drive (sdX).  In about 2.5 hours that wrote a 60GB drive with all 1’s.

This command ends with a “device out of space” error, which is fine.

So, my steps were:

  1. delete all partitions
  2. create one partition for the whole drive (to change the file table)
  3. write 1’s to the entire drive

In theory, said drive is now not possible to recover short of using a professional data forensics lab.  But who’s really that interested in me anyway?


UNIX find writeable files – more creative

In a follow-up to my previous post, I got tired of typing things.  And so I came up with this script:

[findWriteableFiles.sh]

#!/bin/bash

# Put arguments into an array
#
args=$@

# If no arguments, set firt value to current dir.
#
if [ -z "${args[0]}" ]; then
  args[0]=.
fi

# Loop over supplied paths and find writeable files
#
for arg in $args; do

  find $arg -type f -perm /u=w  | grep -v "\.class" | grep -v tmp-bin | \
grep -v aTest | grep -v fixToStuff | grep -v build/ | grep -v gensrc/ | \
grep -v Reference | grep -v "~" | grep -v "classes" | grep -v "buildtree"

done

exit

My only detail to sort out was exactly how to refer to $@.  Apparently if you quote it (being exactly “$@”) that takes all the arguments as a single string.  Unquoted, it takes them separately and gets what I’m looking for.

As you can see, I also have a lot of cruft I don’t want to see in my results, so I use good ol’ “grep -v” to weed it out.  Yes, I know there is a way to use egrep to make that all one command, but for some reason it doesn’t always want to play nicely for me.  So in a classic “eff it, let the script deal with it” I just chain some pipes.  I think if I had thousands of files to sort through, this would suck.  But I don’t, so it doesn’t.


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


Follow

Get every new post delivered to your Inbox.