Posts

Using PyCrypto with Spring Crypto/Spring Security Default Encoders

Spring Crypto Encryptor Details The Spring Crypto module is amazing. Secure defaults using standard interfaces really make it a pleasure to use, and with it being full tested and vetted, it also gives a develoepr the warm fuzzy feelings of nice Java security implentation. The standard interface is through the  org.springframework.security.crypto.encrypt.Encryptors class, defined (in version 3.2.0 here (the class API to which this blog post was written in July 2016). Spring Crypto uses AES256 encryption behind the scenes in its out of the box class setup; it's as easy as: In the above code snippet, the password  variable is a passcode, with the salt  variable used to create the AES key. It uses 256 bit encryption with the standard calls (depending on your JRE/Java Cryptography Extension (JCE) Setup, make sure to download the appropriate extension ). The default AESBytesEncryptor setup generates a 256 bit key (32 bytes) from a salted iteration done 1024 times. ...

LA Public Library Overlays, Take 1 redux

Image
I wanted to start a project that would try increase the use of the local LA County library system. To do so, I thought it would be awesome to get more people to stop buying books online and instead checkout books from their local library. I still need to work out some kinks, but I created a github repo that will overlay any links (with ISBN-10 urls -- a small subset) to purchase a book from Amazon to re-direct to the LA County Library website search. For instance, say there are links in the page like the following: City of Dragons by Robin Hobb O’Reilly’s Information Architecture for the Web (This was highlighted by the librarian when I was asking about API access :P) Right now there is nothing special about the links. You can hover over them with your mouse to see that they point to Amazon. To see the code in action [If using chrome: Drag this link onto the current tab][With Safari, drag it onto your Bookmarks bar, then click on the bookmarked link][Other browsers: ...

Blog Code Formatting

Note (2012): This post was about a previous webdesign, and no longer applicable. I finally added code formatting to my blog. I used a completely 'client side' javascript library called syntaxhighlighter , hosted on Google Code . Note that I'm currently linking javascript directly from their web facing SVN repository, so I'm not sure how stable it is (but hosting it on googlepages didn't seem to work (they disallow js linking I believe)). Although it is a technology blog, I thought I posted more code about stuff. I only seem to have two posts where I actually put up any code (But maybe that's because it was horribly formatted?), and they now both have pretty Java and XML formatting: http://tmarthal.blogspot.com/2008/02/spring-framework-sample-main-method.html http://tmarthal.blogspot.com/2007/03/my-foray-into-xmlrpc-calling-perl-from.html Maybe one of these days, I'll find use for a blog again. The whole concept of blogging seems so dead.

My Yahoo! Answers Science Post

I am my dad's personal Yahoo! answers person when it comes to things science and physics. So when I received a question on the dual nature of light and matter, I wrote him back a nice long (LFP!) email in answer. I thought I'd share. Question: Sound travels in waves and needs an "ether" for transmission. Light is also a wave but doesn't need an ether. Is light in space "wave" or "particle"? because when light bends do particles bend or this this one of the examples of light as wave? Answer: Sound is a pressure wave. It is the compressing of molecules. It is the compression that is the sound. Light is a wave of electromagnetic fields, fields in this case being force representations. The light wave is a constant of nature in which a electric force changing will produce a magnetic force which will cause an electric force in a stable, repeating way traveling forward. There are other places where electricity creates magnetic forces and v...

how i saved my windows xp installation with knoppix

so its true. the difference between a ' digital native ' and a 'digital immigrant' is the amount of information that they contribute to the world. I absolutely hate having to wade through google searches to find an answer to my problems, so I try to post here about some of my tech adventures (even though it might be nerdy ) hoping that one day a spider would come and crawl/index it and provide answers to people for the same questions I couldn't find answers to! So I tried to upgrade the ATI Radeon drivers on my Windows machine for my old video card (thinking it would improve performance! hah! no.) but I could not get Direct3d to work for my ol' Radeon 9500. After the 26 or so re-boots fiddling with the hardware, the hardware connections and the hardware drivers, something finally happened to my Windows XP OS partition. It got fried. I tried to boot up, but after the BIOS loaded I would get the error: Windows XP could not start because the following file i...

The Internets Is Scary Sometimes

Sometimes, you think that you are covered on the internets (all of them!), but then I get an email like this to my primary account: As a courtesy, we are notifying you that XXXXXX users have found the following accounts for you:    Flickr tmarthal on Flickr    Digg tmarthal on Digg    MySpace birddog on MySpace    Picasa marthaler on Picasa If you would like to make these accounts private, please change the privacy settings on the original network and XXXXXX will update its search results to reflect your changes. To find your friends on XXXXXX, signup now. I removed the company that sent the email, not sure that I want to encourage this type of email and account harvesting. The point is, that someone, somewhere has correlated my different accounts on my various networks to my single email signon. Someone, somewhere knows my that the articles dugg on digg are associated with the pictures that I post on flikr !...

Spring Framework Sample Main Method

So my desk-mate* and I were having a conversation about an upcoming coding project, and he remarked how nice it was for someone, somewhere to post a complete sample on their blog for the spiders to index, so that he can find it. So I thought I would also, pay it forward and hopefully someone in like 2012 comes by and needs a sample main method using the spring spring framework for application level dependency injection. Everyone out there seems to have used the MVC and deploying spring based apps in a web server WAR file. Except for this link: Levarage Spring Web development with Offspring . [Offtopic: it uses classes in the com.offspring.* package, like the band's website !] It uses a simple bean file and a main method really close to the following snippet to instantiate (that's my new favorite word) the application using the spring context**: import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; ...

Dolphins Make Me Happy

Lately, I'm not sure if its part of a seasonal migration or something, but there seems to be a lot more dolphins in the water. And they seem to be a lot more playful. Meaning, they swim under/close to us when we are surfing and jump and twist out of the water pretty frequently. I should get pictures. They also seem to show up when we are surfing right when a huge set is about to roll in, and the dolphins always seem to ride the set waves while I try to survive the overhead+ sets. So anyways, read this today: http://www.msnbc.msn.com/id/21689083/ Basically dolphins showing altruistic tendencies towards a surf and protecting him while in the ocean. So they know we're out there. I wonder if they hear me when I jump in the water and screech back to them. :) </happy>

double-tap it

So, oftentimes on my iphone I would unlock it and my ipod controls would come up. I thought it was a bug for a long time, since the controls went away so fast... but it is a feature! It turns out you can access the iphone ipod controls while the phone is locked or in a different menu than the ipod interface by double-tapping the home button! So, double tapping to wake goes directly to the ipod interface pause button... handy when people are trying to talk to you and you're listening to music! You can also double tap from any interface and the ability to fast-forward/rewind/pause comes up. Neat-o. Are undocumented features like this a reason to upgrade your firmware? This is only a iphone 1.1.1 September 2007 update feature or something.

I've got the whole internet in my hands

Following up the xkcd.com "comic" , a sweet idea to map the IP address range and their owners into a 2d map (where all adjacent values are grouped together), some bored people over at an email consulting company mapped out the IP addresses and activities using actual CAIDA 'whois' data in a scalable google map. CAIDA (The Cooperative Association for Internet Data Analysis) collected the data as seen in the huge png: Huge CAIDA PNG The scalable 'google maps' like viewing of the Hilbert Table is here: http://thewholeinternet.wordtothewise.com/ I should be all Blog2.0 and post this as a trackback, but they don't have the option. It is pretty neat to take data that you normally don't visualize, in this case the assigned DNS IP ranges of organizations and put them together in a way that can make the lay-person understand something new. In this case, you can see the companies that 'formed', or at least were the first to embrace, the intern...

updated blog license

i know that i'm not a major player in the content creation business (I just know those kids in Japan are stealing my blogs, translating them, and calling them their own!!) but I put the license at the bottom here, the Creative Commons Attribution 3.0 United States License . That's what the Creative Commons tells me when I select Yes to "Allow commercial uses of your work?" and "Allow modifications of your work?". So, all of you people re-mashing my sweet blog via your Pipes or Mashups , then feel free. =) I also reduced the number of posts on the front page (soon my xmlrpc blogpost will have scrolled off) and added the archival links at the bottom. Enjoy.

iphone news

What this post boils down to is $100 for 2 months of sweet iphone usage. =) I can't say that I'm disappointed, my $499 4GB iPhone purchase was a sunk cost, and I expected some 'early adopter' problems. I did not expect news that apple would cost them so aggressively so soon. Today apple released news that they are getting rid of the 4GB iphone models and dropping the price of the 8GB version to $399. Pretty crazy. But the last two months were worth the hundo! We do throw them out of windows, you know. -- And in a suprising move, jobs offers $100 credit back to early iPhone adopters ! There is a first time for everything, I guess.

My First iPhone Problem and Post: Google Maps Hardlocking

I had been using my iPhone without a problem since I got it opening day, June 29th at the Manhattan Beach Apple Store . [Thanks fulk dog for waiting in line!] Everything was awesome; contacts, pictures, youtube, Safari integration, everything. No problem activating it, like others have reported. I didn't usually let people handle it, I'm crazy like that, because they would have no idea where to start. So I would show them around all of the features; usually open up my Boards of Canada video to display the screen, surf the contacts and show them how to put their number into the phone, and/or show them Safari and my friend Deward's blog (since it looks super nice in the iPhone browser ) depending on if I was on a wireless network or AT&T's EDGE. Take a picture, show them some pictures from that bar crawl from mid-June. Normal things that you would do with an integrated device that bills itself as a revolution! So, fast forward to last Saturday night. I let my ...

my foray into xmlrpc - calling perl from java

Image
XMLRPC is supposedly the new RPC mechanism to handle remote method calls independent of programming language, platform type, or location. Basically, it is how CORBA was supposed to be. Of course, it formats data into xml packaged into an HTTP message. This is not SOAP though, and I still don't really know the difference, other than SOAP is a the packaging for WebServices and has its own strict way of defining method and method arguments(?). Anyways, XML-RPC sounds perfect to get some crappy Perl to Java method calls working! The problem as I see it, is that the XMLRPC mechanism is usually "extended" to handle language specific needs. This makes things a lot easier when you are using it to call remote methods in a uniform environment. The problem is that thats not what I want, as extensions in Java will make the Perl methods die. A horrible death. In Perl there are two cpan modules that facilitate the XMLRPC mechanism that I tried: RPC::XML and XMLRPC::Transport in t...

xkcd

The webcomic xkcd was recently featured on a popular tech website which I frequent . The author spoke at mit about his life and writing (and was interuppted by students ), so I started reading the comic. Man, is it good. I just started reading them, and got lots of the way through. Then I realized that there is a second level of awesome, in the img alt text tags. And then I read most of them again. Some of my favs, in no particular order: http://xkcd.com/c181.html - Interweb Net Codes! http://xkcd.com/c113.html - Zeta Functions 4 Pres! http://xkcd.com/c128.html - :-( http://xkcd.com/c132.html - 4 d3w4rd <img alt="how many links is he going to inline?!" src="./holla.jpg">

ipod shuffle

So i broke down and got my 2nd ipod, a 1gb ipod shuffle . Since my 4gb 1st generation ipod nano is stuck in my truck's dashboard (most likely still playing the same thing \=)) with my 'USA Spec IPOD Interface' Toyota connector. Hopefully this will be my more 'used' ipod (aka updated regularly and listened to at the office, during outdoor activities, and in the bathroom). It was set to shuffle and the first track was my favorite Kanye West track Gone . Wear your music! yay! \o/ i need to do some css editing with those dang labels. p.s. i still rule

CSS Templates and Blog Spam

So, I was perusing my other blog today and deleted a drug spam comment for the third or fourth time in as many days from one of the more recent posts. In this case, it was my friend Jake dancing in leotards... but the spam comments are always there, always posted on the top message. Prior to this, the blog spammers, people that post either poker referrals, drug purchase links, 'hot' stocks, online diplomas [almost as bad as the USC DEN program !], or money making schemes all seem to never have posted on this '...' blog. I used to think that it was because it had custom CSS that I use to display the pages, and that comment bots couldn't figure out which link to click when they came to my page. That can't be the case now though; I think that more and more pennies/day workers are being paid to drive views to sites rather than bots. I have to say that is the case, I had 15 comments my museum post which is pretty crazy considering I get like 1 unique visitor a m...

Smithsonian Museum Day

This September 30th, 2006 is Museum Day! . The Smithsonian Institution started a free admission day a while back and most museums around the country (even if they already offer free admission) are getting into the spirit of the free Museum day! It's a Saturday ferchrissakes, nothing better to do that day ( USC has an away game ). So go to the What is Museum Day? website already and print out the admission card located there. Wherever you are located, there is a museum nearby participating! There are so many sweet places to go: maybe get my bro to head to the defense museum in San Diego , check out the only museum with only electronic art , maybe see some quilts (I'm big into quilting!), or just see one of the many art museums located around LA. WIHSTGW =(

hoodies

So, some of you might not know this, but I am very particular (peculiar?) about my hooded sweat shirts . I usually buy 2-3 new hoodies per year, and end up not liking most of them due to shoulder-area fit, color change, sleeve cuff, softness, waist area cinch type, or depth-of-hood. (Yeah, like I said peculiar ). There are two general types of hooded sweat shirts, flat-fronts and zip-ups. Flat-Front Hoodies: These are normal sweat shirt shirts, but with an added pocket in the front and a hood (which makes it the hoodie ). Zip-Ups: These have the same hood, but zip up in the front. They sometimes have no pocket but most have have a split front pocket. Well, this isn't about the criminal nature of hooded sweatshirts, or the fashion, but a zit pick about zip-up hoodies: Zippers!! Most of the cheaper zip up hoodies come with plastic zippers. They are fine for the first couple months, but if worn in extreme cold (like while snowboarding), plastic zippers have a tendency to break...

You are here, it is now. Start.