Changing your hosts file in Vista

December 4th, 2008

By default, if you try to modify your hosts file in Vista, it will not let you save it.  It tells you that you don’t have permission.  To successfully modify the hosts file, run notepad.exe as an administrator and open the file.

1)  Browse to Start -> All Programs -> Accessories
2)  Right click “Notepad” and select “Run as administrator”
3)  Click “Continue” on the UAC prompt
4)  Click File -> Open
5)  Browse to “C:\Windows\System32\Drivers\etc”
6)  Change the file filter drop down box from “Text Documents (*.txt)” to “All Files (*.*)”
7)  Select “hosts” and click “Open”
8)  Make the needed changes and close Notepad.  Save when prompted.

ASP.NET Charting Control! :)

December 3rd, 2008

Microsoft recently released a cool new ASP.NET server control - <asp:chart /> - that can be used for free with ASP.NET 3.5 to enable rich browser-based charting scenarios.

LINK

Ubuntu (Hardy Heron) freezes while playing MP3

December 3rd, 2008

I believe this to be caused by a recent update to the GStreamer plugins and codecs for MP3.

To solve this problem, I had to completely remove (using Synaptic) Totem, MusicPlayer and GStreamer, reboot, and reinstall Totem.  Then open an MP3 and it’ll ask to install the GStreamer codecs.

Next time you run updates, make sure you deselect those dealing with audio.

Ubuntu on a Flash Drive (or SSD)

December 2nd, 2008

Use these tips to speed things up.  My Ubuntu boots up in 34 seconds (to login screen) from 49 seconds and loads Gnome in 6 seconds now.  My flash drive is a Super Talent 8GB SM Style USB Flash Drive, with sustained reads at 30 MB/s. and writes at around 10 MB/s (I believe).

http://wiki.eeeuser.com/yet_another_way_to_install_ubuntu_710

Squeeze Your Gigabit NIC for Top Performance

November 25th, 2008

October 24, 2007
By Charlie Schluting

Many new workstations and servers are coming with integrated gigabit (define) network cards, but quite a few people soon discover that they can’t transfer data much faster than they did with 100 Mb/s network cards. Multiple factors can affect your ability to transfer at higher speeds, and most of them revolve around operating system settings. In this article we will discuss the necessary steps to make your new gigabit-enabled server obtain close to gigabit speeds in Linux, FreeBSD, and Windows.

Hardware considerations
First and foremost we must realize that there are hardware limitations to consider. Just because someone throws a gigabit network card in a server doesn’t mean the hardware can keep up.

For attaining maximum throughput, the most important options involve TCP window sizes.

Network cards are normally connected to the PCI (define) bus via a free PCI slot. In older workstation and non server-class motherboards the PCI slots are normally 32 bit, 33MHz. This means they can transfer at speeds of 133MB/s. Since the bus is shared between many parts of the computer, it’s realistically limited to around 80MB/s in the best case.

Gigabit network cards provide speeds of 1000Mb/s, or 125MB/s. If the PCI bus is only capable of 80MB/s this is a major limiting factor for gigabit network cards. The math works out to 640Mb/s, which is really quite a bit faster than most gigabit network card installations, but remember this is probably the best-case scenario.

If there are other hungry data-loving PCI cards in the server, you’ll likely see much less throughput. The only solution for overcoming this bottleneck is to purchase a motherboard with a 66MHz PCI slot, which can do 266MB/s. Also, the new 64 bit PCI slots are capable of 532MB/s on a 66MHz bus. These are beginning to come standard on all server-class motherboards.

Assuming we’re using decent hardware that can keep up with the data rates necessary for gigabit, there is now another obstacle — the operating system. For testing, we used two identical servers: Intel Server motherboards, Pentium 4 3.0 GHz, 1GB RAM, integrated 10/100/1000 Intel network card. One was running Gentoo Linux with a 2.6 SMP (define) kernel, and the other is FreeBSD 5.3 with an SMP kernel to take advantage of the Pentium 4’s HyperThreading capabilities. We were lucky to have a gigabit capable switch, but the same results could be accomplished by connecting both servers directly to each other.

Software Considerations
For testing speeds between two servers, we don’t want to use FTP or anything that will fetch data from disk. Memory to memory transfers are a much better test, and many tools exist to do this. For our tests, we used [ttcp](http://www.pcausa.com/Utilities/pcattcp.htm).

The first test between these two servers was not pretty. The maximum rate was around 230 Mb/s: about two times as fast as a 100Mb/s network card. This was an improvement, but far from optimal. In actuality, most people will see even worse performance out of the box. However, with a few minor setting changes, we quickly realized major speed improvements — more than a threefold improvement over the initial test.

Many people recommend setting the MTU of your network interface larger. This basically means telling the network card to send a larger Ethernet frame. While this may be useful when connecting two hosts directly together, it becomes less useful when connecting through a switch that doesn’t support larger MTUs (define). At any rate, this isn’t necessary. 900Mb/s can be attained at the normal 1500 byte MTU setting.

For attaining maximum throughput, the most important options involve TCP window sizes. The TCP window controls the flow of data, and is negotiated during the start of a TCP connection. Using too small of a size will result in slowness, since TCP can only use the smaller of the two end system’s capabilities. It is quite a bit more complex than this, but here’s the information you really need to know:

Configuring Linux and FreeBSD
For both Linux and FreeBSD we’re using the sysctl utility. For all of the following options, entering the command ’sysctl variable=number’ should do the trick. To view the current settings use: ’sysctl <variable name>’

  • Maximum window size:
    • FreeBSD:
      kern.ipc.maxsockbuf=262144
    • Linux:
      net.core.wmem_max=8388608
  • Default window size:
    • FreeBSD, sending and receiving:
      net.inet.tcp.sendspace=65536
      net.inet.tcp.recvspace=65536
    • Linux, sending and receiving:
      net.core.wmem_default = 65536
      net.core.rmem_default = 65536
  • RFC 1323:
    This enables the useful window scaling options defined in rfc1323, which allows the windows to dynamically get larger than we specified above.

    • FreeBSD:
      net.inet.tcp.rfc1323=1
    • Linux:
      net.ipv4.tcp_window_scaling=1
  • Buffers:
    When sending large amounts of data, we can run the operating system out of buffers. This option should be enabled before attempting to use the above settings. To increase the amount of “mbufs” available:

    • FreeBSD:
      kern.ipc.nmbclusters=32768
    • Linux:
      net.ipv4.tcp_mem= 98304 131072 196608

These quick changes will skyrocket TCP performance. Afterwards we were able to run ttcp and attain around 895 Mb/s every time – quite an impressive data rate. There are other options available for adjusting the UDP datagram sizes as well, but we’re mainly focusing on TCP here.

Windows XP/2000 Server/Server 2003
The magical location for TCP settings in the registry editor is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

We need to add a registry DWORD named TcpWindowSize, and enter a sufficiently large size. 131400 (make sure you click on ‘decimal’) should be enough. Tcp1323Opts should be set to 3. This enables both rfc1323 scaling and timestamps.

And, similarly to Unix, we want to increase the TCP buffer sizes:

ForwardBufferMemory 80000
NumForwardPackets 60000

One last important note for Windows XP users: If you’ve installed Service Pack 2, then there is another likely culprit for poor network performance. Explained in [knowledge base article 842264(http://support.microsoft.com/?kbid=842264), Microsoft says that disabling Internet Connection Sharing after an SP2 install should fix performance issues.

The above tweaks should enable your sufficiently fast server to attain much faster data rates over TCP. If your specific application makes significant use of UDP, then it will be worth looking into similar options relating to UDP datagram sizes. Remember, we obtained close to 900Mb/s with a very fast Pentium 4 machine, server-class motherboard, and quality Intel network card. Results may vary wildly, but adjusting the above settings are a necessary step toward realizing your server’s capabilities.

Sandisk Sansa c250 2G Player Review and Sync

November 25th, 2008

I recently purchased this unit, refurbished, because it was on sale for $15 and I needed a player for the gym.  I received it yesterday evening and wanted to provide some feedback.

It’s kind of flimbsy and very light, it almost feels as if it’s hallow.  But, it has a small color screen and easy to understand controls, so I can’t really complain.  I do fear, however, that if I drop it, it will dissolve into the air.  It’s not necessarily a bad thing to be very light, but, it should be noted.

Things I don’t “really” like, but that aren’t a HUGE deal:

  • Proprietary usb connector - Instead of using USB Mini-A Type connection, they decided to use a port that took up the entire width of the unit (about an inch) to connect via USB.  Why?
  • Wasted Space - there’s a lot of space all around that could be utilized.  Either for the other controls or to space things out a little better.  This is my personal opinion, but I don’t “really” like the fact that the volume control is all the way at the top, while the play button is on the front, and then menu button all the way at the bottom right.
  • Built in Battery - This really annoys me.  Why would you do that?  Now, you MUST charge this thing at a computer, because 1) you need the special cable that only connects to USB Type A connections, and 2) there’s no other port to use to charge.  So you must charge this thing at home before leaving the house.  I wonder how long it lasts?
  • COULD NOT get it to sync as an MTP device - the device freezes (On both Vista and XP).  But I CAN get it to connect as a storage device (only on XP) where I can manually copy my songs over (which isn’t a problem for me) or manage it with WinAMP or something else.
    • Please note that to get it to connect, I enabled the HOLD (push it so it shows the orange) and held down the REWIND button, then CONNECTED the USB.  I had to do it in that order for it to work, no other worked for me.

Things I like:

  • Micro SD Slot - It’s expandable!  Yay!  This makes complete sense and is a great selling point: why not buy a device that you can upgrade as your music collection increases?!
  • LOUD - this little thing gets VERY LOUD!  A lot louder than my Creative Zen this is replacing.  Like, crazy loud.  I’m not sure I’ll ever use it louder than half way.
  • Equalizer - It has an equalizer that allows you to customize the sound (and has a custom setting for your personal preferences).
  •  Color Screen - it’s not high resolution or anything, but it’s nice to see things in color.  And the graphics aren’t half bad.
  • Music, Audio, Radio, Recordings - This unit really does it all in terms of functionality.  It definitly plays music well and recieves radio signals even inside of buildings.

I will use it for a week or two and report back.  As of right now, I give it a 7 due to the USB connection and the syncing issues (which are not unique to me).

When Computer Geeks Rap Battle…

November 24th, 2008

<djahandarie> we ain’t here to do e-c-e
<djahandarie> we’re here to do c-s-e on the w-e-b
<djahandarie> listen to me spit these rhymes
<djahandarie> while i program lines
<djahandarie> and commit web accessibility crimes
<djahandarie> word, son
<http402> You talk like your big on these I-Net kicks,
<http402> But your shit flows slower than a two-eighty-six.
<http402> I’m tracking down hosts and nmap scans,
<http402> While Code Igniter’s got you wringing your hands.
<http402> Cut the crap rap,
<http402> Or I’ll run ettercap,
<http402> Grab your AIM chat,
<http402> N’ send a PC bitch-slap!
<http402> peace
<djahandarie> you’re talkin bout down hosts and nmap scans
<djahandarie> while i got other plans
<djahandarie> you’re at your new job, but you can’t even do it right
<djahandarie> you just create a plight with your http rewrites
<djahandarie> i’ve been on the web since the age of three
<djahandarie> you just got on directly off the bus from mississippi
<djahandarie> respect yo’ elders, bitch
<http402> You’ve been webbin’ since three, but still ain’t grown up,
<http402> Gotta update your config and send the brain a SIGHUP.
<http402> You say you’re that old? No wonder you’re slow!
<http402> You’re knocking at the door while I run this show!
<http402> Elders my ass, you’re shit’s still in school,
<http402> Hunt and pecking at the keyboard like a spaghetti-damned fool,
<http402> Rim-riffing your hard drive like a tool,
<http402> Face it. I rule.
<djahandarie> i erase my harddrives with magnets (bitch)
<djahandarie> all you can do is troll on the fagnets
<djahandarie> and son, my brain’s wrapped in a nohup
<djahandarie> it wont be hurt by the words you throwup
<djahandarie> dont mind me while i emerge my ownage
<djahandarie> while you’re still over there apt-getting your porridge
<djahandarie> you say i’m still in school
<djahandarie> but the fact is that i know the rule
<djahandarie> cuz you need to go back to grade three
<djahandarie> and you better plea, that they take sucky graduates from c-s-e
<http402> Time to bend over and apply a patch,
<http402> Your brain’s throwing static like a CD with a scratch.
<http402> Your connection got nuked and you’ve met your match.
<http402> You run a single process like a VAX with a batch.
<http402> I’d pass the torch to a real winner
<http402> But it’d just scorch a while-loop spinner
<http402> Caught in a loop that you cant escape,
<http402> I run clock cycles around your words and flows,
<http402> Cuz your rhyme is like a PS fan: it’ blows,
<http402> Your water-cooled lyrics leak and it shows,
<http402> Take your ass back to alt.paid.for.windows.
<djahandarie> Good god, I can’t even respond to that. :P
<djahandarie> You win haha
* http402 takes a bow

It’s official (nearly): Iraq’s government wants America’s army out by the end of 2011

November 21st, 2008

Iraq boots out the Americans

Nov 20th 2008 | BAGHDAD
From The Economist print edition

WHEN General David Petraeus, now America’s most celebrated military commander, arrived in Iraq in 2003 at the head of an airborne division, he asked a journalist: “Tell me how this ends?” For years nobody had a good answer. But now, thanks to a military pact between America and Iraq, a conclusion is in sight: America’s war in Iraq will end in three years’ time, with American troops being shown the door and Iraqi politicians competing to claim credit for getting rid of the foreigners.

A “withdrawal agreement” approved by the Iraqi cabinet on November 16th requires American troops to pull out of Iraqi towns and cities by the end of June next year, and to leave Iraq altogether by December 31st 2011. Those deadlines, said Iraq’s prime minister, Nuri al-Maliki, in a televised address, would not be extended. The deal was not perfect, but marked “a solid start for Iraq to regain its full sovereignty in three years.”

There were no secret articles, he said, and there would be no permanent American bases. Iraq could not be used to attack others (ie, Syria or Iran). There would be, he promised, “no detainees any more, no detention centres any more, no searches or raids of buildings or houses, until there is an Iraqi judicial warrant and it is fully co-ordinated with the Iraqi government.”

This is a big moment for America and Iraq, yet the Iraqi government was more regretful than jubilant, calling the deal the best it could achieve after more than a year of negotiations. The Bush administration, now in its last weeks in power, made several concessions. It had long opposed any notion of a fixed timetable for withdrawal, saying any troop pull-out had to be based on security conditions on the ground. The White House said the new deadlines were “aspirational”, but the text leaves less wiggle-room; clauses allowing for a review of the deadline, and the possibility that some American troops would stay on to train and support Iraqi forces, have been deleted. Security has improved markedly. But the political context has also shifted against the Bush administration—and the Iraqis have got their timetable.

In America, Ike Skelton, chairman of the House armed services committee, a Democrat, said he was worried by provisions that could result in American troops facing prosecution in Iraqi courts. But the text suggests that this is a remote possibility. Iraq has legal jurisdiction over American troops only in cases of “major and intentional crimes”, and even then only when they are outside their bases and off-duty.

The agreement should make life easier for Barack Obama, although there is some dispute as to whether it will have to be ratified by the American Congress. The deal supports the president-elect’s principle of a firm timetable for leaving Iraq, but allows him to draw out the process beyond the 16-month withdrawal he promised in his campaign. Admiral Mike Mullen, chairman of the joint chiefs of staff, said America had so much equipment that it would take two or three years to withdraw completely—security conditions permitting.

The agreement was strongly endorsed by the Iraqi cabinet but its passage through the Iraqi parliament, which could vote on it as early as November 24th, is less assured. There were brawls among the lawmakers when it was discussed on November 19th.

In a country with a history of intense opposition to military pacts with an invading power, the deal could polarise opinion. Followers of Muqtada al-Sadr, the radical Shia cleric who heads a powerful (though now dormant) private army, oppose the treaty and demand an immediate withdrawal of foreign troops. Ayatollah Ali al-Sistani, Iraq’s most senior Shia cleric, says any agreement had to restore Iraqi sovereignty and win “national consensus”. But he did not oppose it, which supporters take as tacit assent.

Some Sunnis want the agreement to be put to a referendum. Another contentious issue is the status of some 17,000 (mostly Sunni) prisoners in American hands. The Iraqi government is due to take responsibility for them, but some Sunni leaders want them all released.

Iran is equivocal. The speaker of its parliament, Ali Larijani, said America was seeking to turn Iraq into a vassal. But the leader of Iran’s judiciary, Ayatollah Mahmud Hashemi Shahrudi, said the Iraqi government “has done very well”. Some interpret this as Iranian endorsement. But like so much else in Iran, it is hard to pick out a genuine signal from the political noise.

This crisis could have a happy ending

November 20th, 2008

Investor Daily: Yes, it sounds like pie-in-the-sky thinking right now. But there’s reason to think good things are in store for investors.

By Andy Serwer, managing editor

Last Updated: November 20, 2008: 8:08 AM ET

What makes a recession? 11 economies in decline
Time to buy stocks

 

 

NEW YORK (Fortune) — I was thinking about the financial mess the other day and I came up with this theory. I’m wary of it because it’s comforting, even uplifting, and by definition any economic supposition that has a happy ending is suspect. So with that caveat here goes:

I remember talking to a wise man at the end of the last decade who was pointing out to me how much the market had gone up during the 1990s and how stocks couldn’t possibly continue to go up at that rate. The market’s historical annual mean gain is about 8%, and yet between 1990 and 2000 the market had climbed some 15% per annum.

There is only one way to revert to the mean, the wise man pointed out, and that is for the market to go up less than that for quite some time. So we were looking at low single digit gains - or worse - for years.

But how could that be, I asked? Remember, the world looked pretty damn good back then. Sure tech stock prices were ridiculous, but other than that, what could possibly make the market tank? I have no idea, the wise man said, it’s just very likely to happen.

And of course it did happen. First tech stocks crashed - and for sure, a few people saw that coming. But who envisioned the horror of 9/11 and its fallout? Who saw Enron, Worldcom and the wave of corporate scandals? Who saw Hurricane Katrina? And who saw this current financial meltdown. No one did. Back then our big concern was Y2K.

At the end of 1999 the Dow was around 11,400. Today the Dow is at 8,400, which means the index has fallen some 26%, a decline of almost 3% per year. With just one year left in this decade - even if 2009 is a humdinger - it is increasingly likely that first 10 years of this century will be one big washout for investors. A lost decade. (Just fyi, if the Dow had climbed up 8% a year from 11,400, the index would be over 22,000 now.) As for the Dow since 1990 - the entire 19-year period - the market has climbed on average some 6% per year.

The next big thing: Green tech?

So what does this mean for us going forward? Well, we don’t really know, but we can make assumptions. First, at some point the carnage will end. The government and the markets will somehow figure a way out of this mess. Stabilization and confidence will return, and the economy will recover.

Second, at some point stock price returns will revert back up to the mean. In fact, to revert to the mean, stocks will at some point have to exceed the mean, in other words go up more than 8%. I know it could be years off, but you see my logic. It’s just math.

And there’s the rub. I believe that in order for the market to achieve a sustainable advance that is above the mean, we are due for some unforeseen positive event or events. Think about it. In the 1990s stocks went way up because of an unanticipated revolution in technology, i.e., networking and the Internet. In this decade we had a slew of unexpected negative events - bookended by 9/11 and this current meltdown. At some point, and it may be a few years from now, we will likely be subjected to an unforeseen positive.

What will it be? Of course no one knows. If we did, it would be priced in. But you could see how something like this might work. Take, for example, the discovery of a sustainable energy source or sources. You can see the incredible boost this would be to our economy and our markets. Imagine the geopolitical benefits. (And how it might defang our enemies.) Imagine the boost to our national psyche. And on and on.

I know you might think this is wishful thinking. And, of course, it is. Right now we are in for the toughest slog we’ve had in decades. We are going to have sacrifice in unimaginable ways. It’s probably even true that George Soros is right and that we are at the end of the era of American dominance. (That’s okay. Who wants to dominate anyway?)

The bigger point is this: Somewhere over the horizon is an unrealized economic benefit that will lift us up in a way that right now, in the gloom, we can’t even imagine. We have much work to do in the meantime, but some day it will come.

Bank bailout scorecard

November 20th, 2008

The Treasury Department is in the midst of doling out $250 billion to financial institutions nationwide as part of the $700 billion bailout plan. Here’s a list of the banks that have received checks so far.

http://money.cnn.com/news/specials/storysupplement/bankbailout/