These are exciting times to be a practitioner of Computer Science!
For past several decades, Computer Science has been changing our lives at an unprecedented rate, so much so that we call the phenomena as information revolution, at par with agricultural revolution and industrial revolution. What is more, while the agricultural revolution happened over a few centuries, and industrial revolution happened over around a century, information revolution is happening in the timescale of decades, thus allowing us to experience the changes within our lifetimes.
What makes computers so powerful? What makes computers connected to the internet even more powerful? Calculators too can calculate, but they don't have as dramatic impact on our lives. Data transfer is possible by means other than internet, but that too does not impact our lives quite so dramatically as the internet.<1>To be fair, printed books, radio and television did impact our lives in very significant ways, but the impact is smaller compared to the impact of the internet.
Information ingestion, manipulation and storage are the requirements for survival of any living being. Consider a bird for example. It must take in information via vision and sound, manipulate it (to locate food items, nest, or predators), and also store the information (for example, it needs to remember the location of its nest). Humans are no different. Whether it be trade, war, love, sport or politics: information ingestion, manipulation and storge plays a key role in our activities.
Various inventions help humans in information ingestion (like camera, television), information manipulation (like calculators) and information storage (like books). Computer systems, however, dramatically increase the capacity of ingestion, manipulation and storage. Furthermore, computer systems continue to increase these three aspects continuously, thus enabling newer problems that can be solved using computers.
Let's have a look at various metrics related to computers, and appreciate the tremendous rate at which some of have been growing.
First let's look at information ingestion rates per online user.
| Year | Global Internet Traffic_1 | Number of online users_2 | Data transfer per day per online user (col1 / col2) |
| 1992 | 100 GB per day | 4 million | 25MB |
| 1997 | 100 GB per hour | 70 million | 34MB |
| 2002 | 100 GB per second | 600 million | 14GB |
| 2007 | 2,000 GB per second | 1200 million | 144GB |
| 2016 | 26,600 GB per second | 3600 million | 638GB |
| 2021 | 105,800 GB per second | 5400 million | 1.7TB |
That's an astounding 53% annual growth rate in data transfer per online user!
Secondly, the processing power of computers has been growing consistently for decades. The celebrated Moore's law (It is more of an empirical fact) that the number of transistors in an integrated circuit doubles every 18 months. Number of transistors roughly corresponds to the speed of the computers.
As a result of increasing miniaturization of transistors, clock speeds have kept increasing, as shown in figure xyz. Figure abc shows how many multiplications a computer could perform in various years.
Computer Science has been transforming the way we live at an increasingly rapid pace since 1960s. First, there has been the revolution of micro processors. From a 4 bit, 740KHz microprocessor in 1971, to 64, 2 GHz, multi core processors today, the speed of microprocessors has relentless increased, along with accompanying increase in capacity and decrease in cost of RAM and disks.
Similar is the case with storage capabilities of the computers. Back in 1981, Bill Gates famously said that "640KB ought to be enough for everybody", and today in 2017, AWS offers a machine on the clount which has 19TB of memory! That is a growth rate of roughly 50% per year, sustained for over 35 years! Disk space has similarly grown
Similar is the case with increasing hard disk capacities, and internet bandwidth.
Above phenomena at the hardware level led to creation of software enabling a myriad number of use cases.
No party goes on forever and no field grows on for ever. 1920s and 1930s was the period when rapid advances were made in Quantum Physics. Indeed, in a popular photograph taken at 1927 Solvay Conference, you can spot many physiciscs whose names are familiar to any one who has taken a university level Physics course: Einstein, Schrodinger, Pauli, Heisenberg, Dirac, Neils Bohr, Max Plank, Marie Curie are all present in that photograph, considered to be the photograph with the most intelligent picture ever taken.
However, as Quantum Mechanics matured, the rate of development of Physics slowed down in 1940s and more so in coming decades. While Physics of course continues to progress, and we periodically hear noises around Large Hadron Collider and God Particles, the rate of discovery is nowhere close to early 1900s.
Similar is the story of aviation. Wright brothers' first flight was in 1903, capping the human flight attempts essentially since the dawn of humanity. First commercial flight was in 1914, while first transatlantic flight was in 1919. Humans continued to master how to fly, and by 1960s we were out in space, landing on the moon in 1969.
Looking at all this progress, people were speculating that we might soon be vacationing on the moon and flying to Mars. However, the progress in aviation and space flight got stalled: no human has yet landed on the Mars and flights to Moon are quite rare. Infact, there have only been 6 manned missions to Moon!
Computer Science is one of the most exciting fields today, and the main engine of technological advancement that we see today. The world is getting connected very fast, and computers keeping better, enabling newer and newer applications. Rapid advance in artificial intelligence are bringing up applications which we have imagined only in fiction. While no one can be sure where this will ultimately lead us to, the journey is surely exciting for those make this happen.
[[Chhaya: There is disconnect here]]Writing any non trivial piece of software is hard. As the software becomes more complex, the rate at which you can modify it becomes slower, and the chances of introducing a bug in it become larger.
Software engineers and managers are well aware of this, and thus, in any reasonable sized company, there is an emphasis on testing. Large companies have large Quality Assurance departments. In behemoths like Microsoft, strength of testing team rivals the strengths of development teams: there is often 1 tester per developer. The code is frozen several months before the release, and only bug fixes are allowed after the freeze. This is so that the QA department can test the code thoroughly. This speaks volumes about how we much confidence we have in the software that we write.
The field of software engineering is not alone in being complex: any worthwhile human enterprise is complex: it takes months or years to devise experiments for Large Hydron Collider, and peer review for path breaking papers in Mathematics takes several months too. However, there is something unique about software engineering: at each stage we spend large amount of effort in debugging the software, and yet the quality of the software that comes out is often less than desirable:
Why is writing software so complex? Can't we be a little more careful and write correct code? The complexity of software arises from two fundamental reasons.
First, humans have a capability to hold a limited amount of state in their brains. In his paper "The Magical Number Seven, Plus or Minus Two: Some Limits on Our Capacity for Processing Information", George A. Miller, a cognitive psychologist at Princeton University, posits that human beings are able to hold between five and nine pieces of information at a time. Give them more than that and things start falling apart.
You have experienced this yourself: if I ask you to remember a random sequence of digits, you will have difficulty in remembering it once the length of sequencey goes beyond eight or nine digits.
In the game of chess, this is known as blunder. Novice players often see that their particular piece, say Queen, is under attack, and they are fully aware that they need to do something about it. However, when they start exploring various possible lines, they sometime tend to forget that their Queen is under attack, and make a silly move at the end. This is because we have a limited capacity to hold state in our head.
Computers are giant state machines. The content on the hard disk, the memory, various caches and the processor registers constitutes the state, and various instructions are rules to change the state from one to another. This giant machine is abstracted to the programmer in the form of variables and objects. Since writing correct program, depends on the developer's comprehension of the information that the variables hold, he is likely to write incorrect code as the number of variables increase. In a give context, there may be hundreds of variables that the developer may be exepected to keep track of.
The second reason why it is difficult to write correct programs is that the developers are often ill aware of the contexts in which the program will be used. Your program expects a number, but the user may enter a string. Your program may be written for ascii characters, but the user may enter the value in their own (non English) characters. In any software design, there are some implicit assumptions about size and scale. A simple program meant to multiply two numbers might not be able to multiply to 100 digit numbers (if you use int or long as data type). A simple web server running on a small server cannot handle the request rate of millions per second.
So, software development is inherently complex. It is not that individual programmars are lazy or incomptent: software development is inherently hard for humans. Were it a stateless activity, like typing, we could become good at it. Were the number of states fewer, like in driving, we could have a much better accuracy. Humans are much better at driving compared to coding: There are only about 20 deaths per billion miles driven, while there are "15-50 errors per 1000 lines of delivered code": https://softwareengineering.stackexchange.com/questions/185660/is-the-average-number-of-bugs-per-loc-the-same-for-different-programming-languag And in case you are getting complacent that driving safely is more important than writing bug free code, be aware that computer code is handling medical equipments, driving cars and controlling satellites. It is a wonder that the Earth is spinning on its axis despite so much bug ridden software floating around.
So, the question is: given that computer programming is not a natural activity for us humans, what do we do to still deliver a high quality software?
There is a three pronged strategy that software developers need to follow to deliver high quality software:
Since software development is bug prone because it is complex, we strive to reduce the complexity of the software. Further since software is complex because of large state involved, we strive to reduce the number of states that we have to deal with.
The general principle of reducing the number of states that we deal with can be applied at various levels, from coding style to architecting the systems.
While coding, you should strive to have fewer variables in the function (each variable is a state), name each variable suitable (to enable better association in our brains). Use fewer conditions, because code inside the conditionals has more state information to be tracked compared to the code outside the conditionals. Nested ifs are even worse. We will consider several techniques to reduce complexity in one of the upcoming chapters.
At architectural level too, we try to reduce complexity by deduplicating information between components, and reusing code across components.
Secondly, however hard we may try, software that we write will always contain problems, ranging from silly mistakes to lack of understanding about the system should work. As we write our code, we also write test cases to protect against erroneous future modifications. Whenever we find a bug in the production, we add a test case so as to avoid the appearance of the same bug in future.
Lastly, even after thorough testing may not reveal problems related to the lack of foresight of developers about how the code will be actually used. The input provided to the program may be in a different format than assumed by the developers, network requests may time out or provide unreasonable responses and so on. Thus, it is important that we monitor the behavior of the code in production.
In the coming chapters we will see how to do development, testing and monitoring to deliver quality software at a fast rate.
While the principles of software development remain the same irrespective of the size or stage of a company, startups exhibit some unique characterstics which dictate some of the choices that developers should take. Firstly, startups struggle to find the product market fit. Thus, the product that you make may not take off. Thus the emphasis is on building quickly rather than building perfectly, so as to enable more iterations of various feature development. At the same time, you want to be cognizant of the possibility that your product may turn out to be useful, and if that happens, then you have to scale up while users are using your project. Some people find it akin to jumping off a plane and building a parachute on your way down.
Secondly, since there are fewer team members in a startup, many problems that happen due to large team sizes simply do not exist. Thus, using tools meant for larger teams may be counter productive.
Thirdly, except for startups building niche products, skill requirements in a startup require more breadth than depth, when compared to a large company. Thus, while in a big company, developers may not need to know about testing or deployment, in a startup, a single engineer may be managing all all of these.
Fourthly, in big companies you are often dealing with legacy code. A lot of effort goes in understanding the existing code, and in making sure your code does not harm. In a smaller company there is much less legacy to deal with (and an opportunity to make sure that the code is easy to understanding for upcoming generations!), and thus development can be faster.
Thus, while the suggestions given in this book are for most part applicable to companies of all sizes, they are written with startups in mind, and some of them may not be applicable to large teams.
Like the parables the blind men and an elephant, Software engineering means different things to different people. -caption- The parable, originating in India, is that six blind men, who knew nothing about an elephant, found one and started learning what it is by touching it. Each man touches a different part of the elephant, and forms his opinion on that basis. The moral is that each of us may be partially right about some matter.
I see software engineering problems falling in four broad categories: algorithmic, design, scalability and systems. There are fractions of these components in all the problems, so a given problem does not fall in exactly one of these categories, but may involve components from all to varying degrees.
Algorithmic problems are about coming up with algorithms for hard problems. How to you translate speech to text? How do you sort a billion numbers in a short amount of time? How can you detect numbers in images? Google, in its intial phase when it wrote a search engine, would be an example of such a company. Its main product was the implementation of page rank algorithm. Another example would be Swift Key, a keyboard extension for mobile phones, an app that predicts and auto corrects what you are typing on your mobile device.
Another set of algorithmic problems are designing compression algorithms (which are used by tools such as gzip, bzip or snappy) and cryptographic algorithms (which are used, for instance by protocols such as SSL)
People good in solving algorithms problems are usually good in Mathemtics too. Indeed a lot of algorithm techniques, like machine learning, require a grounding in higher mathematics such as probability, statistics, calculus and linear algebra.
The second kind of problems are design problem. Algorithm might be clear, but the challenge is to organize the code in such a way that real world requirements can be delivered fast, and the resultant code is of high quality (few bugs) and is maintanable. Suppose you want to make a software for a bank. You need to model customers, accounts, fixed deposits, bank branches, bank employees etc. What class structure would you make? What interfaces would you require? How do you gather the requirements, and how do you test the code. Nothing is intrinsically hard (unlike the algorithmic problem), but you need to design and organize your code well.
Example of such a problem would be writing a web development framework like Python Django, or Ruby on rails. Another example would be popular single page application frameworks like React or AngularJS.
People working on design problems like to talk about design patterns, fitting well known patterns to solve their specific problems. They may also talk about dependency injection, which is about writing code in a way that it is easily testable. They spend time discussing various interfaces and subclasses. They may also talk about microservices, in which each services is isolated from each other for easy development.
Third kind of of problems in computer science are scalability problems. The task to be done might be quite straightforward, both algorithmically and from design perspective, but simple solutions may cease to work, or required too much hardware as the load on the system increases.
A typical problem would be designing a simple data ingestion system, which receives requets on HTTP and puts the data in a database. A straight forward solution might be coded up in a few hours (or even a few minutes), but it may take weeks or months to scale it as per your needs.
People talking about scaling problems talk about using caches (to avoid repeated computations). They talk about batching and bulk operations, serving several requests together to amortize the resource usage. They talk about load balancers (using a software to route the requests to one of many systems) and auto scaling of server fleet in cloud (which is sizing the number of servers as per the current load, to not spend more money on servers than required). They also talk about consistent hashing, which enables sizing up and down of machines holding hashed data, so that number of misses are minimized when you resize your fleet and the hashing function changes accordingly.
Lastly, there are "systems" problem solving which requires deep knowledge of computer systems, and the solution too does not directly solve a real world problem, but creates a tool which can be used to solve a real world problem. These problems are designing and implementing a compiler, for example. Or perhaps an operating system. An amazing company solving a systems problem is my alma-mater VMware.
Finally, note that most problems often have all these characterstics, to varying charcterstics. And the proportion of these characterstics changes with the evolution of a company.
For instance, Facebook started with, hardly being a computer science problem (How hard it is to put pages, showing a everyone's profile and allowing others to comment on it?), but as it evolved, it became a design problem. There are people and pages and feed items and ads and notifications and so on. How these various systems interact with each other, how should various database be designed is a grand design problem. Then, Facebook faced scalability problems as well as its servers were required to serve pages to millions of users. As it evolved facebook solved several algorthmic problems (such as how to detect faces in a photos so as to prompt users to tag them, and how to show a personalized feed to each other so that users are engaged). Along the way, facebook solved several systems problem too, like designing Hiphop compiler to translate PHP code to C++ to reduce infrastructure costs.
Similarly Google started by solving an algorithmic problem, but along the way solved scalability problems and systems problem. And when a system is sufficiently complicated you need it well designed.
This book, while applicable to all types of startups, is most applicable to those which are heavy in the design and scalability aspects.


--- layout: page title: About header-img: "img/about-bg.png" ---
The author began developing software in the early 80's for technology companies such as Lockheed, Northrop, Magnavox and IBM. Now, after several years away from the field he is re-entering a very different environment (although the fundamentals remain in place).


The Laravel Event
class provides a simple observer implementation, allowing you to subscribe and listen for events in your application.
Event::listen('auth.login', function($user)
{
$user->last_login = new DateTime;
$user->save();
});
$event = Event::fire('auth.login', array($user));
You may also specify a priority when subscribing to events. Listeners with higher priority will be run first, while listeners that have the same priority will be run in order of subscription.
Event::listen('auth.login', 'LoginHandler', 10);
Event::listen('auth.login', 'OtherHandler', 5);
Sometimes, you may wish to stop the propagation of an event to other listeners. You may do so using by returning false
from your listener:
Event::listen('auth.login', function($event)
{
// Handle the event...
return false;
});
So, you know how to register events, but you may be wondering where to register them. Don't worry, this is a common question. Unfortunately, it's a hard question to answer because you can register an event almost anywhere! But, here are some tips. Again, like most other bootstrapping code, you may register events in one of your start
files such as app/start/global.php
.
If your start
files are getting too crowded, you could create a separate app/events.php
file that is included from a start
file. This is a simple solution that keeps your event registration cleanly separated from the rest of your bootstrapping. If you prefer a class based approach, you may register your events in a service provider. Since none of these approaches is inherently "correct", choose an approach you feel comfortable with based on the size of your application.

When registering an event listener, you may use asterisks to specify wildcard listeners:
Event::listen('foo.*', function($param)
{
// Handle the event...
});
This listener will handle all events that begin with foo.
.
You may use the Event::firing
method to determine exactly which event was fired:
Event::listen('foo.*', function($param)
{
if (Event::firing() == 'foo.bar')
{
//
}
});

In some cases, you may wish to use a class to handle an event rather than a Closure. Class event listeners will be resolved out of the Laravel IoC container, providing you the full power of dependency injection on your listeners.
Event::listen('auth.login', 'LoginHandler');
By default, the handle
method on the LoginHandler
class will be called:
class LoginHandler {
public function handle($data)
{
//
}
}
If you do not wish to use the default handle
method, you may specify the method that should be subscribed:
Event::listen('auth.login', 'LoginHandler@onLogin');

Using the queue
and flush
methods, you may "queue" an event for firing, but not fire it immediately:
Event::queue('foo', array($user));
Event::flusher('foo', function($user)
{
//
});
Finally, you may run the "flusher" and flush all queued events using the flush
method:
Event::flush('foo');

Event subscribers are classes that may subscribe to multiple events from within the class itself. Subscribers should define a subscribe
method, which will be passed an event dispatcher instance:
class UserEventHandler {
/**
* Handle user login events.
*/
public function onUserLogin($event)
{
//
}
/**
* Handle user logout events.
*/
public function onUserLogout($event)
{
//
}
/**
* Register the listeners for the subscriber.
*
* @param Illuminate\Events\Dispatcher $events
* @return array
*/
public function subscribe($events)
{
$events->listen('auth.login', 'UserEventHandler@onUserLogin');
$events->listen('auth.logout', 'UserEventHandler@onUserLogout');
}
}
Once the subscriber has been defined, it may be registered with the Event
class.
$subscriber = new UserEventHandler;
Event::subscribe($subscriber);
You may also use the Laravel IoC container to resolve your subscriber. To do so, simply pass the name of your subscriber to the subscribe
method:
Event::subscribe('UserEventHandler');


We got hacked! Now what?
Almost a year ago, I experienced my first real security incident. The company's bulletin board was compromised and it was my job to oversee and coordinate the incident response. The teams and I where pretty much thrown into the cold water, as we've never experienced an incident of that size before.
Right after the incident I wrote the following blog post, which I'm now able to publish. Please note that I didn't change anything deliberately, as I wrote it back


| About Dailyrotten |
|
Feedback
If you like this page, hate it, or would like to suggest changes,
<EMAIL_ADDRESS>is listening. This page
is experimental and somewhat different from what we usually offer, so please
do send your feedback.
Adding Stories
If you are a rotten newshound and you would like to suggest a story,
visit our submit page to
send us the URL. Stories that are accepted will have your name credited.
Viewership
On the first full day this page went live, 100,000 people visited this Rotten
News page. Of course that was the day after the WTC attacks, so that number is
somewhat distorted. Right now this page gets between 50,000 and 75,000 people
every day.
Linking
We encourage everyone to link to this page; if you like it, others probably
will as well.
Other Rotten
Rotten
Gaping Maw
Celebrity Morgue
Mugshots
Rotten Store
Shockumentary
Rate My Poo
Rate My Kitten
Rate My Finger
Penny Postcards
Phallic
Dr. Sputnik
Boners
Dead Pool
NNDB
Home
Make Dailyrotten your start page
|
|
|
July 31, 2003
Stalin attempted to whack John Wayne
Independent Online | Submitted by: Tim Howard
"Soviet dictator Joseph Stalin was so outraged by the anti-communistic attitude of film star John Wayne that he tried to have him assassinated. A new biography of the American icon -- John Wayne: The Man Behind the Myth by British writer and actor Michael Munn -- says there were several attempts in the late 1940s and early 1950s to kill the man known to movie audiences worldwide as 'The Duke.' ... The book says the Soviet plots were cancelled after Stalin's death in 1953 by his successor Nikita Krushchev who was a fan of the larger-than-life star of more than 100 films."
|
|
Read article...
|
|
Woman gives birth on Boston mass-transit
Boston Globe | Submitted by: ringo
"A 42-year-old Braintree woman gave birth to a baby boy while standing on an inbound Red Line train yesterday morning, refusing help from stunned passengers who heard her moan and seconds later looked down to find her baby on the floor. ...  At one point, Judge took some nearby newspapers and placed them on the floor to soak up the blood. Some witnesses heard Judge apologize for the mess."
|
|
Read article...
|
|
John Poindexter is about to quit
Houston Chronicle | Submitted by: Reid Fleming
"John Poindexter, the Iran-Contra scandal figure who headed two criticized Pentagon projects, including one that would have enabled investors to profit by predicting terrorist attacks, will quit his post within weeks, defense officials said today. ... Disclosure of his planned departure from the Defense Department came just two days after Defense Secretary Donald Rumsfeld terminated a Defense Advanced Research Projects Agency, or DARPA, project supervised by Poindexter for a potential futures trading market in predictions of assassinations, terrorism and other events in the Middle East. ... Poindexter served as President Ronald Reagan's national security adviser in the 1980s."
|
|
Read article...
|
|
Anti-terror programs expanding into non-terror applications
Washington Post | Submitted by: Reid Fleming
"A passenger-screening system designed to help capture terrorists could also be used to target people suspected of violent crimes... The new proposal shows that officials intend to use the system -- potentially the largest surveillance network created by the government -- more broadly to keep dangerous people off planes. That could include people wanted for domestic terrorism or violent crimes. Anyone flagged by the system would receive extra screening or, in some circumstances, be detained. ... David L. Sobel, general counsel at the Electronic Privacy Information Center, said he worries that CAPPS II will become a 'massive enforcement mechanism.' 'It opens the door for invasive background checks on all citizens,' Sobel said."
|
|
Read article...
|
|
White House: Condoleezza Rice wasn't lying, exactly
Baltimore Sun | Submitted by: Adam Wilks
"The congressional report on pre-Sept. 11 intelligence calls into question answers that National Security Adviser Condoleezza Rice gave the public last year about the White House's knowledge of terrorism threats. ... President Bush's adviser told the public in May 2002 that a pre-Sept. 11 intelligence briefing for the president on terrorism contained only a general warning of threats and largely historical information, not specific plots, the report said. But the authors of the congressional report, released last week, stated the briefing given to the president a month before the suicide hijackings included recent intelligence that al-Qaida was planning to send operatives to the United States to carry out an attack using high explosives."
|
|
Read article...
|
|
Bush kills nuclear advisory group
Guardian | Submitted by: A. P. Palled
"A US department of energy panel of experts which provided independent oversight of the development of the US nuclear arsenal has been quietly disbanded by the Bush administration, it emerged yesterday. The decision to close down the national nuclear security administration advisory committee -- required by law to hold public hearings and issue public reports on nuclear weapons issues -- has come just days before a closed-door meeting at a US air force base in Nebraska to discuss the development of a new generation of tactical 'mini nukes' and 'bunker buster' bombs, as well as an eventual resumption of nuclear testing. ... The committee's charter said that its meetings 'will be held approximately four times each year.' In fact, it was not summoned at all in the last year of its existence."
|
|
Read article...
|
|
Bank apologises for praising Hitler
BBC | Submitted by: Julian Jowl Mullet Masta
"A Chicago bank has apologised after praising Adolf Hitler as a great economic leader. Glenview State Bank said it had received "many letters and calls" from people offended by its July economic newsletter, which credited sound economic policies for the German boom of the 1930s -- a decade when most economies were in severe depression. ... 'We sincerely apologise for this error. We did not intend to offend anyone. Please forgive us for this mistake,' the bank wrote in an apology posted on its website."
|
|
Read article...
|
|
TSA apologizes to passenger, pledges improvements
Philadelphia Inquirer | Submitted by: Reid Fleming
"The U.S. Transportation Security Administration has promised to make changes to its Federal Air Marshal service and admits that two officers erred last year when they arrested a South Asian passenger in Philadelphia. ... On Aug. 31 last year, Rajcoomar, 56, of Lake Worth, Fla., a naturalized citizen, was forcibly taken from his first-class seat on Delta Flight 442 after the jetliner landed in Philadelphia from Atlanta. He was grabbed by two Federal Air Marshals who had just held the cabin at gunpoint for a half-hour because of a disturbance by another passenger."
|
|
Read article...
|
|
Israel bans mixed marriage
Guardian | Submitted by: Adam Wilks
"Israel's parliament on Thursday passed a new law that would force Palestinians who marry Israelis to live separate lives or move out of Israel despite charges from human rights groups and Israeli Arabs that the law is racist. The law would prevent Palestinians from the West Bank and Gaza Strip who marry Israeli Arabs from obtaining residency permits in Israel.
|
|
Read article...
|
|
Elephant taken to Tennessee, fed doughnuts
Los Angeles Daily News | Submitted by: Adam Wilks
"It's bad enough that Ruby the elephant was whisked away from her longtime companion at the Los Angeles Zoo for solitary confinement in Knoxville, Tenn., animal rights activists said Wednesday. The 9,000-pound pachyderm is now being tossed glazed Krispy Kreme doughnuts. ... The Tennessee Network for Animals claims Ruby has been confined for nine weeks to a small cage atop a shadeless concrete pad -- with neither exercise nor companionship. An observer said she saw zoo keepers feed Ruby doughnuts."
|
|
Read article...
|
|
Nobody talking about executive order 13303
Earthrights International | Submitted by: Katie
"President Bush has issued an Executive Order, so far completely unreported, that purports to grant broad legal immunity to oil companies operating in Iraq. ... Executive Order 13303, issued on May 22, 2003, claims to be essential to Iraqi reconstruction efforts. A cursory reading of the Order indicates that its real purpose is to protect oil companies by giving virtual impunity for any activities undertaken relating to Iraqi oil."
|
|
Read article...
|
|
Guatemala burning, America only vaguely aware
counterpunch.com | Submitted by: Adam Wilks
"All hell is breaking loose in Guatemala and few outside that tragic nation seem to care or even notice. ... Led by FRG militants, the crowds, including many members of the Guatemalan army, have marched on the nation's courts, opposition parties and newspapers, torching buildings, shooting out windows and bullying opponents of the Bible-spouting dictator. ... Hooded men ransacked buildings, fired machine guns from SUVs, smashed windows and set fire to cars and piles of tires. The situation in Guatemala City became so chaotic over the weekend of July 26th that the both the UN mission and the US embassy were closed."
|
|
Read article...
|
|
Bush overdue for monthlong vacation
news8austin.com | Submitted by: Adam Wilks
"Fundraisers will help will fill President Bush's schedule during his month-long working vacation at his ranch near Crawford. In August, Bush will mix public policy events with six fund-raisers -- in Colorado, California, Oregon, Washington and Minnesota. The practice allows the administration, in certain cases, to bill taxpayers for half the travel costs of the political activity."
|
|
Read article...
|
|
Daughter sent to stay with man who molested her
Centre Daily | Submitted by: JuTravler
"A couple allowed a relative who had been convicted of molesting their 10-year-old daughter to babysit the girl, police said. Police have charged the parents, who live in Hopewell, with endangering the welfare of a child for allowing Ronald E. Dodson, 53, of Saxton, to watch the girl two years after he was convicted of molesting her. ... Dodson, who is the father's uncle, was sentenced in 2001 to four years' probation and a $500 fine. He was still on probation when he allegedly molested the girl this spring."
|
|
Read article...
|
|
Grandparents beat, rape, cage, starve 3-year-old
iAfrica | Submitted by: Tim Howard
"A three-year-old White River girl was locked in a cage while her grandparents allegedly sexually assaulted her and failed to provide for even her most basic needs, Mpumalanga police said on Wednesday. Visser said that when police went to investigate they found the girl had already been removed from the cage. However, she said there was evidence the child had been battered with sticks or other weapons and had been sexually assaulted. It also seemed the child had no clothes of her own and had to beg naked for food. She slept on bits of plastic in the cage."
|
|
Read article...
|
|
Guard dog blocks emergency workers from saving owner
Houston Chronicle | Submitted by: Tim Howard
"A Russian man paid the price for training his guard dog too well when the snarling animal held off paramedics long enough for him to die of heart failure. The ferocious Staffordshire bull terrier kept doctors at bay as they tried to approach the middle-aged patient Wednesday. 'Doctors and the man's wife tried to approach the man for a long time, but the dog was furious and would not allow it,' Andrei Rudomyotov, a regional police chief, said by telephone from the city of Chelyabinsk near the Ural mountains."
|
|
Read article...
|
|
California spending on $400,000 on Quetzalcoatl
World Net Daily | Submitted by: Adam Wilks
"Opponents of an AIDS memorial designed in the form of the Aztec god Quetzalcoatl thought they had scored a victory when California Assembly members removed a line from the state budget that reappropriated $400,000 for the project. But through last-minute maneuvers, backers of the controversial plan managed to set aside the taxpayer money by shifting the project from the budget bill, passed Tuesday, to a trailer bill where it was buried at the bottom of a collection of unrelated items."
|
|
Read article...
|
|
Tourists turning Italian churches into dumps, open latrines
Chicago Sun-Times | Submitted by: Tim Howard
"Monsignor Timothy Verdon, on the staff at Florence's Duomo, or cathedral, held a news conference this week to denounce the lack of respect shown to that church. He decried the dozens of souvenir vendors outside the cathedral's exit and the messy trash cans in the piazza, 'which are already spilling over by midday.' Even worse, Verdon added, officials at several churches in Florence, a city renowned for grace and beauty, say that the areas around their churches have been transformed into 'open toilets.' 'There's always more and more bums and tourists sleeping outside,' Livi said in a telephone interview Wednesday. 'The tourists sit on the steps and leave all the crumbs.'"
|
|
Read article...
|
|
Trans-Atlantic rower calls Mommy for help
Independent Online | Submitted by: Tim Howard
"A Frenchman attempting to row across the Atlantic called his mother for help as he sat atop his capsized boat in rough waters 160km off Cape Cod, the head of the American Ocean Rowing Society said on Tuesday. Emmanuel Coindre, who set off for France from the coast of Massachusetts last week, capsized early on Monday due to inclement weather and used a satellite phone to call for help as the boat took in water. 'After five hours (trying to right the boat) he phoned his mother in France who called the French coast guard who called the US Coast Guard.'"
|
|
Read article...
|
|
Tom Daschle, blogger
argusleader.com | Submitted by: Adam Wilks
"Tom Daschle is coming soon to a blog near you. The Senate minority leader and South Dakota Democrat will post a daily diary on his official Web site as he drives around the state next month during Congress' annual August recess, he said Wednesday. ... The blogging idea came from aides, inspired by the growing popularity of the informal journals. Hundreds of thousands of people around the country write blogs... 'My staff told me a while back about a blog,' Daschle said. 'I learned a new word. ... This new blog concept appealed to me.'"
|
|
Read article...
|
|
Ecstasy unconscionably overpriced in Toronto
toronto.cbc.ca | Submitted by: Kareeshus
"Police busted a massive drug lab in Scarborough Tuesday, seizing almost 100,000 ecstasy pills with an estimated street value of $22 million dollars." $22,000,000 divided by 100,000 equals $220 per pill.
|
|
Read article...
|
|
Gay party to become Death Penalty Party
iAfrica | Submitted by: Tim Howard
"The Gay and Lesbian Alliance (GLA) on Thursday voted in favour of a name and identity change to the Death Penalty Party of South Africa (DPP). Party leader Juan-Duval Uys said the 19-2 vote in favour of the name change was taken during a national executive board meeting. He said the party's members would 'continue to exist' as the 'lesbigay' league of the newly formed DPP. The DPP would campaign for the death penalty to be reinstalled. It would also campaign for the rights of criminals to be restricted and for rapists to be castrated."
|
|
Read article...
|
|
|
|
|


“Verily verily, I say to you, there will come a time when every interesting quotation will be ascribed to me. Do not believe it.”
-Albert Einstein
Much like the piano song “Fur Elise” is attributed to Bach or Mozart (and occasionally Beethoven), every mildly interesting quotation has at some time been ascribed to Einstein.
Call it Einstein’s Law: The more a sentence is witty, wonderous, cute, and slightly smart, the more likely it will eventually be ascribed to Einstein.”


You should have Docker properly installed on your machine. Check Docker installation guide for details.
First, pull the official jenkins image from Docker repository.
docker pull jenkins
Next, run a container using this image and map data directory from the container to the host; e.g in the example below /var/jenkins_home
from the container is mapped to jenkins/
directory from the current path on the host. Jenkins 8080
port is also exposed to the host as 49001
.
docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins/jenkins
Addtionally, you can configure nginx as a reverse proxy to your Jenkins instance, e.g.
upstream app { server <IP_ADDRESS>:49001; } server { listen 80; server_name jenkins.your-domain.com; location / { proxy_pass http://app; } }
Attachments:
jen.JPG (image/jpeg)


OPGPROF
Section: User Commands (1)Updated: Fri 22 June 2012
Index Return to Main Contents
NAME
opgprof - produce gprof-format profile dataSYNOPSIS
opgprof [ options ] [profile specification]
DESCRIPTION
opgprof outputs gprof-format profile data for a given binary image, from an OProfile session. See oprofile(1) for how to write profile specifications.
OPTIONS
- --help / -? / --usage
-
Show help message.
- --version / -v
-
Show version.
- --verbose / -V [options]
-
Give verbose debugging output.
- --session-dir=dir_path
-
Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile).
- --image-path / -p [paths]
-
Comma-separated list of additional paths to search for binaries.
This is needed to find modules in kernels 2.6 and upwards.
- --root / -R [path]
-
A path to a filesystem to search for additional binaries.
- --threshold / -t [percentage]
-
Only output data for symbols that have more than the given percentage
of total samples.
- --output-filename / -o [file]
-
Output to the given file instead of the default, gmon.out
ENVIRONMENT
No special environment variables are recognised by opgprof.FILES
- /var/lib/oprofile/samples/
-
The location of the generated sample files.
VERSION
- This man page is current for oprofile-0.9.7.
-
SEE ALSO
/usr/share/doc/oprofile-0.9.7/, oprofile(1)
Index
This document was created by man2html, using the manual pages.
Time: 05:29:07 GMT, December 24, 2015


Manchester United intend to ‘rush things’ on potential signing – Know price is rising quickly
by Tom CoastManchester United and Roma are in many talks these days, mostly about Chris Smalling.
However, if Il Messaggero are to be believed, then there could be also be some for Nicolò Zaniolo in the near future.
At least, that’s what they hint at, as they claim the Old Trafford side are very interested in the Italian playmaker, sending a scout to supervise him and Sandro Tonali in Italy’s 9-1 drubbing of Armenia on Monday.
Zaniolo walked away with two goals and an assist, and it’s made clear that he was the main reason for the trip, as they have followed his progress since the start of 2019, ending up in their sights after his double against Porto in the Champions League.
Il Messaggero believe it’s Manchester United’s intention to ‘rush things’ as they know that every game the youngster plays, the higher his price goes.
Since they are already in talks with Roma over Chris Smalling, it’s said they might as well ‘try right away’ to at least get some sort of option from the Serie A club while they have them there.
It’s not a bad idea, and considering Zaniolo can comfortably play down the right hand side, an area where Manchester United have struggled to find anyone adequate for quite some time, why not try and sign him while his price is still within range?


Messi goal gives Argentina 1-0 win over Brazil
by ReutersLionel Messi returned from international suspension to score the winner in Argentina's 1-0 victory over Brazil in Saudi Arabia on Friday.
The Barcelona striker, who missed four games after calling the South American Football Confederation "corrupt," scored after 14 minutes to give Argentina a deserved victory in the so-called Superclasico.
The result extended Brazil’s winless run to five games since they lifted the Copa America in July, their worst such run since 2013.
Brazil beat Argentina 2-0 the last time these teams met in the Copa America semi-finals and they should have taken a ninth minute lead but Gabriel Jesus fired a penalty kick wide after he had been brought down in the box.
Argentina were also awarded a penalty five minutes later and although Brazilian keeper Alisson saved Messi's initial effort, the Barcelona striker followed up to put Argentina 1-0 ahead.
Messi missed two chances to double Argentina's lead before halftime, with defender Eder Militao and Alisson blocking the opportunities.
Brazil, who were without Paris St Germain striker Neymar, had two-thirds of the possession but rarely threatened the Argentine goal in a game that featured 41 fouls and six yellow cards.
Argentina, meanwhile, looked more sprightly, even without Sergio Aguero and Paulo Dybala, both of whom were unused substitutes.
Argentina have now won three of the five games they have played since their semi-final exit at the Copa America.


Source code for sphinxcontrib.websupport.storage
# -*- coding: utf-8 -*-
"""
sphinxcontrib.websupport.storage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Storage for the websupport package.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
[docs]class StorageBackend(object):
[docs] def pre_build(self):
"""Called immediately before the build process begins. Use this
to prepare the StorageBackend for the addition of nodes.
"""
pass
def has_node(self, id):
"""Check to see if a node exists.
:param id: the id to check for.
"""
raise NotImplementedError()
[docs] def add_node(self, id, document, source):
"""Add a node to the StorageBackend.
:param id: a unique id for the comment.
:param document: the name of the document the node belongs to.
:param source: the source files name.
"""
raise NotImplementedError()
[docs] def post_build(self):
"""Called after a build has completed. Use this to finalize the
addition of nodes if needed.
"""
pass
def get_metadata(self, docname, moderator):
"""Get metadata for a document. This is currently just a dict
of node_id's with associated comment counts.
:param docname: the name of the document to get metadata for.
:param moderator: whether the requester is a moderator.
"""
raise NotImplementedError()
[docs] def get_data(self, node_id, username, moderator):
"""Called to retrieve all data for a node. This should return a
dict with two keys, *source* and *comments* as described by
:class:`~sphinxcontrib.websupport.WebSupport`'s
:meth:`~sphinxcontrib.websupport.WebSupport.get_data` method.
:param node_id: The id of the node to get data for.
:param username: The name of the user requesting the data.
:param moderator: Whether the requestor is a moderator.
"""
raise NotImplementedError()
[docs] def process_vote(self, comment_id, username, value):
"""Process a vote that is being cast. `value` will be either -1, 0,
or 1.
:param comment_id: The id of the comment being voted on.
:param username: The username of the user casting the vote.
:param value: The value of the vote being cast.
"""
raise NotImplementedError()
[docs] def update_username(self, old_username, new_username):
"""If a user is allowed to change their username this method should
be called so that there is not stagnate data in the storage system.
:param old_username: The username being changed.
:param new_username: What the username is being changed to.
"""
raise NotImplementedError()


Get an up-close look at the challanges and triumphs of space exploration in Journey to Space: The Exhibition. Opens June 18.
Bigger and better than ever. See how we're turning the heat up this summer with brand new camps and classes.
From a brand new camp to high-end technology, summer is going to rock.

Journey to Space: The Exhibition launches June 18
Buy Tickets >Other screens just won't do after catching a show in the state's biggest sounding, most tech-forward theater.
Did you know we show Hollywood movies in the evening?
Now Playing >From OMSI After Dark to giant festivals, see the museum like never before.
Look at the sky differently from one of our Star Parties.


Documents Ganeti version 2.12
Contents
This document serves as a more example-oriented guide to Ganeti; while the administration guide shows a conceptual approach, here you will find a step-by-step example to managing instances and the cluster.
Our simulated, example cluster will have three machines, named node1, node2, node3. Note that in real life machines will usually have FQDNs but here we use short names for brevity. We will use a secondary network for replication data, <IP_ADDRESS>/24, with nodes having the last octet the same as their index. The cluster name will be example-cluster. All nodes have the same simulated hardware configuration, two disks of 750GB, 32GB of memory and 4 CPUs.
On this cluster, we will create up to seven instances, named instance1 to instance7.
Follow the Ganeti installation tutorial document and prepare the nodes. Then it’s time to initialise the cluster:
$ gnt-cluster init -s <IP_ADDRESS> --enabled-hypervisors=xen-pvm example-cluster
$
The creation was fine. Let’s check that one node we have is functioning correctly:
$ gnt-node list
Node DTotal DFree MTotal MNode MFree Pinst Sinst
node1 1.3T 1.3T 32.0G 1.0G 30.5G 0 0
$ gnt-cluster verify
Mon Oct 26 02:08:51 2009 * Verifying global settings
Mon Oct 26 02:08:51 2009 * Gathering data (1 nodes)
Mon Oct 26 02:08:52 2009 * Verifying node status
Mon Oct 26 02:08:52 2009 * Verifying instance status
Mon Oct 26 02:08:52 2009 * Verifying orphan volumes
Mon Oct 26 02:08:52 2009 * Verifying remaining instances
Mon Oct 26 02:08:52 2009 * Verifying N+1 Memory redundancy
Mon Oct 26 02:08:52 2009 * Other Notes
Mon Oct 26 02:08:52 2009 * Hooks Results
$
Since this proceeded correctly, let’s add the other two nodes:
$ gnt-node add -s <IP_ADDRESS> node2
-- WARNING --
Performing this operation is going to replace the ssh daemon keypair
on the target machine (node2) with the ones of the current one
and grant full intra-cluster ssh root access to/from it
Unable to verify hostkey of host xen-devi-5.fra.corp.google.com:
f7:…. Do you want to accept it?
y/[n]/?: y
Mon Oct 26 02:11:53 2009 Authentication to node2 via public key failed, trying password
root password:
Mon Oct 26 02:11:54 2009 - INFO: Node will be a master candidate
$ gnt-node add -s <IP_ADDRESS> node3
-- WARNING --
Performing this operation is going to replace the ssh daemon keypair
on the target machine (node3) with the ones of the current one
and grant full intra-cluster ssh root access to/from it
…
Mon Oct 26 02:12:43 2009 - INFO: Node will be a master candidate
Checking the cluster status again:
$ gnt-node list
Node DTotal DFree MTotal MNode MFree Pinst Sinst
node1 1.3T 1.3T 32.0G 1.0G 30.5G 0 0
node2 1.3T 1.3T 32.0G 1.0G 30.5G 0 0
node3 1.3T 1.3T 32.0G 1.0G 30.5G 0 0
$ gnt-cluster verify
Mon Oct 26 02:15:14 2009 * Verifying global settings
Mon Oct 26 02:15:14 2009 * Gathering data (3 nodes)
Mon Oct 26 02:15:16 2009 * Verifying node status
Mon Oct 26 02:15:16 2009 * Verifying instance status
Mon Oct 26 02:15:16 2009 * Verifying orphan volumes
Mon Oct 26 02:15:16 2009 * Verifying remaining instances
Mon Oct 26 02:15:16 2009 * Verifying N+1 Memory redundancy
Mon Oct 26 02:15:16 2009 * Other Notes
Mon Oct 26 02:15:16 2009 * Hooks Results
$
And let’s check that we have a valid OS:
$ gnt-os list
Name
debootstrap
node1#
Now that the cluster is created, it is time to check that the hardware works correctly, that the hypervisor can actually create instances, etc. This is done via the debootstrap tool as described in the admin guide. Similar output lines are replaced with … in the below log:
$ /usr/lib/ganeti/tools/burnin -o debootstrap -p instance{1..5}
- Testing global parameters
- Creating instances
* instance instance1
on node1, node2
* instance instance2
on node2, node3
…
* instance instance5
on node2, node3
* Submitted job ID(s) 157, 158, 159, 160, 161
waiting for job 157 for instance1
…
waiting for job 161 for instance5
- Replacing disks on the same nodes
* instance instance1
run replace_on_secondary
run replace_on_primary
…
* instance instance5
run replace_on_secondary
run replace_on_primary
* Submitted job ID(s) 162, 163, 164, 165, 166
waiting for job 162 for instance1
…
- Changing the secondary node
* instance instance1
run replace_new_secondary node3
* instance instance2
run replace_new_secondary node1
…
* instance instance5
run replace_new_secondary node1
* Submitted job ID(s) 167, 168, 169, 170, 171
waiting for job 167 for instance1
…
- Growing disks
* instance instance1
increase disk/0 by 128 MB
…
* instance instance5
increase disk/0 by 128 MB
* Submitted job ID(s) 173, 174, 175, 176, 177
waiting for job 173 for instance1
…
- Failing over instances
* instance instance1
…
* instance instance5
* Submitted job ID(s) 179, 180, 181, 182, 183
waiting for job 179 for instance1
…
- Migrating instances
* instance instance1
migration and migration cleanup
…
* instance instance5
migration and migration cleanup
* Submitted job ID(s) 184, 185, 186, 187, 188
waiting for job 184 for instance1
…
- Exporting and re-importing instances
* instance instance1
export to node node3
remove instance
import from node3 to node1, node2
remove export
…
* instance instance5
export to node node1
remove instance
import from node1 to node2, node3
remove export
* Submitted job ID(s) 196, 197, 198, 199, 200
waiting for job 196 for instance1
…
- Reinstalling instances
* instance instance1
reinstall without passing the OS
reinstall specifying the OS
…
* instance instance5
reinstall without passing the OS
reinstall specifying the OS
* Submitted job ID(s) 203, 204, 205, 206, 207
waiting for job 203 for instance1
…
- Rebooting instances
* instance instance1
reboot with type 'hard'
reboot with type 'soft'
reboot with type 'full'
…
* instance instance5
reboot with type 'hard'
reboot with type 'soft'
reboot with type 'full'
* Submitted job ID(s) 208, 209, 210, 211, 212
waiting for job 208 for instance1
…
- Adding and removing disks
* instance instance1
adding a disk
removing last disk
…
* instance instance5
adding a disk
removing last disk
* Submitted job ID(s) 213, 214, 215, 216, 217
waiting for job 213 for instance1
…
- Adding and removing NICs
* instance instance1
adding a NIC
removing last NIC
…
* instance instance5
adding a NIC
removing last NIC
* Submitted job ID(s) 218, 219, 220, 221, 222
waiting for job 218 for instance1
…
- Activating/deactivating disks
* instance instance1
activate disks when online
activate disks when offline
deactivate disks (when offline)
…
* instance instance5
activate disks when online
activate disks when offline
deactivate disks (when offline)
* Submitted job ID(s) 223, 224, 225, 226, 227
waiting for job 223 for instance1
…
- Stopping and starting instances
* instance instance1
…
* instance instance5
* Submitted job ID(s) 230, 231, 232, 233, 234
waiting for job 230 for instance1
…
- Removing instances
* instance instance1
…
* instance instance5
* Submitted job ID(s) 235, 236, 237, 238, 239
waiting for job 235 for instance1
…
$
You can see in the above what operations the burn-in does. Ideally, the burn-in log would proceed successfully through all the steps and end cleanly, without throwing errors.
At this point, Ganeti and the hardware seems to be functioning correctly, so we’ll follow up with creating the instances manually:
$ gnt-instance add -t drbd -o debootstrap -s 256m instance1
Mon Oct 26 04:06:52 2009 - INFO: Selected nodes for instance instance1 via iallocator hail: node2, node3
Mon Oct 26 04:06:53 2009 * creating instance disks...
Mon Oct 26 04:06:57 2009 adding instance instance1 to cluster config
Mon Oct 26 04:06:57 2009 - INFO: Waiting for instance instance1 to sync disks.
Mon Oct 26 04:06:57 2009 - INFO: - device disk/0: 20.00% done, 4 estimated seconds remaining
Mon Oct 26 04:07:01 2009 - INFO: Instance instance1's disks are in sync.
Mon Oct 26 04:07:01 2009 creating os for instance instance1 on node node2
Mon Oct 26 04:07:01 2009 * running the instance OS create scripts...
Mon Oct 26 04:07:14 2009 * starting instance...
$ gnt-instance add -t drbd -o debootstrap -s 256m -n node1:node2 instance2
Mon Oct 26 04:11:37 2009 * creating instance disks...
Mon Oct 26 04:11:40 2009 adding instance instance2 to cluster config
Mon Oct 26 04:11:41 2009 - INFO: Waiting for instance instance2 to sync disks.
Mon Oct 26 04:11:41 2009 - INFO: - device disk/0: 35.40% done, 1 estimated seconds remaining
Mon Oct 26 04:11:42 2009 - INFO: - device disk/0: 58.50% done, 1 estimated seconds remaining
Mon Oct 26 04:11:43 2009 - INFO: - device disk/0: 86.20% done, 0 estimated seconds remaining
Mon Oct 26 04:11:44 2009 - INFO: - device disk/0: 92.40% done, 0 estimated seconds remaining
Mon Oct 26 04:11:44 2009 - INFO: - device disk/0: 97.00% done, 0 estimated seconds remaining
Mon Oct 26 04:11:44 2009 - INFO: Instance instance2's disks are in sync.
Mon Oct 26 04:11:44 2009 creating os for instance instance2 on node node1
Mon Oct 26 04:11:44 2009 * running the instance OS create scripts...
Mon Oct 26 04:11:57 2009 * starting instance...
$
The above shows one instance created via an iallocator script, and one being created with manual node assignment. The other three instances were also created and now it’s time to check them:
$ gnt-instance list
Instance Hypervisor OS Primary_node Status Memory
instance1 xen-pvm debootstrap node2 running 128M
instance2 xen-pvm debootstrap node1 running 128M
instance3 xen-pvm debootstrap node1 running 128M
instance4 xen-pvm debootstrap node3 running 128M
instance5 xen-pvm debootstrap node2 running 128M
Accessing an instance’s console is easy:
$ gnt-instance console instance2
[ 0.000000] Bootdata ok (command line is root=/dev/sda1 ro)
[ 0.000000] Linux version 2.6…
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] Xen:<PHONE_NUMBER>000000 -<PHONE_NUMBER>800000 (usable)
[13138176.018071] Built 1 zonelists. Total pages: 34816
[13138176.018074] Kernel command line: root=/dev/sda1 ro
[13138176.018694] Initializing CPU#0
…
Checking file systems...fsck 1.41.3 (12-Oct-2008)
done.
Setting kernel variables (/etc/sysctl.conf)...done.
Mounting local filesystems...done.
Activating swapfile swap...done.
Setting up networking....
Configuring network interfaces...done.
Setting console screen modes and fonts.
INIT: Entering runlevel: 2
Starting enhanced syslogd: rsyslogd.
Starting periodic command scheduler: crond.
Debian GNU/Linux 5.0 instance2 tty1
instance2 login:
At this moment you can login to the instance and, after configuring the network (and doing this on all instances), we can check their connectivity:
$ fping instance{1..5}
instance1 is alive
instance2 is alive
instance3 is alive
instance4 is alive
instance5 is alive
$
We are now left with four instances. Assume that at this point, node3, which has one primary and one secondary instance, crashes:
$ gnt-node info node3
Node name: node3
primary ip: <IP_ADDRESS>
secondary ip: <IP_ADDRESS>
master candidate: True
drained: False
offline: False
primary for instances:
- instance4
secondary for instances:
- instance1
$ fping node3
node3 is unreachable
At this point, the primary instance of that node (instance4) is down, but the secondary instance (instance1) is not affected except it has lost disk redundancy:
$ fping instance{1,4}
instance1 is alive
instance4 is unreachable
$
If we try to check the status of instance4 via the instance info command, it fails because it tries to contact node3 which is down:
$ gnt-instance info instance4
Failure: command execution error:
Error checking node node3: Connection failed (113: No route to host)
$
So we need to mark node3 as being offline, and thus Ganeti won’t talk to it anymore:
$ gnt-node modify -O yes -f node3
Mon Oct 26 04:34:12 2009 - WARNING: Not enough master candidates (desired 10, new value will be 2)
Mon Oct 26 04:34:15 2009 - WARNING: Communication failure to node node3: Connection failed (113: No route to host)
Modified node node3
- offline -> True
- master_candidate -> auto-demotion due to offline
$
And now we can failover the instance:
$ gnt-instance failover instance4
Failover will happen to image instance4. This requires a shutdown of
the instance. Continue?
y/[n]/?: y
Mon Oct 26 04:35:34 2009 * checking disk consistency between source and target
Failure: command execution error:
Disk disk/0 is degraded on target node, aborting failover.
$ gnt-instance failover --ignore-consistency instance4
Failover will happen to image instance4. This requires a shutdown of
the instance. Continue?
y/[n]/?: y
Mon Oct 26 04:35:47 2009 * checking disk consistency between source and target
Mon Oct 26 04:35:47 2009 * shutting down instance on source node
Mon Oct 26 04:35:47 2009 - WARNING: Could not shutdown instance instance4 on node node3. Proceeding anyway. Please make sure node node3 is down. Error details: Node is marked offline
Mon Oct 26 04:35:47 2009 * deactivating the instance's disks on source node
Mon Oct 26 04:35:47 2009 - WARNING: Could not shutdown block device disk/0 on node node3: Node is marked offline
Mon Oct 26 04:35:47 2009 * activating the instance's disks on target node
Mon Oct 26 04:35:47 2009 - WARNING: Could not prepare block device disk/0 on node node3 (is_primary=False, pass=1): Node is marked offline
Mon Oct 26 04:35:48 2009 * starting the instance on the target node
$
Note in our first attempt, Ganeti refused to do the failover since it wasn’t sure what is the status of the instance’s disks. We pass the --ignore-consistency flag and then we can failover:
$ gnt-instance list
Instance Hypervisor OS Primary_node Status Memory
instance1 xen-pvm debootstrap node2 running 128M
instance2 xen-pvm debootstrap node1 running 128M
instance3 xen-pvm debootstrap node1 running 128M
instance4 xen-pvm debootstrap node1 running 128M
$
But at this point, both instance1 and instance4 are without disk redundancy:
$ gnt-instance info instance1
Instance name: instance1
UUID: 45173e82-d1fa-417c-8758-7d582ab7eef4
Serial number: 2
Creation time: 2009-10-26 04:06:57
Modification time: 2009-10-26 04:07:14
State: configured to be up, actual state is up
Nodes:
- primary: node2
- secondaries: node3
Operating system: debootstrap
Allocated network port: None
Hypervisor: xen-pvm
- root_path: default (/dev/sda1)
- kernel_args: default (ro)
- use_bootloader: default (False)
- bootloader_args: default ()
- bootloader_path: default ()
- kernel_path: default (/boot/vmlinuz-2.6-xenU)
- initrd_path: default ()
Hardware:
- VCPUs: 1
- maxmem: 256MiB
- minmem: 512MiB
- NICs:
- nic/0: MAC: aa:00:00:78:da:63, IP: None, mode: bridged, link: xen-br0
Disks:
- disk/0: drbd8, size 256M
access mode: rw
nodeA: node2, minor=0
nodeB: node3, minor=0
port: 11035
auth key: 8e950e3cec6854b0181fbc3a6058657701f2d458
on primary: /dev/drbd0 (147:0) in sync, status *DEGRADED*
child devices:
- child 0: lvm, size 256M
logical_id: xenvg/22459cf8-117d-4bea-a1aa-791667d07800.disk0_data
on primary: /dev/xenvg/22459cf8-117d-4bea-a1aa-791667d07800.disk0_data (254:0)
- child 1: lvm, size 128M
logical_id: xenvg/22459cf8-117d-4bea-a1aa-791667d07800.disk0_meta
on primary: /dev/xenvg/22459cf8-117d-4bea-a1aa-791667d07800.disk0_meta (254:1)
The output is similar for instance4. In order to recover this, we need to run the node evacuate command which will change from the current secondary node to a new one (in this case, we only have two working nodes, so all instances will be end on nodes one and two):
$ gnt-node evacuate -I hail node3
Relocate instance(s) 'instance1','instance4' from node
node3 using iallocator hail?
y/[n]/?: y
Mon Oct 26 05:05:39 2009 - INFO: Selected new secondary for instance 'instance1': node1
Mon Oct 26 05:05:40 2009 - INFO: Selected new secondary for instance 'instance4': node2
Mon Oct 26 05:05:40 2009 Replacing disk(s) 0 for instance1
Mon Oct 26 05:05:40 2009 STEP 1/6 Check device existence
Mon Oct 26 05:05:40 2009 - INFO: Checking disk/0 on node2
Mon Oct 26 05:05:40 2009 - INFO: Checking volume groups
Mon Oct 26 05:05:40 2009 STEP 2/6 Check peer consistency
Mon Oct 26 05:05:40 2009 - INFO: Checking disk/0 consistency on node node2
Mon Oct 26 05:05:40 2009 STEP 3/6 Allocate new storage
Mon Oct 26 05:05:40 2009 - INFO: Adding new local storage on node1 for disk/0
Mon Oct 26 05:05:41 2009 STEP 4/6 Changing drbd configuration
Mon Oct 26 05:05:41 2009 - INFO: activating a new drbd on node1 for disk/0
Mon Oct 26 05:05:42 2009 - INFO: Shutting down drbd for disk/0 on old node
Mon Oct 26 05:05:42 2009 - WARNING: Failed to shutdown drbd for disk/0 on oldnode: Node is marked offline
Mon Oct 26 05:05:42 2009 Hint: Please cleanup this device manually as soon as possible
Mon Oct 26 05:05:42 2009 - INFO: Detaching primary drbds from the network (=> standalone)
Mon Oct 26 05:05:42 2009 - INFO: Updating instance configuration
Mon Oct 26 05:05:45 2009 - INFO: Attaching primary drbds to new secondary (standalone => connected)
Mon Oct 26 05:05:46 2009 STEP 5/6 Sync devices
Mon Oct 26 05:05:46 2009 - INFO: Waiting for instance instance1 to sync disks.
Mon Oct 26 05:05:46 2009 - INFO: - device disk/0: 13.90% done, 7 estimated seconds remaining
Mon Oct 26 05:05:53 2009 - INFO: Instance instance1's disks are in sync.
Mon Oct 26 05:05:53 2009 STEP 6/6 Removing old storage
Mon Oct 26 05:05:53 2009 - INFO: Remove logical volumes for 0
Mon Oct 26 05:05:53 2009 - WARNING: Can't remove old LV: Node is marked offline
Mon Oct 26 05:05:53 2009 Hint: remove unused LVs manually
Mon Oct 26 05:05:53 2009 - WARNING: Can't remove old LV: Node is marked offline
Mon Oct 26 05:05:53 2009 Hint: remove unused LVs manually
Mon Oct 26 05:05:53 2009 Replacing disk(s) 0 for instance4
Mon Oct 26 05:05:53 2009 STEP 1/6 Check device existence
Mon Oct 26 05:05:53 2009 - INFO: Checking disk/0 on node1
Mon Oct 26 05:05:53 2009 - INFO: Checking volume groups
Mon Oct 26 05:05:53 2009 STEP 2/6 Check peer consistency
Mon Oct 26 05:05:53 2009 - INFO: Checking disk/0 consistency on node node1
Mon Oct 26 05:05:54 2009 STEP 3/6 Allocate new storage
Mon Oct 26 05:05:54 2009 - INFO: Adding new local storage on node2 for disk/0
Mon Oct 26 05:05:54 2009 STEP 4/6 Changing drbd configuration
Mon Oct 26 05:05:54 2009 - INFO: activating a new drbd on node2 for disk/0
Mon Oct 26 05:05:55 2009 - INFO: Shutting down drbd for disk/0 on old node
Mon Oct 26 05:05:55 2009 - WARNING: Failed to shutdown drbd for disk/0 on oldnode: Node is marked offline
Mon Oct 26 05:05:55 2009 Hint: Please cleanup this device manually as soon as possible
Mon Oct 26 05:05:55 2009 - INFO: Detaching primary drbds from the network (=> standalone)
Mon Oct 26 05:05:55 2009 - INFO: Updating instance configuration
Mon Oct 26 05:05:55 2009 - INFO: Attaching primary drbds to new secondary (standalone => connected)
Mon Oct 26 05:05:56 2009 STEP 5/6 Sync devices
Mon Oct 26 05:05:56 2009 - INFO: Waiting for instance instance4 to sync disks.
Mon Oct 26 05:05:56 2009 - INFO: - device disk/0: 12.40% done, 8 estimated seconds remaining
Mon Oct 26 05:06:04 2009 - INFO: Instance instance4's disks are in sync.
Mon Oct 26 05:06:04 2009 STEP 6/6 Removing old storage
Mon Oct 26 05:06:04 2009 - INFO: Remove logical volumes for 0
Mon Oct 26 05:06:04 2009 - WARNING: Can't remove old LV: Node is marked offline
Mon Oct 26 05:06:04 2009 Hint: remove unused LVs manually
Mon Oct 26 05:06:04 2009 - WARNING: Can't remove old LV: Node is marked offline
Mon Oct 26 05:06:04 2009 Hint: remove unused LVs manually
$
And now node3 is completely free of instances and can be repaired:
$ gnt-node list
Node DTotal DFree MTotal MNode MFree Pinst Sinst
node1 1.3T 1.3T 32.0G 1.0G 30.2G 3 1
node2 1.3T 1.3T 32.0G 1.0G 30.4G 1 3
node3 ? ? ? ? ? 0 0
Let’s say node3 has been repaired and is now ready to be reused. Re-adding it is simple:
$ gnt-node add --readd node3
The authenticity of host 'node3 (<IP_ADDRESS>)' can't be established.
RSA key fingerprint is 9f:2e:5a:2e:e0:bd:00:09:e4:5c:32:f2:27:57:7a:f4.
Are you sure you want to continue connecting (yes/no)? yes
Mon Oct 26 05:27:39 2009 - INFO: Readding a node, the offline/drained flags were reset
Mon Oct 26 05:27:39 2009 - INFO: Node will be a master candidate
And it is now working again:
$ gnt-node list
Node DTotal DFree MTotal MNode MFree Pinst Sinst
node1 1.3T 1.3T 32.0G 1.0G 30.2G 3 1
node2 1.3T 1.3T 32.0G 1.0G 30.4G 1 3
node3 1.3T 1.3T 32.0G 1.0G 30.4G 0 0
Note
If Ganeti has been built with the htools component enabled, you can shuffle the instances around to have a better use of the nodes.
A disk failure is simpler than a full node failure. First, a single disk failure should not cause data-loss for any redundant instance; only the performance of some instances might be reduced due to more network traffic.
Let take the cluster status in the above listing, and check what volumes are in use:
$ gnt-node volumes -o phys,instance node2
PhysDev Instance
/dev/sdb1 instance4
/dev/sdb1 instance4
/dev/sdb1 instance1
/dev/sdb1 instance1
/dev/sdb1 instance3
/dev/sdb1 instance3
/dev/sdb1 instance2
/dev/sdb1 instance2
$
You can see that all instances on node2 have logical volumes on /dev/sdb1. Let’s simulate a disk failure on that disk:
$ ssh node2
# on node2
$ echo offline > /sys/block/sdb/device/state
$ vgs
/dev/sdb1: read failed after 0 of 4096 at 0: Input/output error
/dev/sdb1: read failed after 0 of 4096 at<PHONE_NUMBER>32: Input/output error
/dev/sdb1: read failed after 0 of 4096 at 0: Input/output error
Couldn't find device with uuid '954bJA-mNL0-7ydj-sdpW-nc2C-ZrCi-zFp91c'.
Couldn't find all physical volumes for volume group xenvg.
/dev/sdb1: read failed after 0 of 4096 at 0: Input/output error
/dev/sdb1: read failed after 0 of 4096 at 0: Input/output error
Couldn't find device with uuid '954bJA-mNL0-7ydj-sdpW-nc2C-ZrCi-zFp91c'.
Couldn't find all physical volumes for volume group xenvg.
Volume group xenvg not found
$
At this point, the node is broken and if we are to examine instance2 we get (simplified output shown):
$ gnt-instance info instance2
Instance name: instance2
State: configured to be up, actual state is up
Nodes:
- primary: node1
- secondaries: node2
Disks:
- disk/0: drbd8, size 256M
on primary: /dev/drbd0 (147:0) in sync, status ok
on secondary: /dev/drbd1 (147:1) in sync, status *DEGRADED* *MISSING DISK*
This instance has a secondary only on node2. Let’s verify a primary instance of node2:
$ gnt-instance info instance1
Instance name: instance1
State: configured to be up, actual state is up
Nodes:
- primary: node2
- secondaries: node1
Disks:
- disk/0: drbd8, size 256M
on primary: /dev/drbd0 (147:0) in sync, status *DEGRADED* *MISSING DISK*
on secondary: /dev/drbd3 (147:3) in sync, status ok
$ gnt-instance console instance1
Debian GNU/Linux 5.0 instance1 tty1
instance1 login: root
Last login: Tue Oct 27 01:24:09 UTC 2009 on tty1
instance1:~# date > test
instance1:~# sync
instance1:~# cat test
Tue Oct 27 01:25:20 UTC 2009
instance1:~# dmesg|tail
[5439785.235448] NET: Registered protocol family 15
[5439785.235489] 802.1Q VLAN Support v1.8 Ben Greear<EMAIL_ADDRESS>[5439785.235495] All bugs added by David S. Miller<EMAIL_ADDRESS>[5439785.235517] XENBUS: Device with no driver: device/console/0
[5439785.236576] kjournald starting. Commit interval 5 seconds
[5439785.236588] EXT3-fs: mounted filesystem with ordered data mode.
[5439785.236625] VFS: Mounted root (ext3 filesystem) readonly.
[5439785.236663] Freeing unused kernel memory: 172k freed
[5439787.533779] EXT3 FS on sda1, internal journal
[5440655.065431] eth0: no IPv6 routers present
instance1:~#
As you can see, the instance is running fine and doesn’t see any disk issues. It is now time to fix node2 and re-establish redundancy for the involved instances.
Note
For Ganeti 2.0 we need to fix manually the volume group on node2 by running vgreduce --removemissing xenvg
$ gnt-node repair-storage node2 lvm-vg xenvg
Mon Oct 26 18:14:03 2009 Repairing storage unit 'xenvg' on node2 ...
$ ssh node2 vgs
VG #PV #LV #SN Attr VSize VFree
xenvg 1 8 0 wz--n- 673.84G 673.84G
$
This has removed the ‘bad’ disk from the volume group, which is now left with only one PV. We can now replace the disks for the involved instances:
$ for i in instance{1..4}; do gnt-instance replace-disks -a $i; done
Mon Oct 26 18:15:38 2009 Replacing disk(s) 0 for instance1
Mon Oct 26 18:15:38 2009 STEP 1/6 Check device existence
Mon Oct 26 18:15:38 2009 - INFO: Checking disk/0 on node1
Mon Oct 26 18:15:38 2009 - INFO: Checking disk/0 on node2
Mon Oct 26 18:15:38 2009 - INFO: Checking volume groups
Mon Oct 26 18:15:38 2009 STEP 2/6 Check peer consistency
Mon Oct 26 18:15:38 2009 - INFO: Checking disk/0 consistency on node node1
Mon Oct 26 18:15:39 2009 STEP 3/6 Allocate new storage
Mon Oct 26 18:15:39 2009 - INFO: Adding storage on node2 for disk/0
Mon Oct 26 18:15:39 2009 STEP 4/6 Changing drbd configuration
Mon Oct 26 18:15:39 2009 - INFO: Detaching disk/0 drbd from local storage
Mon Oct 26 18:15:40 2009 - INFO: Renaming the old LVs on the target node
Mon Oct 26 18:15:40 2009 - INFO: Renaming the new LVs on the target node
Mon Oct 26 18:15:40 2009 - INFO: Adding new mirror component on node2
Mon Oct 26 18:15:41 2009 STEP 5/6 Sync devices
Mon Oct 26 18:15:41 2009 - INFO: Waiting for instance instance1 to sync disks.
Mon Oct 26 18:15:41 2009 - INFO: - device disk/0: 12.40% done, 9 estimated seconds remaining
Mon Oct 26 18:15:50 2009 - INFO: Instance instance1's disks are in sync.
Mon Oct 26 18:15:50 2009 STEP 6/6 Removing old storage
Mon Oct 26 18:15:50 2009 - INFO: Remove logical volumes for disk/0
Mon Oct 26 18:15:52 2009 Replacing disk(s) 0 for instance2
Mon Oct 26 18:15:52 2009 STEP 1/6 Check device existence
…
Mon Oct 26 18:16:01 2009 STEP 6/6 Removing old storage
Mon Oct 26 18:16:01 2009 - INFO: Remove logical volumes for disk/0
Mon Oct 26 18:16:02 2009 Replacing disk(s) 0 for instance3
Mon Oct 26 18:16:02 2009 STEP 1/6 Check device existence
…
Mon Oct 26 18:16:09 2009 STEP 6/6 Removing old storage
Mon Oct 26 18:16:09 2009 - INFO: Remove logical volumes for disk/0
Mon Oct 26 18:16:10 2009 Replacing disk(s) 0 for instance4
Mon Oct 26 18:16:10 2009 STEP 1/6 Check device existence
…
Mon Oct 26 18:16:18 2009 STEP 6/6 Removing old storage
Mon Oct 26 18:16:18 2009 - INFO: Remove logical volumes for disk/0
$
As this point, all instances should be healthy again.
Note
Ganeti 2.0 doesn’t have the -a option to replace-disks, so for it you have to run the loop twice, once over primary instances with argument -p and once secondary instances with argument -s, but otherwise the operations are similar:
$ gnt-instance replace-disks -p instance1
…
$ for i in instance{2..4}; do gnt-instance replace-disks -s $i; done
There are a number of small issues that might appear on a cluster that can be solved easily as long as the issue is properly identified. For this exercise we will consider the case of node3, which was broken previously and re-added to the cluster without reinstallation. Running cluster verify on the cluster reports:
$ gnt-cluster verify
Mon Oct 26 18:30:08 2009 * Verifying global settings
Mon Oct 26 18:30:08 2009 * Gathering data (3 nodes)
Mon Oct 26 18:30:10 2009 * Verifying node status
Mon Oct 26 18:30:10 2009 - ERROR: node node3: unallocated drbd minor 0 is in use
Mon Oct 26 18:30:10 2009 - ERROR: node node3: unallocated drbd minor 1 is in use
Mon Oct 26 18:30:10 2009 * Verifying instance status
Mon Oct 26 18:30:10 2009 - ERROR: instance instance4: instance should not run on node node3
Mon Oct 26 18:30:10 2009 * Verifying orphan volumes
Mon Oct 26 18:30:10 2009 - ERROR: node node3: volume 22459cf8-117d-4bea-a1aa-791667d07800.disk0_data is unknown
Mon Oct 26 18:30:10 2009 - ERROR: node node3: volume 1aaf4716-e57f-4101-a8d6-03af5da9dc50.disk0_data is unknown
Mon Oct 26 18:30:10 2009 - ERROR: node node3: volume 1aaf4716-e57f-4101-a8d6-03af5da9dc50.disk0_meta is unknown
Mon Oct 26 18:30:10 2009 - ERROR: node node3: volume 22459cf8-117d-4bea-a1aa-791667d07800.disk0_meta is unknown
Mon Oct 26 18:30:10 2009 * Verifying remaining instances
Mon Oct 26 18:30:10 2009 * Verifying N+1 Memory redundancy
Mon Oct 26 18:30:10 2009 * Other Notes
Mon Oct 26 18:30:10 2009 * Hooks Results
$
As you can see, instance4 has a copy running on node3, because we forced the failover when node3 failed. This case is dangerous as the instance will have the same IP and MAC address, wreaking havoc on the network environment and anyone who tries to use it.
Ganeti doesn’t directly handle this case. It is recommended to logon to node3 and run:
$ xm destroy instance4
There are still unallocated DRBD minors on node3. Again, these are not handled by Ganeti directly and need to be cleaned up via DRBD commands:
$ ssh node3
# on node 3
$ drbdsetup /dev/drbd0 down
$ drbdsetup /dev/drbd1 down
$
At this point, the only remaining problem should be the so-called orphan volumes. This can happen also in the case of an aborted disk-replace, or similar situation where Ganeti was not able to recover automatically. Here you need to remove them manually via LVM commands:
$ ssh node3
# on node3
$ lvremove xenvg
Do you really want to remove active logical volume "22459cf8-117d-4bea-a1aa-791667d07800.disk0_data"? [y/n]: y
Logical volume "22459cf8-117d-4bea-a1aa-791667d07800.disk0_data" successfully removed
Do you really want to remove active logical volume "22459cf8-117d-4bea-a1aa-791667d07800.disk0_meta"? [y/n]: y
Logical volume "22459cf8-117d-4bea-a1aa-791667d07800.disk0_meta" successfully removed
Do you really want to remove active logical volume "1aaf4716-e57f-4101-a8d6-03af5da9dc50.disk0_data"? [y/n]: y
Logical volume "1aaf4716-e57f-4101-a8d6-03af5da9dc50.disk0_data" successfully removed
Do you really want to remove active logical volume "1aaf4716-e57f-4101-a8d6-03af5da9dc50.disk0_meta"? [y/n]: y
Logical volume "1aaf4716-e57f-4101-a8d6-03af5da9dc50.disk0_meta" successfully removed
node3#
At this point cluster verify shouldn’t complain anymore:
$ gnt-cluster verify
Mon Oct 26 18:37:51 2009 * Verifying global settings
Mon Oct 26 18:37:51 2009 * Gathering data (3 nodes)
Mon Oct 26 18:37:53 2009 * Verifying node status
Mon Oct 26 18:37:53 2009 * Verifying instance status
Mon Oct 26 18:37:53 2009 * Verifying orphan volumes
Mon Oct 26 18:37:53 2009 * Verifying remaining instances
Mon Oct 26 18:37:53 2009 * Verifying N+1 Memory redundancy
Mon Oct 26 18:37:53 2009 * Other Notes
Mon Oct 26 18:37:53 2009 * Hooks Results
$
Since redundant instances in Ganeti have a primary/secondary model, it is needed to leave aside on each node enough memory so that if one of its peer node fails, all the secondary instances that have that node as primary can be relocated. More specifically, if instance2 has node1 as primary and node2 as secondary (and node1 and node2 do not have any other instances in this layout), then it means that node2 must have enough free memory so that if node1 fails, we can failover instance2 without any other operations (for reducing the downtime window). Let’s increase the memory of the current instances to 4G, and add three new instances, two on node2:node3 with 8GB of RAM and one on node1:node2, with 12GB of RAM (numbers chosen so that we run out of memory):
$ gnt-instance modify -B memory=4G instance1
Modified instance instance1
- be/maxmem -> 4096
- be/minmem -> 4096
Please don't forget that these parameters take effect only at the next start of the instance.
$ gnt-instance modify …
$ gnt-instance add -t drbd -n node2:node3 -s 512m -B memory=8G -o debootstrap instance5
…
$ gnt-instance add -t drbd -n node2:node3 -s 512m -B memory=8G -o debootstrap instance6
…
$ gnt-instance add -t drbd -n node1:node2 -s 512m -B memory=8G -o debootstrap instance7
$ gnt-instance reboot --all
The reboot will operate on 7 instances.
Do you want to continue?
Affected instances:
instance1
instance2
instance3
instance4
instance5
instance6
instance7
y/[n]/?: y
Submitted jobs 677, 678, 679, 680, 681, 682, 683
Waiting for job 677 for instance1...
Waiting for job 678 for instance2...
Waiting for job 679 for instance3...
Waiting for job 680 for instance4...
Waiting for job 681 for instance5...
Waiting for job 682 for instance6...
Waiting for job 683 for instance7...
$
We rebooted the instances for the memory changes to have effect. Now the cluster looks like:
$ gnt-node list
Node DTotal DFree MTotal MNode MFree Pinst Sinst
node1 1.3T 1.3T 32.0G 1.0G 6.5G 4 1
node2 1.3T 1.3T 32.0G 1.0G 10.5G 3 4
node3 1.3T 1.3T 32.0G 1.0G 30.5G 0 2
$ gnt-cluster verify
Mon Oct 26 18:59:36 2009 * Verifying global settings
Mon Oct 26 18:59:36 2009 * Gathering data (3 nodes)
Mon Oct 26 18:59:37 2009 * Verifying node status
Mon Oct 26 18:59:37 2009 * Verifying instance status
Mon Oct 26 18:59:37 2009 * Verifying orphan volumes
Mon Oct 26 18:59:37 2009 * Verifying remaining instances
Mon Oct 26 18:59:37 2009 * Verifying N+1 Memory redundancy
Mon Oct 26 18:59:37 2009 - ERROR: node node2: not enough memory to accommodate instance failovers should node node1 fail
Mon Oct 26 18:59:37 2009 * Other Notes
Mon Oct 26 18:59:37 2009 * Hooks Results
$
The cluster verify error above shows that if node1 fails, node2 will not have enough memory to failover all primary instances on node1 to it. To solve this, you have a number of options:
In case a node has problems with the network (usually the secondary network, as problems with the primary network will render the node unusable for ganeti commands), it will show up in cluster verify as:
$ gnt-cluster verify
Mon Oct 26 19:07:19 2009 * Verifying global settings
Mon Oct 26 19:07:19 2009 * Gathering data (3 nodes)
Mon Oct 26 19:07:23 2009 * Verifying node status
Mon Oct 26 19:07:23 2009 - ERROR: node node1: tcp communication with node 'node3': failure using the secondary interface(s)
Mon Oct 26 19:07:23 2009 - ERROR: node node2: tcp communication with node 'node3': failure using the secondary interface(s)
Mon Oct 26 19:07:23 2009 - ERROR: node node3: tcp communication with node 'node1': failure using the secondary interface(s)
Mon Oct 26 19:07:23 2009 - ERROR: node node3: tcp communication with node 'node2': failure using the secondary interface(s)
Mon Oct 26 19:07:23 2009 - ERROR: node node3: tcp communication with node 'node3': failure using the secondary interface(s)
Mon Oct 26 19:07:23 2009 * Verifying instance status
Mon Oct 26 19:07:23 2009 * Verifying orphan volumes
Mon Oct 26 19:07:23 2009 * Verifying remaining instances
Mon Oct 26 19:07:23 2009 * Verifying N+1 Memory redundancy
Mon Oct 26 19:07:23 2009 * Other Notes
Mon Oct 26 19:07:23 2009 * Hooks Results
$
This shows that both node1 and node2 have problems contacting node3 over the secondary network, and node3 has problems contacting them. From this output is can be deduced that since node1 and node2 can communicate between themselves, node3 is the one having problems, and you need to investigate its network settings/connection.
Since live migration can sometimes fail and leave the instance in an inconsistent state, Ganeti provides a --cleanup argument to the migrate command that does:
It is always safe to run this command as long as the instance has good data on its primary node (i.e. not showing as degraded). If so, you can simply run:
$ gnt-instance migrate --cleanup instance1
Instance instance1 will be recovered from a failed migration. Note
that the migration procedure (including cleanup) is **experimental**
in this version. This might impact the instance if anything goes
wrong. Continue?
y/[n]/?: y
Mon Oct 26 19:13:49 2009 Migrating instance instance1
Mon Oct 26 19:13:49 2009 * checking where the instance actually runs (if this hangs, the hypervisor might be in a bad state)
Mon Oct 26 19:13:49 2009 * instance confirmed to be running on its primary node (node2)
Mon Oct 26 19:13:49 2009 * switching node node1 to secondary mode
Mon Oct 26 19:13:50 2009 * wait until resync is done
Mon Oct 26 19:13:50 2009 * changing into standalone mode
Mon Oct 26 19:13:50 2009 * changing disks into single-master mode
Mon Oct 26 19:13:50 2009 * wait until resync is done
Mon Oct 26 19:13:51 2009 * done
$
If you see something like the following when trying to shutdown or deactivate disks for an instance:
$ gnt-instance shutdown instance1
Mon Oct 26 19:16:23 2009 - WARNING: Could not shutdown block device disk/0 on node node2: drbd0: can't shutdown drbd device: /dev/drbd0: State change failed: (-12) Device is held open by someone\n
It most likely means something is holding open the underlying DRBD device. This can be bad if the instance is not running, as it might mean that there was concurrent access from both the node and the instance to the disks, but not always (e.g. you could only have had the partitions activated via kpartx).
To troubleshoot this issue you need to follow standard Linux practices, and pay attention to the hypervisor being used:
For Xen, check if it’s not using the disks itself:
$ xenstore-ls /local/domain/0/backend/vbd|grep -e "domain =" -e physical-device
domain = "instance2"
physical-device = "93:0"
domain = "instance3"
physical-device = "93:1"
domain = "instance4"
physical-device = "93:2"
$
You can see in the above output that the node exports three disks, to three instances. The physical-device key is in major:minor format in hexadecimal, and 0x93 represents DRBD’s major number. Thus we can see from the above that instance2 has /dev/drbd0, instance3 /dev/drbd1, and instance4 /dev/drbd2.
LUXI is the protocol used for communication between clients and the master daemon. Starting in Ganeti 2.3, the peers exchange their version in each message. When they don’t match, an error is raised:
$ gnt-node modify -O yes node3
Unhandled Ganeti error: LUXI version mismatch, server 2020000, request 2030000
Usually this means that server and client are from different Ganeti versions or import their libraries from different, consistent paths (e.g. an older version installed in another place). You can print the import path for Ganeti’s modules using the following command (note that depending on your setup you might have to use an explicit version in the Python command, e.g. python2.6):
python -c 'import ganeti; print ganeti.__file__'


2. Fading LEDs¶
In addition to turning LEDs on and off, it is also possible to control the brightness of an LED using Pulse-Width Modulation (PWM), a common technique for obtaining variable output from a digital pin. This allows us to fade an LED:
2.1. Components¶
You will need:
Standard 5 or 3 mm LED
100 Ohm resistor
Wires
Breadboard (optional, but makes things easier)
2.2. Connecting Things Up¶
For this tutorial, we will use the X1
pin. Connect one end of the resistor to X1
, and the other end to the anode of the LED, which is the longer leg. Connect the cathode of the LED to ground.
2.3. Code¶
By examining the Quick reference for the pyboard, we see that X1
is connected to channel 1 of timer 5 (TIM5 CH1
). Therefore we will first create a Timer
object for timer 5, then create a TimerChannel
object for channel 1:
from pyb import Timer
from time import sleep
# timer 5 will be created with a frequency of 100 Hz
tim = pyb.Timer(5, freq=100)
tchannel = tim.channel(1, Timer.PWM, pin=pyb.Pin.board.X1, pulse_width=0)
Brightness of the LED in PWM is controlled by controlling the pulse-width, that is the amount of time the LED is on every cycle. With a timer frequency of 100 Hz, each cycle takes 0.01 second, or 10 ms.
To achieve the fading effect shown at the beginning of this tutorial, we want to set the pulse-width to a small value, then slowly increase the pulse-width to brighten the LED, and start over when we reach some maximum brightness:
# maximum and minimum pulse-width, which corresponds to maximum
# and minimum brightness
max_width = 200000
min_width = 20000
# how much to change the pulse-width by each step
wstep = 1500
cur_width = min_width
while True:
tchannel.pulse_width(cur_width)
# this determines how often we change the pulse-width. It is
# analogous to frames-per-second
sleep(0.01)
cur_width += wstep
if cur_width > max_width:
cur_width = min_width
2.4. Breathing Effect¶
If we want to have a breathing effect, where the LED fades from dim to bright then bright to dim, then we simply need to reverse the sign of wstep
when we reach maximum brightness, and reverse it again at minimum brightness. To do this we modify the while
loop to be:
while True:
tchannel.pulse_width(cur_width)
sleep(0.01)
cur_width += wstep
if cur_width > max_width:
cur_width = max_width
wstep *= -1
elif cur_width < min_width:
cur_width = min_width
wstep *= -1
2.5. Advanced Exercise¶
You may have noticed that the LED brightness seems to fade slowly, but increases quickly. This is because our eyes interprets brightness logarithmically (Weber’s Law ), while the LED’s brightness changes linearly, that is by the same amount each time. How do you solve this problem? (Hint: what is the opposite of the logarithmic function?)
2.6. Addendum¶
We could have also used the digital-to-analog converter (DAC) to achieve the same effect. The PWM method has the advantage that it drives the LED with the same current each time, but for different lengths of time. This allows better control over the brightness, because LEDs do not necessarily exhibit a linear relationship between the driving current and brightness.


Next: The for-as-package subclause, Previous: Examples of for-as-across subclause, Up: Variable Initialization and Stepping Clauses
In the for-as-hash subclause the for or as construct iterates over the elements, keys, and values of a hash-table. In this syntax, a compound preposition is used to designate access to a hash table. The variable var takes on the value of each hash key or hash value in the supplied hash-table. The following loop keywords serve as valid prepositions within this syntax:
The keyword being introduces either the Loop schema hash-key or hash-value.
The loop keyword each follows the loop keyword being when hash-key or hash-value is used. The loop keyword the is used with hash-keys and hash-values only for ease of reading. This agreement isn’t required.
These loop keywords access each key entry of the hash table. If the name hash-value is supplied in a using construct with one of these Loop schemas, the iteration can optionally access the keyed value. The order in which the keys are accessed is undefined; empty slots in the hash table are ignored.
These loop keywords access each value entry of a hash table. If the name hash-key is supplied in a using construct with one of these Loop schemas, the iteration can optionally access the key that corresponds to the value. The order in which the keys are accessed is undefined; empty slots in the hash table are ignored.
The loop keyword using introduces the optional key or the keyed value to be accessed. It allows access to the hash key if iteration is over the hash values, and the hash value if iteration is over the hash keys.
These loop prepositions introduce hash-table.
In effect
being {each | the} {hash-value | hash-values | hash-key | hash-keys} {in | of}
is a compound preposition.
Iteration stops when there are no more hash keys or hash values to be referenced in the supplied hash-table.


Project X
by Aummyka
List Of Users
(current)
Register
First Name:
Last Name:
UserName:
Password :
Sex :
Male
Female
Birthday :
Interest :
Games
Sport
Music


Inveigh- Inveigh is a PowerShell LLMNR/mDNS/NBNS spoofer and man-in-the-middle tool designed to assist penetration testers/red teamers that find themselves limited to a Windows system.
Responder - lgandx- NBT-NS/LLMNR Responder and Cross-Protocol NTLM Relay Windows Version (Beta)
Invoke-TheHash- Invoke-TheHash contains PowerShell functions for performing pass the hash WMI and SMB tasks. WMI and SMB services are accessed through .NET TCPClient connections. Authentication is performed by passing an NTLM hash into the NTLMv2 authentication protocol. Local administrator privilege is not required client-side.


The .crds-list
selector also supports definition lists in the following manner...
- Grace
- The free and unmerited favor of God, as manifested in the salvation of sinners and the bestowal of blessings
- Truth
- Sincerity in action, character, and utterance
- Time
- The measured or measurable period during which an action, process, or condition exists or continues


{%extends "nav_account.html"%} {%block title%}Elections{%endblock%} {%block content%}
This election is closed, and these are the results. If you voted in this election, you can review your votes.
{%if not election.resultspublic%}WARNING! The results for this election has not been published yet! These are preliminary results, and should be verified and then published!
{%endif%}


Preparation time
30 mins to 1 hour
Cooking time
10 to 30 mins
Serves
Serves 2
Marinated, sesame-coated seared tuna steaks on top of a quick-cook vegetable and noodle stir fry.
For the tuna, place the soy sauce, garlic, ginger and honey into a non-reactive bowl and add the tuna. Coat the tuna steaks in the marinade, cover and transfer to the fridge to marinate for about half an hour.
For the stir-fry, bring a pan of salted water to the boil. Cook noodles according to packet instruction then drain well and toss with the sesame oil.
Heat the groundnut oil in a wok over a high heat until smoking then add the garlic and chilli, cook for 30 seconds until fragrant then add all the vegetables and a dash of soy sauce. Stir-fry for another minute or two, then add the noodles and toss for 30 seconds or until heated through. Stir in the coriander.
Heat a large frying pan over a high heat until. Remove the tuna from the marinade and pat dry. Sprinkle the sesame seeds onto a plate. Rub the tuna with a little groundnut oil and press both sides into the sesame seeds until coated all over with sesame seeds. Place the tuna in the hot pan and sear for one minute on each side, until the outside is golden-brown and the middle is still raw. Set aside to rest for a few minutes.
Serve the tuna steaks on the noodle stir-fry and garnish with the lime wedges.


Home
About
Bike Sharing Project - IEEE NITK
Seasons
Day of the Week
Holiday
Weekend
Weekday
Working Day
Weather
Temperature
21
F
Actual Temperature
22
F
Windspeed
57
Humidity
15
%
Submit


Links
Here's how we do links at the foundation.
Google Parameters
We use the following five parameters for url tracking (google analytics). If the url has a question mark anywhere in it you want to add &utm_source=something&utm_medium=something&utm_campaign&utm_content=something&utm_term=something
.
If it doesn't have a question mark you want to add ?utm_source=something&utm_medium=something&utm_campaign&utm_content=something&utm_term=something
to the end.
- source: platform that the email is coming from. (Use eblast for emails)
- medium: type of content. (use email for emails that come out of Luminate)
- content: Descriptor for the specific email. (Ex. Scotiabank)
- campaign: Internal Campaign for how this/these emails are being grouped. (Ex. Angel)
- term: Description of what is being used as the link. We do this so we're able to distinguish different links to the same website in an email. (ex. Header_Button)
http://support.vghfoundation.ca/site/Donation2?df_id=1720&mfc_pref=T&1720.donation=form1&utm_source=eblast&utm_medium=email&utm_content=scotiabank&utm_campaign=angel&utm_term=header_button


ComplexHeatmap Complete Reference
last revised on 2019-03-03
About
This is the documentation of the ComplexHeatmap package. Examples in the book are generated under version 1.99.5.
The ComplexHeatmap package is inspired from the pheatmap package. You can find many arguments in ComplexHeatmap have the same names as in pheatmap. Also you can find this old package that I tried to develop by modifying pheatmap.
Please note, this documentation is not completely compatible with older versions (< 1.99.0, before Oct, 2018), but the major functionality keeps the same.
If you use ComplexHeatmap in your publications, I am appreciated if you can cite:
Gu, Z. (2016) Complex heatmaps reveal patterns and correlations in multidimensional genomic data. DOI: 10.1093/bioinformatics/btw313