Not Defined and Not Empty/Null in Twig

May 1st, 2013

Long time no write.  Came across some syntax today that solves an old annoyance in Symfony’s Twig.

Rather than blather on in code with the following complex statement to make sure that a value is both defined and not null:

{% if var is defined and var is not null %}

one can instead simply do this:

{% if var|default is not empty %}

Nice.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

This ain’t no party. This ain’t no disco.

February 18th, 2013

This started as a single post on Facebook, just a few weeks ago.

This ain’t no foolin’ around.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Federal Government declares admits open season on Americans

February 5th, 2013

From NBC of all places.

A confidential Justice Department memo concludes that the U.S. government can order the killing of American citizens if they are believed to be “senior operational leaders” of al-Qaida or “an associated force” — even if there is no intelligence indicating they are engaged in an active plot to attack the U.S.


1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Redacted

January 25th, 2013

If you’ve ever seen Stan Friedman talk about UFO’s, you’ve probably seen his shtick about redacted documents. For example:

Always loved that.

Well, move over Stan. Apparently the U.S. government has even bigger secrets than aliens.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

“But how else would we prevent war?”

January 19th, 2013

Some time back I found myself discussing the fate of the Euro and the European Union with folks from academia-land. I was, and remain, rather confident that what is apparently an ill-conceived political shotgun polygamy will not survive another five years in any significant manner, at least not without some kind of military intervention.  Multiple cultures with their own economies and their own sovereign debt…  And Goldman Sachs lending a helping hand to fund it all. What could go wrong?

Anyway, academia argued the following point:  Only by binding the nations of Europe and “controlling” them with a single currency could humanity be spared another World War.

Which at first sounds reasonable… until we look at what multinational central financial planning has wrought.  Austerity, violent unrest, and talk of civil war.  I suppose convincing what remains of each nation state to commit suicide would prevent a “world” war, sure.

In my opinion, war — any war — is best prevented, not via centralized control, but organically through trends that have been evolving naturally:  Increased travel and improved communication.  Increasing freedom and understanding.  It’s difficult to hate your neighbors, murderously, when you understand them, even dine with them.  And since the second World War, technology has enabled a global renaissance in communication, travel, and as I see it, a trend towards a world of disparate yet harmonious cultures.

So how else would we prevent war?  Allow cultures to communicate.  Give them the freedom to self-actualize.  And stop with the centralized meddling.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Gunning for Trouble

January 15th, 2013

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

War is Taxing

January 13th, 2013

Not to mention that by 2020, at the latest, over half of all income tax revenues will go toward paying interest on a $23 trillion national debt.

Happy new year!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Ubuntu’s “upstart” versus old school “update-rc.d”

September 24th, 2012

Every distro seems to have their own damn way of managing startup services. One of these days I should really sit down and figure out how runlevels work.

Or maybe I’ll continue to ignore them since Ubuntu’s simplified (and fairly intuitive) upstart seems to be make it easier to not worry about levels.

Anyway, since Ubuntu is a bit schizophrenic these days with some services using upstart and others not, here are some handy commands for adding/removing startup services. Comments welcome since this is the kind of thing I do only very rarely.

initctl

$ initctl list shows a quick list of startup services. I’m not really sure what’s happening under the hood here, which is why it’s often useful to…

update-rc.d

…see what’s starting at various runlevels. Try this:

$ ls /etc/rc?.d

To see if amavis is starting on boot we can:

$ ls /etc/rc?.d | grep amavis
K21amavis
K21amavis
K21amavis
K21amavis
K21amavis
K21amavis
K21amavis

And since we don’t need it:

$ sudo update-rc.d -f amavis remove
Removing any system startup links for /etc/init.d/amavis ...
/etc/rc0.d/K21amavis
/etc/rc1.d/K21amavis
/etc/rc2.d/K21amavis
/etc/rc3.d/K21amavis
/etc/rc4.d/K21amavis
/etc/rc5.d/K21amavis
/etc/rc6.d/K21amavis

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

September 11th

September 12th, 2012

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Teleprompter Nation

September 7th, 2012

Must watch.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...