Pages

Thursday, February 8, 2018

Headless Raspberry Pi0w setup (without a monitor)

Notes on setting up a headless Raspberry Pi 0w. Based on the Raspbian install instructions and Pi0 wifi config from stackexchange.

On an existing Pi, where /dev/sda is the SD card device:

curl -LO https://downloads.raspberrypi.org/raspbian_lite_latest
unzip -p raspbian_lite_latest | dd bs=4M conv=fsync of=/dev/sda
mount /dev/sda1 /mnt
touch /mnt/ssh
umount /mnt
mount /dev/sda2 /mnt
cat >>/mnt/etc/wpa_supplicant/wpa_supplicant.conf <<EOF

country=US
network={
    ssid="SSID"
    psk="password"
    key_mgmt=WPA-PSK
}
EOF
umount /mnt


Move the SD to the pi0 and boot. Find the IP and ssh as pi@IP.
On the pi0:

passwd
sudo su -

apt update
apt upgrade
rpi-update


I usually run the updates in screen, I run "sudo apt install screen" after passwd.

Monday, November 13, 2017

ML links #1

Googlers thinking about the impact of deep learning on software development. One of the key points I've taken from what I've seen so far is that self training networks, and even trained networks, take the programming out of programming.

https://petewarden.com/2017/11/13/deep-learning-is-eating-software/

https://medium.com/@karpathy/software-2-0-a64152b37c35

And productionizing
https://blogs.dropbox.com/tech/2017/04/creating-a-modern-ocr-pipeline-using-computer-vision-and-deep-learning/

https://medium.com/artists-and-machine-intelligence/a-journey-through-multiple-dimensions-and-transformations-in-space-the-final-frontier-d8435d81ca51

Friday, August 28, 2015

Installing Go 1.5 on Raspberry Pi Raspbian Golang


Grab a Go 1.4 binary from Dave Cheney's site, use that to build go 1.5.


wget http://dave.cheney.net/paste/go1.4.2.linux-arm~multiarch-armv6-1.tar.gz
tar xzvf go1.4.2.linux-arm~multiarch-armv6-1.tar.gz
mv go go1.4
git clone https://go.googlesource.com/go
cd go
git checkout go1.5
cd src
./all.bash

Some tests fail, but go runs.

Tuesday, February 18, 2014

Whenever interface operations commute, they can be implemented in a way that scales

I ran into a deep review of a paper on scaling Linux, and I realized that the commutativity rule explains why REST and functional programming blew away enterprise architectures on the web. Yes, because REST scales, but this is the first real explanation that I have read of why that is, and the first I've heard of the scalable commutativity rule.

The review is worth trudging through, I've just started reading the paper.

Friday, December 13, 2013

2014 Congressional Elections marker.

1. Democrats retain Senate.
2. Democrats erode Republican advantage in the House by more than 5.

Typically the president's party loses seats in the second term midterm; all things being equal that is what we should expect in 2014. Under a closer analysis the Democrats have more seats at risk in both the House and Senate races in 2014, so Democrats losing seats in the House and losing control of the Senate should be a safe bet.

I think that ignores the bigger picture. The great inversion, where the Republican party moved south and the Democratic party moved north, completed a few cycles ago. The Republican party is now tearing itself apart as the contradictions in its new coalition of business and southern whites manifest. As the Republican party doubled down on a white male coalition it alienated potential hispanic, black, asian and female supporters. The Republicans have passed the point of diminishing returns and yet they continue to focus on expanding their white male vote.

The Republicans over-reached when they shut down the government in 2013, that did severe damage to their support. Obama bungled implementation of the ACA, that damaged Obama and reduced Democrats chances in 2014. But the ACA systems are working now, and many more people will have health insurance and better coverage in 2014. Those people, their families and friends, will be looking for candidates in 2014 who will support and improve policies like the ACA. The one group seeing higher premiums under the ACA, older, healthy, wealthy self-employed people, are unlikely to change political opinions because of it.  The Republican party continues to identify itself as the party that is willing to shutdown the government to repeal the ACA.

Although the political damage from the shutdown did not change the Republican's course on the ACA, it did chasten the party. We can see the results this week as House leaders shouted down Tea Party opposition and overwhelmingly passed a budget that raises spending in 2014. Given a slowly improving economy any increase in Federal spending will have a significant positive economic impact. A more rapidly improving economy gives the party in power a boost in the midterms, as supporters are more enthusiastic and opponents open their minds to the party's arguments.


Monday, September 30, 2013

Greenwalds priors

For those who like their politics with a side of racism:

Wednesday, March 6, 2013

The Need for a New Definition of Human Rights

Tom Burke and I transcribed an essay by my grandfather, John Ellingston, written in about 1944. He argues for the Statement of Essential Human Rights, a precursor to the Universal Declaration of Human Rights that he worked on at the end of World War II.


The Need for a New Definition of Human Rights


John R. Ellingston

A world society with so much power as ours must either be organized to serve the welfare and the dignity of the individual human being or it will destroy itself. Our capacity for destruction grows and with it grows the pressure to destroy. Twice in our generation this pressure has spread the ash and death of war more widely over the globe. The sack of Belgium in 1914-18 became in 1937-44 the sack of Asia and Europe. The killing of soldiers grew into the extermination of peoples. In World War II it needs but a night to raze a Coventry or a Cologne. No continent, no city, no shred of civilization will be safe from the 1,000-ton bombers of a Third World War.

The pressures that have bred two World Wars and that will inevitably, unless we change them, breed the Third spring from our moral unpreparedness to use the mighty tool of industrialism. Industrialism reduces all nations to interdependence. No industrial power, not even the United States or Russia or the British Empire, is self-sufficient. For full employment and prosperity each must have access to raw materials and markets outside its own boundaries. For geographically smaller countries, like the British Isles, access to these external resources is the condition of survival. Yet the nations ignore or deny this interdependence. Clinging to jealous tribal exclusiveness, they cut the world up into cells by tariffs, quotas, and other political barriers to the healthy exchange of goods. Then they try by armaments, naval and air bases, competitive alliances, and the bluster of force to assure themselves their indispensable raw materials and markets.

With the international field thus constantly mined for explosion, moral unpreparedness within industrial nations creates pressure to light the fuse. As with nations, industrialism also reduces all men to interdependence. It converts each man into a specialist and deprives him of his economic self-sufficiency in order to multiply the economic and mechanical power of the community. Control of this vast power is necessarily concentrated in a few hands. And therein lies the danger. The concentration of control opens the door to abuse. It may enable a privileged few to take an unfair share of the rewards of industry. Worse still, it may enable them so to serve what they believe to be their immediate interest in the management of industry as to slow down or stall the whole interdependent and complicated machinery of production and distribution. The goal sought is high unit-profit without risk on a low turnover. The means employed include high prices, low wages, throttled productivity, restraint of new inventions, and strangled competition by monopolies and cartels and by the explosive political devices of high tariffs, quotas, and exchange controls. The inevitable result is industrialism’s chronic crisis of want in the midst of plenty, the delivery of multitudes of people to the chaos of insecurity and fear.  Finally, and worst of all, the vast concentrations of power in our industrial society invite and smooth the way for the gangster-tyrants -- the Lepkes, the Huey Longs, the Hitlers and the Tojos. Every nation has its potential Hitlers. They years between the two World Wars revealed the conditions under which criminal dictators can seize supreme power and use it first to enslave the interdependent millions within and industrial nation and then to attack mankind.

The three great powers that succumbed to the tyrants -- Germany, Italy and Japan -- had three features in common: (1) Of the highly industrial nations, they were economically the least self-sufficient, most at the mercy of foreign raw materials and markets. (2) To a greater extent than that of other industrial nations, their internal economy was organized to benefit the privileged few -- the industrialists, the large land owners, the aristocracy, the generals, the bureaucrats. (3) Their citizens had little or no experience in freedom and self-government.

The records show that in bringing on the world-wide depression the short-sighted and selfish economic policies of all the nations helped the Nazis to power. In the comparative prosperity of 1924-1928, the Party members in the Reichstag declined from 32 to 12. However, under the impact of the depression that began in 1929 Nazi representation climbed swiftly to reach 196 by 1932, and in 1933 Hitler became Chancellor. Similarly it has been pointed out that the Japanese adventure in “Co-Prosperity for Asiatics” followed the drastic exclusion of Japanese goods from vast European colonies in the Far East.

Yet it is a dangerous error to see only the immediate economic factors that encourage the triumph of the dictators and destroy peace. Back of them is a factor of controlling importance. None of the industrial powers, large or small, escaped the crisis of industrialism -- the unemployment, the want, the insecurity. But those democratic nations that had had long experience in freedom and self-government and the strongest faith in the sanctity of the individual did not yield to tyranny. Though those nations also had their Black Shirts and Christian Fronts, a majority of their citizens clung to their basic democracy and took political and economic action to adapt to the new conditions of industrialism. Some of the action sought to correct the internal and even the international causes of crisis and some of it was designed to compensate the individual for his loss of economic self-sufficiency. Thus the democracies proved that free men can effect the political and social adjustments necessary to make an industrial society function. They demonstrated that as peoples advance in freedom and understanding their will to peace becomes strong enough to prevent the government they control from launching an aggressive war. In so doing the democracies gave the lie to the age-old charge that human nature has a degraded appetite for aggression which renders peace hopeless and war inevitable.

The Decisive Moral Factor


The decisive factor, then, that determines whether a nation shall surrender to its own tyrants and to aggression is its moral climate, the vitality of its faith in the sanctity of men and of its devotion to truth, justice, and freedom. This vital faith is a thing that can be acquired and that can be lost. It is a thing that grows and evolves, of which one man or one nation may have more or less than another man or nation. Their feudal military caste have never permitted the Japanese to develop this faith in man, but have held them to more primitive ideas of tribal gods and tribal superiority, served by fear and force. The Prussian Junkers have played a similar retarding role among the Prussians and, particularly since 1871, among all the Germans, tending, in collaboration with cynical industrialists and bureaucrats, to drive the mass of the nation back towards primitive morality while their democratic neighbors were advancing, however haltingly, in the realities of truth, justice, and freedom. The years of the Weimar Republic were too few to effect the profound change of heart essential in the German people, so that in 1933 the nation was a comparatively ready victim for the dictators. So far apart had the free peoples and the slave peoples grown by 1939 that no democratic nation was able to credit the perfidy and brutality of Germany and Japan until each in turn actually experienced them.

However, perfidy and brutality, primitive morality, evil are not confined to Germany and Japan. The conquest and even the regeneration of these nations, though indispensible, will not of themselves prepare the rest of us morally to use the mighty tool of industrialism so as to avoid new world wars. There are full-fledged Fascists in every country. We need in all humility to recognise that a trace of the Fascist, larger or smaller, lurks in every man, in each of us. Fascism is but the naked and unrestrained expression of tendencies found in all nations and in all men. When the Nazis exterminated millions of men, women and children because they are Jews, they do no more than follow to its logical conclusion the all-too-common attitude that denies essential rights to human beings because of color, race, or creed. When labor unions exclude workers from membership and so from jobs and when business firms destroy competitors by creating monopolies, they are following the same rule of force that the Nazis have made so hateful.

Fascism is the surrender to fear and to force. It seeks safety by destroying all that is alien or unfamiliar to itself. That is why the Nazis, who exhibit Fascism in its totality, attempt not only to exterminate “non-Aryan” races and cultures, but to blot out in the German people themselves the evidence of their own humanity, to reduce them to disciplined insensibility and render them incapable of love, truth, justice, freedom or equality; indeed, incapable of thought itself. For these expressions of man’s mind and heart are the opposite of fear and force and will either master or be mastered by them. In fact, the never-ending struggle between love and fear, between reason and force, between freedom and enslavement, between cooperation and isolation, between good and evil constitutes the central theme of human history. What we call civilization is but the consolidation in human institutions of the painful victories gained by reason over force.

There exists a very practical test for measuring the quality of man’s morality and the level of civilization reached by a nation. It is the place given to human beings in the accepted scale of values. The measure of morality is respect for the individual man as man, regardless of his color, creed, or nationality. To the extent that men place state, church, position, property, profits, above the human personality in importance their morality is primitive. How primitive was revealed by the cynical ease with which elements in all countries could overlook the brutality of the Nazis in their instinctive sympathy with the Nazi scale of values. The measure of a nation’s civilization is the degree to which all its institutions -- government, industry, finance, church, school, family -- are organized to serve the welfare and the development of the human personality.

The coming of age of industrialism and the machine means that, if we are to survive, the conversion of our institutions to the service of man can no longer be left to time and chance. That is the lesson of two world wars in twenty years. Industrialism demands a revolution in morals no less than in economic organization. First, because of the magnitude of the power it harnesses and concentrates. By putting limitless destructive power on wings, man has made it impossible for individual nations to defend themselves by competitive force, for no vigilance could be so sleepless as to insure a continent or a city against a surprise attack by air. He has made certain that an armament race in bombers to preserve a “balance of power” would explode in universal destruction for no nation could support the cost and no nerves could endure the ceaseless strain.

Again, industrialism requires a revolution in morals because it reduces all nations and all men to interdependence. It has an inner drive that recognizes no political boundaries and presses insistently to cover the globe and to bring all men within its system. Because it is in its nature cooperative, an industrial economy can continue to function only to the extent that it serves equally the need of all the producers and consumers who make it up. Mass production simply cannot take place without mass consumption. That is self-evident, but the depression of the 30’s in the democracies put it to the test of experience.

In the long run, the only protection against the fatal resort to force and war is a world in which all men are free. “The era of freedom,” Mr. Mackenzie King, Prime Minister of Canada, said in October 1942, “will be achieved only as human welfare and social security become the main concern of men and nations. The new order must be a world order. It must be governed by a universal rule of law. It must be based on human rights and not on the rights of property, privilege, or position.” And Generalissimo Chiang Kai-shek has affirmed the same truth: “There will be neither peace, nor hope, nor future for any of us unless we honestly aim at political, social, and economic justice for all peoples of the world, great and small.” A century and a half ago that far-sighted realist, Benjamin Franklin, phrased the matter differently. He said, “Man will be ultimately governed by God or by tyrants.” As a scientist and inventor, Franklin foresaw that the machine must eventually force the issue of the ages.

The Conditions of Freedom

It is easy to desire freedom for all. In this world of varied peoples and cultures and of uneven social, political, and economic development, how is it to be attained? How is freedom for all to be realized and maintained even within the advanced democracies where economic relations are so complex and the necessities of organization require that planning and control be delegated to the few? Industrialization itself, by taking from the individual his economic self-sufficiency and independence, seems to limit man’s possibilities for freedom, if not wholly to deprive him of it. Indeed, our generation has seen the Italians and the Germans surrender their freedom in return for the promise of security. It has also seen that the reward is not security but destruction. That, as we have pointed out, is the paradox of industrialism. It compels the individual to give up a lesser freedom in order to share in a larger freedom; to submit to traffic lights in order to move faster and over a wider area. The problem is how to make the delicate readjustments, how to draw the new balance.

Just as the old road rules of the pre-motor age no longer suffice to protect us from death on the highways, so the old rules of governing the relations between men and their governments and other institutions in an agricultural society are no longer adequate to make men free or to protect those freedoms they were originally designed to protect. The older rules, enshrined in the classic Rights of Men and Bill of Rights, must be brought up to date. The conditions to be met if men are to be free in an industrial society must be defined. That is the need for and purpose of a statement of essential human rights.

The Statement herein presented defines the conditions of freedom in terms of the daily needs of human beings. Thus it reduces the seemingly impossible task of attaining freedom to measurable dimensions, which the man in the street can understand and in which he can share. The Statement of Essential Human Rights is not a statement of means. It does not blue print the varied organizations, international and national, political and economic, essential to reach the goal. But it does blue print the goal and by so doing it gives the citizens a yardstick by which to test any institution or action, for example a foreign policy. To understand that the ultimate purpose of international relations is to secure peace, freedom, food, and education for all men is to strip them of their mystery. It gives every man a stake in the success of those relations.

The blue print of the goal must come before world organizations to get us there can be shaped. George Wharton Pepper, President of the American Law Institute, has stated this necessity vividly: “I, for one, cannot think of anything more futile than setting up a world police force to protect an order without first deciding what the order is which is to be protected and policed. No police force ever did more or was ever expected to do more than to protect an existing order. The content of the order is the problem of immediacy, and the question of implementing the organization to give perpetuity to that order, while not secondary in importance, is secondary in point of time, because if any organization is projected by those who have not thought through the problem of essential order to be protected, they are just setting up a Frankenstein and deluding themselves into the idea that it is a mechanism of peace.”

The Statement of Essential Human Rights defines a goal. It is the goal for which we are fighting this war as well as the goal for which we must organize the peace. Without underestimating the difficulties, we need not undermine our resolution by the fear that the goal is impractical. The obstacles to be overcome are not physical; they lie solely in the moral standards and energies of mankind. It is perfectly practical now to guarantee economic rights to man because industrialization has for the first time in history made it possible to supply adequately the physical needs of all human beings. This fact is so new that we still hesitate to believe it. It shocks our traditional habits of thought, inherited from long ages of human history during which mankind did not have the knowledge or the tools to produce enough for everybody and when the comforts were reserved for the few and the many toiled for survival. The problem is to organize society’s productive capacity to to construct as in this war we have organized it to destroy. This does not mean that any of the more prosperous nations need deprive themselves permanently of their sufficiency to supply the insufficiency of less prosperous people. The responsibility of the prosperous is not endlessly to ship food to backward areas; it is to aid the development of industry in such areas so that they can obtain adequate food by their own efforts. In the process they will become better customers of the more prosperous areas.

Likewise it is practical, nay, essential, to recognize man’s right to share in his own government. It is inconceivable that men can long remain free who do not accept the responsibility for governing themselves. Universal democracy is, in the long run, a condition of both freedom and peace. Nevertheless, it is obvious that many peoples are not at this moment ready for parliaments elected by universal suffrage. Against that fact we must set the experience of this century, which has furnished more than one illustration of how rapidly, with the aid of phenomenal tools of our industrial economy, even so-called backward peoples can be educated and prepared for self-government. The people of the Phillipines are an outstanding example. During the period of preparation, the one thing essential is that industry and other institutions be organized to raise the standard of living and to further the education of the people concerned.

Of necessity, the Statement of Essential Human Rights goes beyond traditional Bills of Rights to impose positive duties on the states. That is indispensable if the guarantee of rights, particularly of economic rights, is to be more than a pious hope. In an industrial society, the threat to the freedom of the individual comes not solely from government. The concentrations of population and of economic power and the vast size of our institutions make it possible for corporations, or union officials, or other private groups to violate the liberties and annul the rights of the individual -- the classic rights of free speech and of assembly no less than the right to work. As the one institution that is the servant of all, the state must add to its duty of not itself violating the individual’s rights the duty of seeing that man’s lesser institutions do not violate them.

Many rights cannot be satisfied unless the state takes positive action; for example, to insure fair trial and education to the state must establish courts and schools. Now that all men are economically interdependent, the satisfaction of the indispensable rights to food and work require large-scale cooperation and some integration among primary producers and processors within nations and across frontiers. To this end governments must furnish an over-all guidance. Such guidances and cooperation can be expected only from governments and institutions that are organized primarily to serve the welfare of the human being and that recognize the individual as the supreme value. The specification of duties serves as a directive to organized society, including government, industry, and all other institutions, reminding them continually that they are in truth the servants of the people.

Power itself is the danger, no less in the hands of government officials than in those of industrial executives. The duties imposed on the state do not of themselves increase its powers nor contribute to the centralization of power. The Statement does not specify the means that must be employed to secure the economic freedoms. In the main the state is required to see that opportunities are provided. Whether the state shall go beyond that and if so how far will be decided in most democratic countries by the success or failure of private activity in serving the essential needs of human beings.

Finally, a practical statement of man’s rights must recognize his corresponding responsibilities and duties. This last Article, on limitations, does. No right is absolute. Freedom without responsibility is license. To want freedom only for oneself or one’s group, or nation is not to want freedom but privilege. There can be no freedom or security or peace for one unless all are free, secure, and at peace. Men or nations can keep no rights that they do not share.