January 27, 2011

Give Egyptians Access to Twitter Through Your Computer

In response to the current uprising against unjust rule in Egypt, the Egyptian government has attempted to stop the revolt by eliminating Egyptian access to Twitter and Facebook. Social networking sites such as there are the lifeblood of these movements as they dissidents to quickly share information. There is an easy, legal way to help these and other freedom fighters continue to have access to these vital services despite government oppression.

The Problem

While designed to route around censorship, the internet has certain weak links that allow governments to disrupt access to certain websites. Consider the following diagram:

In normal cases the user tries to access a website, like one of the right. To do this it goes through their local ISP, which is in the middle in this diagram. The ISP looks at the request from the user and sends it on it’s merry way.

What is happening in Egypt right now is something more like this:

In this case the user requests access to Twitter but the ISP refuses to transmit the request on to Twitter itself because the government has ordered them not to. This prevents the user from accessing and using Twitter.

The Solution

The solution is something called a proxy.

In this situation the user doesn’t try to access Twitter directly through the local ISP but instead accesses it through a proxy in a country where Twitter isn’t censored. The local ISP doesn’t realize you’re actually trying to access Twitter so they let the request go through.

Fortunately setting up a proxy is EXTREMELY easy and anyone with a computer can do it. This tutorial will explain how you can set one up.

  1. If you are running Windows visit: http://www.torproject.org/dist/vidalia-bundles/vidalia-bundle-0.2.1.29-0.2.10.exe. This will download the Tor proxy and allows you to set it up. If you’re not running Windows, the rest of this will be pretty useless to you. The Tor project does have slightly outdated guides so they may be of use to you.
  2. When the file is downloaded, open the file and if you’re asked if you really want to run the program, answer yes. Press okay, since we assume you do want to use the English language.
  3. The installer will popup. Just press next and then when a screen with the install button pops up, just press that. If you have Firefox, it might open and ask you if you want to install the Torbutton. For these purposes, you probably want to say no and then close Firefox.
  4. Go back to the installer and it should say the setup was completed successfully. Press next and then press finish.
  5. There will be a program in your taskbar which should have an onion icon and/or say Vidalia Control Panel. Click on it so you can see a window which should look something like this:
  6. Click the “Setup Relaying Button”
  7. The Settings screen will popup. On the top of the window there are a bunch of tabs. Click the one that says Sharing and the screen will look like this:
  8. Select “Help censored users reach the Tor network”
  9. The screen will now look like the following. Click on “Attempt to automatically configure port forwarding”
  10. Press the okay button on this screen and then the hide button on the main Vidalia screen. Now just use your computer as your normally do.

Dissidents will be able to use your internet connection to continue having access to Twitter and the other services they need to continue communicating. They will use only a little bit of your bandwidth.

If you want to uninstall this from your system, uninstall the program named Vidalia from your computer. If you have any problems, feel free to email me at wwahammy@gmail.com. I’m happy to help anyone set this up.

January 21, 2011

You Too Can Make A CoApp Package

We want to get everyone involved in improving and using the CoApp toolkit so I’m writing this blog post to give everyone a taste of the process for building a CoApp package. It’s not pretty and it’s not perfect right now but it’s a start and we’d appreciate any help you can provide!

Prerequisites

Before you get stared, you need to have these programs installed:

  • Visual Studio 2010
  • Windows SDK 7.0 or higher -- http://bit.ly/bOoxJT
  • Windows WDK 7.1 -- http://bit.ly/cU1lvH
  • Bazaar for Windows 2.2.0 -- http://bit.ly/d0CSvw (get the standalone installer)

Once you’ve done that, go to command line and perform the following commands:

cd c:\projects (or wherever you want to checkout the code)
md coapp
cd coapp
bzr branch lp:coapp-solution
bzr branch lp:coapp-toolkit
bzr branch lp:coapp-bootstrap
bzr branch lp:coapp-mkpackage

Open the CoApp solution in coapp-solution and build everything. Move the coapp-bootstrap.exe file from the output\x86\debug\bin folder to the output\any\debug\bin folder. We’re ready to get started!

Making a package

Let’s say you want to create a CoApp library called FunLib so developers can use all the neat functionality you’ve developed in it. All FunLib consists of is a DLL file named “funlib.dll.” You’ve built it for the x86 architecture (also called Win32). To turn this library into a CoApp package you’re going to need to create an XML file that the mkPackage tool can read.

We’ll create and a file named “funlib.xml” with the following content to get started on our package:

1 <Package xmlns="http://coapp.org/ns/mkPackage.xsd"
2 Name="FunLib"
3 Version="1.0.0.0"
4 Arch="x86">
5 </Package>

This is the shell of what will become our package file. I’ll go through each of the lines in step.

Line one simply contains the beginning of the package description with a namespace declaration. You NEED to have this xmlns tag in with that exact value. If you do not, mkPackage will reject your package!

Line two has the Name attribute which is the name of your package that CoApp uses internally. Your package name may not have spaces in it. Use an underscore instead if you want that. There is a way of having a prettier display name that a user might see in the package manager; we’ll describe that later.

Line three contains the Version attribute which holds the version of your package. The version of your package has to be of the format x.x.x.x where x is any whole number between 0 and 65534, inclusive. Let’s say though your library uses a different versioning system that includes letters, say like “Vista.” There’s also a way to display that version “number” to the package manager user, however you NEED to use a version number here like the type described.

The Arch attribute on line four is where you set the type of architecture your package is designed for. If your package is a native program, probably build in C or C++, you need to say the type of architecture it was built for. In our case you build FunLib for the x86 architecture so that’s what we put in Arch. If you built it for x64, you enter “x64” instead. If the package works on any architecture, like it if it were .NET based, you would use “any” however that hasn’t been tested even once yet so suffice it to say, it don’t work. :)

Now that we’ve got the shell of our package description set up, let’s add a role; in this case, SharedLib.

1 <Package xmlns="http://coapp.org/ns/mkPackage.xsd"
2 Name="FunLib"
3 Version="1.0.0.0"
4 Arch="x86">
5 <SharedLib>
6 </SharedLib>
7 </Package>

Each package must have one or more roles but there may only be one role per type. SharedLib is one of the types and, as one would expect, it’s for libraries that you want to be used by other libraries or programs. There’s also an AppRole which is for runnable applications and a few more which I’ll discuss in the future.

Next we’ll add the Publisher element:

1 <Package xmlns="http://coapp.org/ns/mkPackage.xsd"
2 Name="FunLib"
3 Version="1.0.0.0"
4 Arch="x86">
5 <Publisher Name="Publisher Name" PublicKeyToken="Publisher PKT" />
6 <SharedLib>
7 </SharedLib>
8 </Package>

The Publisher element describes who is creating the package. The Name and PublicKeyToken attributes correspond to the common name and public key token of the code signing certificate signing the package which you will pass in when you run mkPackage. (Remember CoApp packages must be signed!)

Let’s actually add our DLL to the package:

1 <Package xmlns="http://coapp.org/ns/mkPackage.xsd"
2 Name="FunLib"
3 Version="1.0.0.0"
4 Arch="x86">
5 <Publisher Name="Publisher Name" PublicKeyToken="Publisher PKT" />
6 <SharedLib>
7 <Assembly Arch="x86" Src="funlib.dll" Platform="win32">
8 </Assembly>
9 </SharedLib>
10 </Package>

In CoApp, SharedLib roles internally use Windows Side-by-Side or .NET assemblies to handle shared libraries. Set your Arch to “x86” in this case and for Platform enter “win32.” The Src attribute contains the path to your DLL file.

To be an assembly, your library needs to have a manifest, it’s DLL must be signed and have a security catalog. Let’s create a file named funlib.dll.manifest (in the same directory as funlib.dll) to get started:

1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3 <assemblyIdentity type="win32" name="funlib" version="1.0.0.0"
4 processorArchitecture="x86"
5 publicKeyToken="Publisher PKT"></assemblyIdentity>
6 <file name="funlib.dll" hashalg="SHA1"/>
7 </assembly>

In the assembly tag the type is “win32” which means it’s a native (non-.NET) assembly. Also, the name attribute must be the name of your dll file without the dll at the end, the processorArchitecture is again “x86,” version must match the version of the package you’re creating and the publicKeyToken must be the same public key token you entered in the Publisher element of your package description. Also inside the File tag there must be a name attribute with the filename of your dll (funlib.dll) and the hash attribute which we’re going to set to SHA1.

Now, we need to perform a couple command line actions in order get our assembly ready. First we’ll call mt from the Windows SDK:

mt.exe -manifest funlib.dll.manifest -outputresource:funlib.dll

This embeds the manifest inside the DLL. Next we sign the package using signtool, also from the Windows SDK:

signtool.exe /v /t http://timestamp.verisign.com/scripts/timestamp.dll /f sample.pfx /p password funlib.dll

Here we sign the DLL with the code signing certificate held in sample.pfx which has a password on it of “password.” Next we have to update the manifest with hashes of the signed file:

mt.exe -manifest funlib.dll.manifest -hashupdate -makecdfs

Next we’ll use the makecat tool from the Windows SDK to create a security catalog:

makecat.exe funlib.dll.manifest.cdf

Finally we sign our newly created security catalog:

signtool.exe /v /t http://timestamp.verisign.com/scripts/timestamp.dll /f sample.pfx /p password funlib.dll.cat

*phew* We’re done setting up everything we need to create an assembly. Now we just go back to our package description and add in a CatFile and Manifest elements.

1 <Package xmlns="http://coapp.org/ns/mkPackage.xsd"
2 Name="FunLib"
3 Version="1.0.0.0"
4 Arch="x86">
5 <Publisher Name="Publisher Name" PublicKeyToken="Publisher PKT" />
6 <SharedLib>
7 <Assembly Arch="x86" Src="funlib.dll" Platform="win32">
8 <Manifest Src="funlib.dll.manifest"/>
9 <CatFile Src="funlib.dll.cat" />
10 </Assembly>
11 </SharedLib>
12 </Package>
Your first package description is done! It’s time to run mkPackage and create your package:
mkPackage.exe --pfx-file=sample.pfx --pfx-password=password funlib.xml

You should have an MSI outputted which is your CoApp package. If you double click on the file, it will attempt to download and install the coapp-engine and install itself. Since the coapp-engine doesn’t currently exist, this won’t work. If you want to just see the msi install for testing right now, run this from the command line:

msiexec /i <name of msi file> COAPP_INSTALLED=1

ONLY DO THIS FOR TESTING BEFORE COAPP-ENGINE IS AVAILABLE! If you do this after that, you could cause a bunch of problems with your system!

But that was way too hard!

Yeah, we know. The SmartManifest program in development will handle a bunch of those steps, including the creating of the manifest and security catalog and signing the assembly, as well as adding in the CatFile, Manifest and Publisher elements for you. Once that’s around all you’ll have to do is create your package’s xml description, call SmartManifest and mkPackage and you’ll have a nice new CoApp Package available.

August 22, 2009

Letter to Reporter

During the period of negotiations between Mercury Marine and their employees, we’ve heard continuously of Mercury Marine’s dire financial straits. Out of curiosity, I viewed Brunswick’s quarterly report and what I found was surprising.

Mercury Marine did indeed have sales decrease over 40% from a year ago quarter and lost $7.8 million. While that sounds pretty serious, it doesn’t tell the whole picture. That loss of $7.8 million included restructuring charges of $9.6 million. Restructuring charges are one-time charges related to layoffs and worker buyouts. Often quarterly results are reported in financial media excluding one-time charges; since the charges happen once they don’t tell you much about the state of a business. If we take the very reasonable action of ignoring these $9.6 million one-time losses, Mercury Marine had a quarterly profit of $1.8 million. Let me reiterate, Mercury Marine had a PROFIT of $1.8 million in the second quarter. Mr. Schwabero didn’t mention to the media, community and the workers that Mercury Marine actually was profitable based on its operations. Did Mr. Schwabero do this to extract more painful concessions out of its workers and more generous government incentives? Mr. Schwabero, I challenge you to explain your reasoning for making your company’s financial situation seem worse than it really is.

Mercury Marine is proposing permanent wage and benefit reductions to cover a loss caused by one-time expenses. Additionally, the current financial situation is caused by a 43% downturn in outboard business versus a year ago. The market will improve substantially over the next few years. If Brunswick isn’t satisfied with Mercury’s quarterly profit $1.8 million, they can wait a few years; it’ll get better. A more equitable method of restructuring would have Mercury offer generous early retirement packages to their workers in order to reduce manufacturing capacity.

February 2, 2009

It’s just like that… except it’s not at all.

Ruben Navarrette Jr. had an apoplectic fit over increased funding for birth control in the stimulus bill. He takes issue particularly with a comment by Speaker Nancy Pelosi about how funding for birth control helps the economy:

“The family planning services reduce cost. They reduce cost. The states are in terrible fiscal budget crises now, and part of what we do for children's health, education and some of those elements are to help the states meet their financial needs. One of those -- one of the initiatives you mentioned, the contraception, will reduce costs to the states and to the federal government.”

Navarrette squeals about how this implies Pelosi support eugenics just like Margaret Sanger. But is Pelosi saying anything incorrect?

Children cost money. Maybe in Navarrette’s world they don’t but here in real world they do. They cost money to the parent for food, clothing, etc and to the government for education, health care, food stamps, etc. More children = more expenses. Pelosi is not advocating forcible sterilization like eugenicists; she’s saying kids cost money and if people have less kids, we don’t have to spend as much. It’s common fucking sense.

Navarrette seems to think there’s something racist about what Pelosi said but perhaps Dr. Martin Luther King would disagree. From his acceptance speech winning the Margaret Sanger Award from Planned Parenthood:

“The Negro constitutes half the poor of the nation. Like all poor, Negro and white, they have many unwanted children. This is a cruel evil they urgently need to control. There is scarcely anything more tragic in human life than a child who is not wanted. That which should be a blessing becomes a curse for parent and child. There is nothing inherent in the Negro mentality which creates this condition. Their poverty causes it. When Negroes have been able to ascend economically, statistics reveal they plan their families with even greater care than whites. Negroes of higher economic and educational status actually have fewer children than white families in the same circumstances.”

January 5, 2009

Aren’t Republicans FOR AIDS Relief?

With the huge stimulus package, some conservatives are crying foul over the increased debt it will require. Since the states are requesting up to $1 Trillion in funding, state Republicans are throwing in their two cents. Glenn Grothman sent out a press release saying how Doyle should cut programs instead of asking for more money. That’s not out of the ordinary. But read the second to last sentence:

“Be it their past energy package, agriculture package, transportation package, No-Child-Left-Behind program or AIDS relief, we have had enough stimuli out of Washington.” (Emphasis added).

Is Glenn Grothman OPPOSED to AIDS relief? The other complaints are just standard conservative complaints but AIDS RELIEF?! Bush’s only international success has been PEPFAR and he’s been in favor of increased foreign aid to fighting AIDS.

I called Grothman’s office and they stated that Grothman doesn’t support deficit spending and has concerns about some parts of the AIDS relief program. I mentioned that he didn’t say that, he implied that AIDS relief was not something worth spending money on and asked if Senator Grothman really wanted to take that position. They didn’t really respond.

We knew Grothman was crazy but seriously, opposed to AIDS RELIEF?

January 3, 2009

Slashdot | Overzealous AirTran Boots 9 Passengers Off

So here’s what I don’t get. Let’s say these 9 passengers were really terrorists. They’ve gone through metal, bomb and explosive detectors. What is it that they could possibly do to a plane? Yell annoyingly at others?

Slashdot | Overzealous AirTran Boots 9 Passengers Off

December 30, 2008

Sex offenders must hand over passwords - Crime & courts- msnbc.com

How much longer until we put them in camps and begin their extermination? We’re at that point almost already.

Sex offenders must hand over passwords - Crime & courts- msnbc.com

Spore is horribly single threaded

I received Spore for Christmas and so far I do like it. It’s not exactly what I had hoped but its a fun distraction. One thing that bugs me though is how often the game slows down. Entering a planet’s atmosphere becomes slower and slower as more models are no longer kept in the graphics cache. What’s odd though is that PC specs are well above the recommended system requirements for Spore. To simply explain, in the Windows Performance Ratings my computer rates at 5.2 while Spore recommends a computer rated at a 4. Why should I have a problem?

I investigated and looked at one of the most important performance bottlenecks today: the lack of multi-threaded programming. Using the Vista’s built-in performance monitor, I checked CPU core usage over 30 minutes of game time. The graph below illustrates the problem.

Spore 

Look at the core in yellow. At no point does its usage go above 20% while the purple core goes to near 100%. In short, Spore is not correctly multi-threaded. What’s silly is that model generation can be done in a totally parallel fashion since models aren’t dependent on each other. AI requires some level of connection but a large amount of the computation can be done separate.

To sum it up: EA got lazy and their customers suffer because of bad multi-core performance.

I’m back

I’m back writing my blog. No idea how long I’ll feel like doing it but here we go.

Google