Tue, 20 Dec 2011

Host a Debian Package Repository on S3

The following steps can be used to create a debian package repository easily and host it on Amazon Web Services S3.

First, install reprepro, which will create the repository file structure from .deb packages. Also install s3cmd to sync a local copy of the repository to s3.

$ sudo apt-get install reprepro s3cmd

Create a directory for the repository and a conf sub-directory.

$ mkdir -p /path/to/my-repo/conf

Create the config file, conf/distributions, describing the repository. Setting Codename, Components, and Architectures are sufficient to get started. If your packages are specific to a Debian distribution (or other Debian-based distro like Ubuntu), you can set Codename to the code name of the distro, e.g. squeeze. It should not be set to stable, testing, or unstable; these can be set in the Suite option. See reprepro(1) for more details.

Codename: example
Components: main
Architectures: i386 amd64

Add a package to the repo using reprepro.

$ reprepro -b /path/to/my-repo includedeb example /path/to/package.deb 

Here are the contents of the repo after adding one package:

my-repo/
my-repo/pool
my-repo/pool/main
my-repo/pool/main/m
my-repo/pool/main/m/mypackage
my-repo/pool/main/m/mypackage/mypackage_1.0_all.deb
my-repo/dists
my-repo/dists/example
my-repo/dists/example/main
my-repo/dists/example/main/binary-i386
my-repo/dists/example/main/binary-i386/Packages.gz
my-repo/dists/example/main/binary-i386/Release
my-repo/dists/example/main/binary-i386/Packages
my-repo/dists/example/main/binary-amd64
my-repo/dists/example/main/binary-amd64/Packages.gz
my-repo/dists/example/main/binary-amd64/Release
my-repo/dists/example/main/binary-amd64/Packages
my-repo/dists/example/Release
my-repo/conf
my-repo/conf/distributions
my-repo/db
my-repo/db/packages.db
my-repo/db/release.caches.db
my-repo/db/checksums.db
my-repo/db/version
my-repo/db/references.db
my-repo/db/contents.cache.db

Configure s3cmd with your AWS credentials:

$ s3cmd --configure

Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3
Access Key [XXXXXXXXXXXXXXXXXXXX]:
Secret Key [XX+XXXXXX+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX]:

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password:
Path to GPG program [/usr/bin/gpg]:

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP and can't be used if you're behind a proxy
Use HTTPS protocol [Yes]:

You can leave the encryption password blank; you don't want to encrypt the files in the repository.

Create a bucket in S3 and sync your repository to the bucket. The bucket name must be globally unique. You will get an error if you use the name of an existing S3 bucket.

$ s3cmd mb s3://my-repo/
$ s3cmd --verbose --acl-public --delete-removed  sync /path/to/my-repo/ s3://my-repo/

Note the trailing slash after /path/to/my-repo. Without it, the my-repo folder itself will be created in your bucket.

Add the repository to your sources.list:

deb http://my-repo.s3.amazonaws.com example main

Now you can install packages from the repository:

$ sudo apt-get update
$ apt-cache policy mypackage
mypackage:
  Installed: (none)
  Candidate: 1.0
  Version table:
     1.0 0
        500 http://my-repo.s3.amazonaws.com/ example/main amd64 Packages

tech | Permanent Link

Wed, 24 Aug 2011

Housing Bubble T-Shirts

Calculated Risk points us to I ♥ The Housing Bubble t-shirts.

I decided to contribute my own.

culture | Permanent Link

Self-Employment Tax Thoughts

I filed my taxes Tuesday night. It wasn't quite the relief it usually is though. This was the first year in which my income was mostly 1099 income. That means that self-employment tax reared its big ugly head. I knew it was coming, but when it looks you in the eyes, it's still frightening. After writing off my business expenses, my total taxes were actually about $3,000 less than the rough estimate I made last year when filling out my 1040-ES. Nonetheless, I still owed the feds over $10,000 of the almost $19,000 total tax liability.

What makes the number so shocking is when you compare it to a return for which all of the income is W-2. With W-2 income, the section of the 1040 labeled Other Taxes is generally blank. As an employee, you pay 7.65% of your wages for Social Security and Medicare insurance, but this amount doesn't show up on your tax return. When your self-employed, the 15.3% tax on your net business profit shows up under Other Taxes, increasing the bottom line (line 62, that is) substantially.

One nice thing about being self-employed is being able to write off business expenses that employees typically can't. This year, I expensed gas and other automotive expenses, internet access, office supplies, part of my rent and utilities, and depreciated computer equipment and part of my car. Working from home, I don't have too many expenses so I was only able to reduce my gross income by about 6% in calculating my net profit. I was also able to write off my health insurance premiums, but that only reduces my adjusted gross income rather than business income, and thus doesn't reduce the SE tax. So I was left with a large amount of self-employment tax to pay.

In 2005, I'm going to set up and contribute to a SEP-IRA and a Health Saving Account which will reduce my income tax, but not my SE tax unfortunately. To reduce my SE tax, I may form an S Corporation. Paying myself half the corporate income in salary, which is subject to SE tax, and rest as a distribution, which is not, would probably be fair and would reduce my SE tax by quite a bit.

business » taxes | Permanent Link

Slovak Spas

Over on TJ's Weblog, they picked a company planning on opening a spa in Slovakia as one of their top 3 business plans.

TOP 3 - comes in MAGMA ZAFÍR s.r.o. that aims to develop a hot water spa in Slovakia. Central Europe has been less then well served with wellness facilities so far and has the advantage of cheap labor costs. A world-class spa for clients from Germany and Austria could easily fill a market void.

I'd be interested in reading their business plan. Slovakia already has a number of spas, and Piestany has attracted foreigners from around the world to its spas for a long time, even during Communism.

Slovaks, in general, see spas as places for the elderly and infirm, but that may start to change. When I was in Slovakia a few weeks ago, there was an article in a magazine describing a visit to a spa by a young woman. She hadn't been too thrilled about her assignment to visit and write about her experiences at a spa. She figured she had twenty or thirty years before she should start visiting spas. She was delightfully surprised by her experience and concluded that visiting spas was a great way for young professionals to relax.

I think there could be a good opportunity in marketing spas to Slovaks between 20 and 40.

business » marketing | Permanent Link

State Government Irony

The State of California publishes a booklet called Striking Gold in California. This is the most absurd name they could have come up with. Striking Gold describes the various bureaucracies to which a business must send forms and pay taxes.

Every year in California, thousands of new small businesses start up. Unfortunately, thousands of companies also go out of business each year.

The probably go out of business partially because they have to spend so much time filing forms with various government agencies, not to mention, sending them money.

The booklet is for sole proprietorships, so it doesn't cover the forms corporations must file. Here's a short list of the forms mentioned.

They forgot the 1099s that have to be filed with the IRS, the FTB and the EDD.

Also, your city or county may have tax or license requirements not covered in this publication. See the government listings in the white pages of your telephone book.

Yep, City of Los Angeles has a Business Tax of 0.5% of gross sales.

business | Permanent Link

Tue, 10 May 2011

Is Misinformed Consent Rape?

Kat at notthatkindofgirl.net was appalled by a Hornitos Tequila commercial in which it is implied that a man is about sleep with his twin brother's girlfriend while deceiving her into thinking that he is her boyfriend. She wrote the company a letter to express her displeasure.

I wrote up a comment to her post, but her WordPress blog rejected it as spam so I'll post it here:

Thanks for the thought-provoking post.  Like some of the other commenters, I
also didn't initially draw the conclusion that the scenario you describe in
the commercial was rape.  Once you made the connection, intuitively, it makes
sense to call the scenario rape.  Rape is non-consensual sex.  The woman is
consenting to have sex with her boyfriend, not his brother.  Therefore, the
brother having sex with the woman is rape.

But upon further reflection, it's not so clear to me.  The woman is giving
consent, but it is misinformed consent.  Is sex under the context of
misinformed consent always rape?

The are two aspects to the scenario that make the consent questionable:
possible intoxication and misrepresentation of the brother's identity.
Although the line where judgment is impaired through intoxication enough to
make consent non-informed may be fuzzy, most people would agree that consent is
non-informed at some point, even if the intoxication is entirely self-inflicted
and not assisted through involuntary ingestion of rohypnol or similar.
Therefore, I think the impersonation by the brother raises the more interesting
question.  So let's assume that the pair are partying with Hornitas Ginger Ale.

Is misrepresenting one's identity as a pretext for sex rape?
Suppose the guy lies and says he's Kobe Bryant and the woman agrees to sleep
with him.  Is it rape?  If not, suppose he sells her an autographed basketball
instead.  This would be fraud.  If the fraudulent basis for sex isn't rape,
what is it?

Suppose the guy proposes, promising to marry her with no intention of actually
doing so, and she agrees to sex, after which he calls off the wedding.
Suppose he does marry her with the intention of divorcing her after she sleeps
with him.
Suppose the woman lies and says she's a virgin, convincing the guy to sleep
with her.

Are these all rape?  If not, is it because the would-be victim has some
responsibility to become informed to some reasonable level before giving
consent?  In the Hornitos commercial, asking her "boyfriend" if he's really an
evil twin brother would presumably be beyond such a level of reasonableness.
What if she knew her boyfriend had a twin brother?

Finally, what if the victim gives misinformed consent with no act of
misrepresentation occurring?  Suppose the woman recognizes a man in a coffee
shop as her favorite author and goes home with him without the man being aware
of who she thinks he is.  Although I can see a case for the other scenarios
above being crimes, I can't imagine this being interpreted as a crime.

I don't have a lot of good answers at this point, but thanks again for
provoking interesting questions.

misc | Permanent Link

Tue, 15 Feb 2011

Resetting Chatter Desktop Configuration on Linux

Configuring Salesforce Chatter with an account in an org that doesn't have Chatter enabled results in an unusable app. Upon start-up, it authenticates against the org, shows an error, "Chatter is not enabled for this organization", then exits.

To restore Chatter to a state where it prompts for the org type, Default or Sandbox, I had to remove the Encrypted Local Store used by AIR apps.

$ rm -rf ~/.appdata/Adobe/AIR/ELS/sfdc-desktop.*

tech » salesforce | Permanent Link

The state is that great fiction by which everyone tries to live at the expense of everyone else. - Frederic Bastiat