Friday, May 10, 2013

After installing Ubuntu Server 12.04 (a noob's perspective)

Hello everyone, I just finished installing Ubuntu Server 12.04.2 LTS on my spare laptop. I basically am looking to put together a home server for fun. I think this post may be useful to people that are absolute noobs to this stuff since I'm an absolute amateur and I think I may bring up some difficulties that other new users may experience as well...

Anyway, I went through the installation of the OS to my laptop. For this I followed fairly simple instructions from "The Official Ubuntu Server Book, 2nd ed." as well as this (http://www.youtube.com/watch?v=0SgX15CpT64) video found on YouTube. There are other videos as well if needed, but honestly the process of installing the OS is fairly straight forward if you have ever installed Ubuntu before. There is one thing I would say though, when you are installing the server to your machine, I recommend you plug your machine to your router directly before you start. I started off trying to use the wifi, and that just wasn't going to happen, I only later realized that my original challenges were due to this simple fact.

Once you finish installing Ubuntu Server on your machine, reboot it and I would recommend running an update. In order to accomplish this you need to type:

sudo apt-get update
sudo aptitude safe-upgrade

This is of course all done after you have logged in with you username and password. By the way, make sure you don't forget any of the passwords you have for your server since I'm pretty sure you can't get them back later. Also if you are really new to Linux, sudo is the command you use to gain root access, which is sort of like having administrator privileges. Anytime you use "sudo" you need to use your password.

I also added vim to my server by typing

sudo apt-get install vim

I think that if you are completely new to linux commands, another important one to learn is

sudo shutdown -h now

which turns off your server, as well the command to restart your machine:

sudo shutdown -r now

The last thing I would like to mention, which is what you will need if you want to run the server headless (ie. without a keyboard or monitor directly connected to the machine), is that you need some kind of software that allows you access to your server. For that, one of the more popular options is the use of putty.exe which can be obtained at http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Once you download putty.exe, run it. There you will type your Host Name or IP address. The hostname is the machine's name you types during the installation of your OS. Make sure SSH is selected in the connection type. This will obviously only work if you have the SSH stuff installed on your server. Save a name for your session, I'm just using the server's name for reference. At this point you can select your session and click "open".

Click yes to the pop up box that will show up (PuTTY Security Alert). At this point you will get a command prompt box, where you can operate your server as if you were typing directly into it. Quite cool really for anyone like me who has never done this before.

Sunday, April 28, 2013

Waco explosion, Bangladesh factory collapse and the free market

In the wake of two recent tragedies, I think we should all revisit this idealized notion of Free Market. First there was the West Fertilizer Company explosion in Waco, Texas on April 17th. This was a very destructive explosion that has killed at least 15 people, injured 160 and damaged over 150 buildings within its blast radius. Horrible tragedy really. A study conducted after the blast, indicated that this plant was last inspected by Occupational Safety and Health Administration over 28 years ago. In this inspection almost three decades ago, the agency found several serious violations including improper storage and handling of anhydrous ammonia, and improper respiratory protection for workers. Although, this did lead to a $30 penalty for the company, which I'm sure would normally have tremendous impact on any multi million dollar operation, and of course lead to the appropriate changes.

I think it's important to remember, we're talking about Texas here. The Rick Perry state, where conservatism and capitalism are as important as the bible. This is  a perfect representation of what I think is wrong with republicans in the USA, and conservatives in my country up north. Conservatives and libertarians love to preach about the tremendous benefits of their version of a "free market". They love to say that Adam Smith's capitalism, much like Christianity, is overseen by the invisible hand. That supply and demand are the most relevant regulatory forces we need. I have a lot of problems with these notions.




While there may be measurable benefits from unregulated capitalist policies - and I'm not advocating that there is - there is a much more problematic hidden caveat. Conservatives claim that this so called "free market" is what will pull the world out of a global recession, they forget that lack of regulation is what put us in the recession in the first place. On top of that lack of regulation, is the bottom line need for profit, which is what led the factory in Waco to be holding over 100 times the allowed amount of ammonia, which arguably was a cause for such a violent explosion.

Alright, let me continue with another event from this week. I'm talking about the collapse of the garment factory in Bangladesh. This has killed over 300 people so far, causing a tremendous amount of pain to thousands of family members and friends. For those that don't follow the news, this week, on the 24th, an 8-story commercial building collapsed in Dhaka, the capital of Bangladesh. This was a building that housed several clothing factories that produce garments for exportation to industrialized nations such as the USA and Canada.



Basically this is a building that would not be allowed to be used in the industrialized world. It was dilapidated, just falling apart. There were major cracks on the walls, and clear signs of a safety problem, which even led the factory to briefly shut off the day before the event. Well, it would cost a very large amount of money to fix, or rebuild structures such as these around developing nations. It would cost a lot of money that they are unwilling to spend because that would mean they can't produce sub par t-shirts for a few cents. People! this is the direct result of several major flaws of what we call today capitalism.


    1. Capitalism is a profit driven idea  based on competition for markets. In no way I think there is a problem in this foundation, the problem with our modern view of capitalism is the importance of the bottom line, profit. Yes, of course profit should be the goal of a business, however, this should not come with lives on the price tag. Wal-Mart for instance reported a net income of 15.4 Billion dollars in 2011 with a 24.7% gross profit margin. These numbers alone are simply astounding, and I firmly believe that success stories like this are inspirational. However, when these types of profits rely on absolutely unacceptable conditions for the people behind the scenes, my view of it is certainly changes. When this 24% profit margin only exists because as consumers we accept that people in the third world are allowed to literally die to produce my cheap sweater, that I'll use gardening so I don't get my nice clothes dirty, there is a problem. I'm not at all free of guilt as consumer, but I think eventually we need to look at how to fix this problem.

    2. Businesses like Wal-Mart not only exploit the third world for profit, but they also do it by removing jobs that used to be local. They move manufacturing outside of our respective countries to places like Bangladesh. Now, that alone isn't a big deal, the problem is that fair paying jobs here in Canada and the USA are being destroyed to produce poverty sustaining jobs in the third world. So we mess up our own economy, to allow developing countries to exploit their population by giving them the absolute bare minimum.

    3. So who wins here? The big players! Massive profit margins definitely benefit the billionaires running these businesses. In terms of economic growth, our economies have been growing in the last few decades, but this growth has mainly been in the top 1%. The billionaires are getting better at making profit, and this is in part done through cutting fair paying jobs to give out unreasonably bad paying jobs in the third world.


Well, some may say, well that's just the dark side of capitalism, there isn't anything we can do. That's where I disagree. What needs to happen is regulation, and accountability. Right now in North America, there are tax benefits involved with importing goods from developing countries. The way the government sells us these benefits is almost as if they are convincing us they are doing good in the world. Of course allowing easier trade with Bangladesh will help their economy grow, where is the harm in that? The harm is in the fact that while this sounds good in theory, the reality is that across the ocean big corporations abuse the fact that there are desperate people out there in order to give them horrible working conditions for their profit. There is no oversight of these conditions by the big corporations for obvious reasons. The lack of oversight by Canada and the US is partly because of the important of economic influence (lobbying), and the lack of oversight by third world authorities is an attempt to maintain their country as a viable source of almost slave labor which does help their economies to some extent.

This is where I would like to challenge all my conservative and libertarian friends to tell me how this Ayn Rand capitalism is good for anyone besides the top dogs?

Saturday, April 27, 2013

Gas consumption over one year (Dodge Caliber 2007)


Well, this post may appear fairly arbitrary. If you know me at all, you know that I am a bit of a statistics whore and ultimately I try to graph a lot of things I am curious about. This includes my gas consumption. At first I thought, who the hell would want to know how much gas I use over a year? Well maybe someone that has the same car as I do, or someone curious about gas usage over the course of a year. Anyway, that's why I'm posting this information.

Some background:

I started driving last year when I moved from Toronto and all of a sudden I needed a job to get to work. So I have a 2007 Dodge Caliber, which I mostly use to get from home to work and the university. I live around 40Km away from work and from my school.

A very significant chunk of my driving is on the highway, most of it between 70-90 Km/h. This will obviously affect my mileage, since that range falls pretty much on the most gas efficient range for a car like mine.

 I drove somewhere between 25-30k Km in these 12 months and I change my oil every 10k Km because I have been using the synthetic stuff (mainly for convenience since the cost doesn't seem that different).


 So just to clarify the figure. Series 2 is the one that accounts for each time I pump my gas. I note how many liters of the regular gas I pump, and using that number I divide the difference in kilometers from the moment I pump the gas to my last pit stop. It may seem obvious to some, but maybe not to all.

Gas Consumption = (mileage now / mileage last time) / litres pumped

There are some missing points and whatnot, which I apologize for, I just never thought I would have to show my work to anyone as I was doing it.

Anyway, that's for series 2, series one is a moving average, basically taking into account the cumulative average, which produces a much smoother curve and an interesting trend. Note that when I began my measurements around 53K my gas consumption was around 12 Km/L. That was around March/April of 2012. The trend was definitely upwards until it peaked over the summer months. I live in Canada, so once we started to see winter my consumption went up; and then once snow started to be a factor, well you can tell when that happened.

Anyway, the data isn't perfect, but it does give a nice little clue on how my car performs over the year, also gives me a good grasp of how much gas I'm burning with this vehicle. I hope this is useful to someone at some point, if I get some feedback on this I might do my next little project, which will be looking at creating some data for the gas dial in my car so that I can perhaps compare different speeds and different scenarios to see what's the most efficient way to drive for me.

Tuesday, April 16, 2013

The structure of a neuron

The neuron is a very specialized type of cell that serves to process and transmit information within the nervous system. Much like other cell types, neurons are surrounded by a phospholipid bilayer that acts as the cellular membrane. Within the membrane, one can find various proteins such as receptors, ion channels, transporters and signalling molecules. These proteins serve as an interface between processes occurring within the cell and external changes which illicit specific responses from the cell. For instance, different types of neurons have different sets of receptors that allow specific ligands to bind in order to signal the cell to respond appropriately, which may involve the opening of an ion channel which allows the natural ionic flow based on either concentration gradients or electric potential gradients between the inside of the cell and the outside of the cell.

Structurally, neurons can be very different from other cells. They are composed of a cell body, dendrites, axons and presynaptic terminals. The cell body is where the bulk of the cellular metabolism occurs and it is where the majority of the organelles are located. It contains the nucleus, which stores genetic material as well as the endoplasmic reticulum that is involved in protein synthesis. The golgi apparatus is located outside of the nucleus, and it is where proteins are processed, packaged and labelled. This is an important organelle, which directs proteins coming from the endoplasmic reticulum to their respective destinations within the cell or outside of the cell (secretion). Much like other cells, neurons also rely on the mitochondria for cellular respiration where ATP is produced. Other organelles found in neurons are lysosomes, responsible for the processing and degradation of cellular waste; and peroxisomes used for the breakdown of lipids to eliminate potentially harmful toxins.

The cytoskeleton is what determines the shape of a neuron. It contains three important filamentous structures, namely microtubules, neurofilaments and actin microfilaments. Microtubules provide a structural framework for the cell as well as having involvement in the transportation of molecules along axons. This is often done with the help of kinesins, kinectins and dyneins which serve as motor proteins along the microtubules. Neurofilaments are the “bones of the cytoskeleton”, which unlike microtubules, are very stable. Actin microfilaments are the smallest of the three types of fibers. They are usually found in short polymer species and they form the cellular matrix. Microfilaments are involved in the growth and development of axons; much like microtubules, they exist in a dynamic state.

From the cell body, usually two kinds of processes can be found, dendrites and axons. Dendrites are relatively small branching structures filled with knobby projections called dendritic spines. Dendrites are the main apparatus for receiving incoming signals from outside the neuron. The axon on the other hand are long extending processes that conducts signals for the purpose of communicating with other cells. The axons are capable of moving electrical currents (action potentials) of up to 100mV in amplitude from the cell body to the appropriate destination. These action potentials are initiated in a specialized region of the axon called the axon hillock, and is carried down the axon much like electricity in a copper wire. Myelinated axons are wrapped in myelin sheaths that serve as electrical insulators, increasing the speed of AP transmission. Nodes can be found between myelin segments where membrane proteins can be found. Lastly, axons terminate in synaptic knobs called buttons, where granules or vesicles are stored and secreted upon the arrival of action potentials.

Protein synthesis in neurons occurs in organelles called ribosomes, where the translation of mRNA into polypeptide sequences occurs. Following the translation of proteins, protein folding occurs where the amino acid sequence forming the protein will determine its native conformation. This can be done spontaneously or with the assistance of molecular chaperones. In many cases, post-translational modifications are often needed before the protein takes its active form. The movement of proteins inside neurons can be more challenging than in other cells, and often requires the use of the previously mentioned molecular motors that allow proteins to be carried along long axons.

Ganong WF (2005). Review of Medical Physiology, 22nd edition. McGraw-Hill

Kandel ER, Schwartz JH, Jessell TM (2000). Principles of Neural Science, 4th edition. New York: McGraw-Hill

Kalisch B (2013). Lecture notes for NEUR6000: Lecture #1 on 2013-01-10. Retrieved from CourseLink at Guelph.

Monday, April 8, 2013

You are a pirate

Recently it dawned on me that my needs for pirating have changed greatly since I started doing it, back in the Napster years. Pirating was something that began as a bit of a desire to have digital content such as music, videos, games and general software. As a teenager and eventually a university student, I just wouldn't be able to afford all these things. Once I got a job, and began my career I started to be able to afford things and I also started to feel the need to support things I cared about. I had heard the opinions of some many publishers and musicians that despite losing money from this practice, still supported it.

The first one I can remember, actually came from Fred Durst who always supported music sharing because it is how a lot of his music and the music of his peers even began to gain popularity. At the time I was a musician myself, and I voluntarily placed my music on Napster and similar services, in the hopes that if my music was linked to other popular artists I would be able to get it out. Obviously that didn't work for me in the end. The industry's attitude towards piracy has always been negative, of course because they make less money, however this is clearly an attitude of self interest, and of capitalist greed rather than a true desire to expand the reaches of the art. Also, what's even the point of trying to fight a war that has already been lost. All this pointless effort does is cost millions of dollars, affects greatly the few that actually get sued by these companies and in the end gets them nowhere.

Another great example from the industry for me was Notch, the Swedish game developer responsible for Minecraft. He basically said that he doesn't mind pirating. He made this game that eventually became very successful and the main reason for his success was efficient sharing of his content. Notch said that he prefers that people play an enjoy his game even if it is pirated. Obviously he prefers if people pay for it, but in the end, he would prefer someone playing the game for free than not playing it at all. It obviously gives him great personal satisfaction. Now, to be completely honest, when I first heard of Minecraft I thought "I don't get why this game is good". I was still intriged by it's sudden popularity during the beta days. So I downloaded it in torrent form. I played it for a week or so and decided it was good, so I purchased a license of the beta game. That wasn't the last time I did that either.



In the end, fighting against piracy is futile. Instead intelligent folks like Gaben and the guys behind Netflix decided to use the change in the industry to make money. They have been extremely successful and I gladly pay for their services. I have no problem paying money to support services trying to improve customer experience during a time where so many others are losing money.

Another big change in my downloading practices is that I started to pay money to pirate things. I dislike the idea of anti piracy efforts so much, and the anti privacy policies involved so much, that I rather pay for a third party to provide me with annonymity, than to pay for the media I'm wanting to use, just not enough to pay for it. This has an upside and a downside. On the downside, these anti piracy moves threaten the very essence of the internet. It threatens the greatest advancement in humanity of the last century, which is now the core that moves information, disseminating it over our ever shrinking world. Which means we have to continue to fight to maintain our cybernetic freedom. On the upside, I think this fear produced causes people to be more careful and make them attempt to protect themselves as well as educated themselves. Me, I learned all about networks like Usenet, which is a history lesson as well. I learned about VPNs, and how to hide behind proxies. All very useful information in this age where we are quickly becoming more vulnerable.

++

Anyone, just to wrap this post up here is a relevant video http://www.youtube.com/watch?v=bEBbu-wkKrs

Why Japan is the most interesting story in global economics right now

I know reposting is lazy, but it's been a crazy semester with my masters and a full time job... also, it's a great article so it's not so bad.
++





Through the last six years of rumbling global financial crisis, Japan has been an afterthought. In 2008, the world’s second-largest (soon to be third-largest) economy was still dealing with the consequences of its own banking crisis from the 1990s, its economy mired in a generation of economic stagnation and low-level but persistent deflation. If you had taken a snapshot of the Japanese economy in 2002 and again in 2012, you wouldn’t have missed much.
How quickly that has changed. A new government took office the day after Christmas, led by prime minister Shinzo Abe, pledging to, in effect, go whole-hog on the Keynesian remedies for Japan’s long recession, particularly by pushing for a combination of fiscal stimulus on a mass scale, and, through appointment of Haruhiko Kuroda as governor of the Bank of Japan; he has pledged to do “whatever it takes” to get annual inflation to 2 percent in a country where inflation has averaged -0.3 percent since 2000. The Japanese stock market is on a tear and the yen has been falling steeply on currency markets, exactly the kind of reaction the BOJ hopes to see.

There is a lot riding on Haruhiko Kuroda's new leadership at the Bank of Japan--and not just for Japan.

There is a lot riding on Haruhiko Kuroda’s new leadership at the Bank of Japan–and not just for Japan. (Haruyoshi Yamaguchi/Bloomberg)
There is a great deal riding on their success, and not just for the 128 million residents of Japan. Because Japan has quite suddenly become perhaps the best natural experiment that economics could offer for weighing how the United States and Western Europe ought to respond to their own economic woes.

There are a series of open questions that have haunted those who argue for a more aggressive Keynesian prescription of easy money and fiscal stimulus in the United States and Europe. I’ll limit it to the two most important: Can a central bank always create higher inflation in a depressed economy, or will lots of money-printing just affect asset prices and the international value of the currency without affecting the real economy? And can public debt levels reach a “tipping point” in a large country that has its own central bank and considerable domestic demand for its bonds, which would in turn make fiscal stimulus risky when there is already high debt relative to GDP?
One of the great challenges of macroeconomics is that different countries and their economic situations are so different that it is hard to directly apply lessons from one to another. And crises in particular don’t happen all that often, so we have even fewer examples to go on as to how best to respond to them.

All the United States economy circa 2008 and Thailand circa 1998 really have in common is that both experienced some form of crisis; they are such wildly different countries economically, and their crises had such wildly different causes, that it isn’t particularly useful to judge what policies the U.S. should take on by what happened the East Asian crisis a decade earlier.
But Japan is a different story. It is a large, advanced economy, which has been grinding through the results of its own banking and financial crisis. Its story has been more one of year-after-year of stagnant growth than one of outright depression.  It has control over its currency, and its citizens’ demand for government bonds is deep enough that it simultaneously has the highest debt to GDP ratio in the world and the lowest interest rates (which is quite a trick).
In effect, Japan is a cautionary tale of  what the United States, Britain, and continental Europe could become if the major Western powers can’t jolt ourselves out of a long period of economic stagnation.
Shinzo Abe and Haruhiko Kuroda can’t magically make Japan’s corporate giants more competitive on the world stage, such as by making Sony competitive with Samsung in the market for smart phones or bringing back a world where Toyota could make significantly better cars that Hyundai. But their policies to depreciate the yen could give those companies a leg up in the global marketplace in terms of their cost structure that they have not had in ages; the yen has fallen from around 80 to the dollar in the runup to Abe’s Liberal Democratic party winning the elections to scraping 100 to the dollar (the exchange rate was 98.61 on Monday).

But it would be wrong to view this effort as riskless. On one hand, the efforts to return inflation could be too successful, increasing borrowing costs for the Japanese government and, in the process, making its huge debt of twice GDP exceptionally hard to maintain. On the other hand, the Bank of Japan’s easing could again prove to be not up to the task.

If everything works as planned, Japan’s industrial will return on the back of a weaker yen, an improving economy will improve its deficit picture, and the nation will soon have a goldilocks economy of prices rising about 2 percent a year and debt to GDP levels coming down. If things go awry, we could soon be staring at the mother of all sovereign debt crises. Whatever path the Japanese economy takes, it is one that will have lessons and implications for all of us.

Saturday, March 16, 2013

Anonymous exposing presidential election vulnerabilities

I just found this neat artile on Tom's Hardware and figured it was interesting enogh to share:

Earlier this month, hactivist group Anonymous announced (PDF) that it helped put President Barack Obama back into office for another 4-year term by preventing Republican activist and Fox News anchor Karl Rove from electronically stealing votes from Obama supporters. The group claims that Rove somehow laid tunnels through voter tracking software that would have switched votes from Obama over to Romney in at least three states.

"We began following the digital traffic of one Karl Rove, a disrespecter of the Rule Of Law, knowing that he claimed to be Kingmaker while grifting vast wealth from barons who gladly handed him gold to anoint another King while looking the other way," the group said. "After a rather short time, we identified the digital structure of Karl's operation and even that of his ORCA."

Anonymous said that Rove "left the barn doors wide open", meaning the digital tunnels the Fox News anchor had supposedly established were left unsecured, granting any hacker easy access into the voter tracking system. Thus the group created what it called The Great Oz, a targeted password protected firewall to keep additional hackers, including Karl Rove, out.

"We placed this code on more than one of the digital tunnels and their destinations that Karl's not-so-smart worker bees planned to use on election night," they wrote. "We noticed that these tunnels were strategically placed to allow for tunnel rats to race to the server sewers from three different states. Ah yes, Karl tried to make it appear that there were more than three but we quickly saw the folly of his ploy."

Anonymous said that once the firewall was established, Karl's "speared ORCA whale was beached", as his team of supposed hackers, obviously hired to alter voting in Romney's favor, tried to penetrate the firewall and failed exactly 105 times.

"We have a warning for Karl," the group said. "Sail again at your peril. We may just put all the evidence into a tidy little package and give it to a painfully bored nemesis hanging out in a certain embassy in London."

The announcement claims that Rove's ORCA was discovered at 10am EST on November 6, and then speared by The Great Oz later on at 8pm EST. The group also hints to previously stolen elections which "resulted in terrible destruction across the globe", thus provoking the group into following Rove's data trail. The Examiner also points out that Ohio suffered server problems on November 6 at around 11pm, mirroring an identical situation in Ohio that took place in 2004.

While we won't jump into politics, the claim made by Anonymous poses a good question: can the system used to track votes be fully trusted in an age where servers and firewalls are breached seemingly every week, exposing sensitive data owned by companies and individuals? And if the Anonymous story is true, then how did Rove get into the system and install his pipeline? Did someone give him access or was this an actual hack?
Something tells us that we'll find out soon enough.

--
Here is the original article for anyone interested