Category Archives: Random

Hash value sizes

For giggles, here are examples of hashes for the SHA1, SHA256 and SHA512 hashing mechanisms.

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
echo hash_hmac(
  'sha1',
  openssl_random_pseudo_bytes(32),
  openssl_random_pseudo_bytes(32)
) . "\n";
 
echo hash_hmac(
  'sha256',
  openssl_random_pseudo_bytes(32),
  openssl_random_pseudo_bytes(32)
) . "\n";
 
echo hash_hmac(
  'sha512',
  openssl_random_pseudo_bytes(32),
   openssl_random_pseudo_bytes(32)
) . "\n";

Output

1
2
3
00666100c04543601c9de450b061b4bbc5538c50
5762b94cd40d3e62c7b343df1ca3511343dc00fd99a4f1ee64988bf523c13b8a
49cae01474cfd4adfa21e94d35dd93a1f808dff4538042d5140fc661773bc8d0019311ee3dcb7ed8e2a27b021ae47c006f9a477fb768f60256276cc99e8c4bd0

Have a good weekend.

indeyets/appserver-in-php · GitHub

indeyets/appserver-in-php · GitHub.

Lukas Smith responded on Twitter to a posting of mine I made on this blog about the possibility of having a precompiled bootstrap in PHP that would allow large sections of bootstrapping code to be bypassed, including autoloading, class definitions and certain objects.

His tweet linked to the link above which solves the problem, but in a different way.  It requires a middle layer that needs to be running to process these requests.  I believe that I have thought about doing something similar using ESI locally  which did not work out so well since Varnish processed ESI requests synchronously.

I have not played with this library and I would prefer a solution that is closer to the engine and doesn’t add another layer.  That said, this looks like an interesting project that seems worth taking a look at.

How to use @funtil

*update* I built a website to help with this.

@Funtil is a little tool I wrote that will tweet the number of days until a given event, once a day (give or take).  It tells you the amount of time until an event and it’s fun.  And it’s really easy to use and free.  Simply tweet something like this

1
@funtil, My Conference starts on Feb 24th, 2013 #newconference

@funtil makes sure that you notify the tool.  “starts on” or “is on” is a keyword.  Anything before that will be considered the name of the event and immediately following needs to be the date.  Trailing the date are any hashtags or anything that you want.  Tweeting that will make Funtil tweet something like

1
126 days until My Conference /via @kpschrade #newconference

It’s still pretty raw, but give it a shot.  Within a few minutes of tweeting your greeting being sent you should see a message like that.

Want to try it?

Event Name

Date

Hashtags/Additional


Tweet

Potty Training Baby Powder

I would like to announce the immediate availability of Tobasco for Toddlers.  It is the diaper powder for stubborn children.  The way it works is that your child wears their diaper just as they normally would.  But prior to them putting it on you put a small amount of our special patented powder that is completely neutral until it comes into contact with any liquid-y substance.  Once the powder is activated it generates the same sensation as shooting a whole bottle of Tobasco sauce.  Your child is guaranteed ** to never potty in their diaper after the first instance.  It is the ultimate weapon on your fight against a stubborn potty trainee.

 

Here is a picture of the powder and it’s applicator.  (Glow not a photo enhancement).

 

 

**Guarantee is void if you are actually dumb enough to try this.

 

Weyland Industries powered by PHP

It would seem that it is PHP that will be the dominant programming language in the latter half of the 21st century.

[root@li114-69 controllers]# HEAD www.weylandindustries.com
200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Close
Date: Wed, 07 Mar 2012 01:03:48 GMT
Pragma: no-cache
Server: Unknown
Content-Type: text/html
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Client-Date: Wed, 07 Mar 2012 01:03:48 GMT
Client-Peer: 107.21.200.195:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
Client-SSL-Cert-Subject: /C=US/ST=California/L=Los Angeles/O=Fox Entertainment Group/CN=www.weylandindustries.com
Client-SSL-Cipher: AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Set-Cookie: PHPSESSID=2da4qt357qvk74n6f63mnjsbe7; path=/

Why are you part of a software community?

I’m thinking about posting a poll in a couple of days about software communities and I’m looking for some input on some of the responses.  I have my set of possible responses, but I’d like some input before posting the poll.  So, if you have some ideas, please post them in the comments.

The question is

Why are you part of a software community?  or How do you participate in a software community?

Notice that I didn’t necessarily limit this to “open source”.  Clearly that’s a big part of it.  But there are a good number of robust communities that are not based around open source.  Adobe, Microsoft, IBM all have massive communities.  I know that for those of us in the open source realm that’s a little hard to understand (one of the reasons why I’m doing this), but it’s true.  Some of the ideas I’ve had so far…

  1. I like to provide input on the direction of the software I use
  2. I have some free time and I like to code
  3. The software helps me earn a living
  4. I am socially awkward and this is the best I can do
  5. I like hanging out with nerds
  6. I want to try new things that I don’t normally get to do

What about you?  Are there other responses I should put in there?

Watch 12 Cute Dogs Bark The Star Wars Imperial March In VW’s Super Bowl Ad Teaser

Watch 12 Cute Dogs Bark The Star Wars Imperial March In VW’s Super Bowl Ad Teaser.

Uh huh

This E-mail and any of its attachments may contain ****** proprietary information, which is privileged, confidential, or subject to copyright belonging to ******. This E-mail is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient of this E-mail, you are hereby notified that any dissemination, distribution, copying, or action taken in relation to the contents of and attachments to this E-mail is strictly prohibited and may be unlawful. If you have received this E-mail in error, please notify the sender immediately and permanently delete the original and any copy of this E-mail and any printout.

Uh huh.  “Strictly prohibited and may be unlawful”?  “May” be unlawful?  I should send out emails to millions of random people and say “by reading this email you may be required to send me $1,000″.

What other “remedies” could I put in my email to millions of people?

Occupy This

There’s an “Occupy Whitehorse“. No, Americans, I did not mis-spell that. And, yes, that says “sole” as in “one”. I, for one, am part of the Occupy Schroeder Household movement. Our (my) demands are the immediate disolution of HOA rules and dues (save for the pool and a couple of flowers), a federal 50% tax on those who complain about their lot in life (current complainer exempted, of course), numerous unspecified regulations on environment regulations and the use of nuclear bombs in oil drilling, particularly if it’s in a national park.

Speaking at OsCon

This year OsCon will be graced by my presence.  And by that I mean; I get to go to OsCon!!

This month on July 27th I will be speaking on PHP Performance.   I’m convinced that application performance is one of the most misunderstood problems out there.  How do I know this?  I spent just under 4 years as a consultant with Zend and I spent a great deal of my time doing performance audits of PHP applications.  There does seem to be a fair amount of, I guess I would call it blindness, among PHP developers concerning performance.  This isn’t something that’s limited to PHP developers, either.  I’ve worked in several environments as an administrator and a lot of developers in general, regardless of the language, seem to build their applications according to some predefined methodology (or lack thereof) without concern for performance.  If performance is not a concern then this isn’t an issue.  And often performance isn’t a concern… until it is.

Then you have people on the other side of the fence who will refuse to use objects because arrays are faster.  They are the people who do a foreach loop 100,000 times over two functions to find out which one performs 7.9% better.  News flash!  Unless your application is calling something 100,000 times it doesn’t matter which you choose.  And if you are calling a function 100,000 times for a single HTTP request then there is something wrong with your application’s architecture.

At the talk I will talk about some of the main areas where people experience performance problems, some of the symptoms of various performance problems and some tricks you can use to lead you towards the correct diagnosis of performance problems.

I’m looking forward to speaking and I’m hoping you can join me at this year’s OsCon.

Web Analytics