Mostly about my amusement

Category: Geek (page 8 of 36)

Namecheap dynamic DNS setup with ddclient

I recently received an e-mail from my free dynamic DNS provider that said I can upgrade for a fee or I can every month login and re-validate that I’m still using their service.

As I’ve been mooching off of them for over 8 years I really can’t blame them and I fully understand this change.

When I moved my domains to Namecheap one of the options they provide is dynamic DNS so that’s the solution for me. But my FIOS router doesn’t support Namecheap so I setup ddclient on my basement Linux server.

Using Namecheap’s support forum I found what I needed. This post is really my note to myself for when I wipe out my Linux server again and I wonder “How did I do that again?”

Enable Dynamic DNS for your domain

Login to your Namecheap control panel and enable dynamic DNS for your domain. You’ll get a really long password string to use. Save that for now as you’ll need it later on.

Create the DNS entry you want for your host as an A record

I created it with an entry of 127.0.0.1 just as place holder. I’m not sure if this step is really necessary as dynamic DNS should let you create new entries on the fly. But Namecheap’s page says to do it and there’s no harm in prepping for that A record.

Install the ddclient package on your Linux server

I’m using Ubuntu 12.04.2 LTS and the command is simply

sudo apt-get install ddclient

The debconf setup will ask you some questions, just put in what you like. You’ll need to change those values in /etc/ddclient.conf anyway.

Modify the ddclient.conf file

My /etc/ddclient.conf looks like this.

################
# ddclient.conf
# namecheap
################
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
protocol=namecheap
server=dynamicdns.park-your-domain.com
login=my-domain.com
password='ReallYLongStringLooksLikeMD5orso'
my-server

Details have been changed to protect the innocent.

Don’t mess with the server= line, they’re not being cute that really is the name of the dynamic DNS client end point.

The debconf settings that were put in previously won’t work so I deleted /var/cache/ddclient/ddclient.cache and re-ran ddclient manually.

$ sudo rm /var/cache/ddclient/ddclient.cache
$ sudo ddclient
SUCCESS:  updating my-server: good: IP address set to 111.222.12.13

Cool. My server in on my private network so I’m using what my IP address looks like to the outside world.

The ddclient is running as a daemon and when my DHCP assigned IP changes (FIOS does that frequently, no idea why) my basement server will still be resolvable as my-server.my-domain.com. The client will run as long as my server is booted. I use that for testing dumb and harmful ideas and it’s always on.

DNS tranquility has been restored to my world.

Advice for aspiring R/C backyard bashers

There are two types of people who play with R/C cars: serious racers and backyard bashers.

Racers are the one’s who start with an RTR or build-it-yourself kit and commence to customize their car for better acceleration, traction, and overall performance. They assemble their own tires, balance the wheels (on a 1/10 scale car!) tune the suspension, select and break in the motor etc.

Racers are hardcore R/C car enthusiasts. I don’t know any racers.

Backyard bashers are everyone else. Me and the kids are into bashing meaning we race around, jump of home made ramps and we break things. Here’s some tips.

Do your research and start with RTR kits

RTR kits stand for Ready-To-Race or Ready-To-Run depending on who you asked.

My brother got a couple of Traxxas Nitro cars but I decided that I wanted electric and shopped around for a good Kyosho model. My last R/C car was a Kyosho Ultima and I thought they’d have something for me.

That was a wake up call. Kyosho is a fine R/C car manufacturer but no one in Long Island sells them. So I went to look at blogs for inspiration and made my way to Jang’s UltimateRC YouTube channel and forums.

Jang’s reviews are really good. He covers what he likes and dislikes as well as does a durability montage. It was his Bandit XL-5 review that convinced me that the kids could handle getting one. We upgraded to the VXL LiPO version and the kids are having a blast.

Thanks to those YouTube videos I got a good idea that Traxxas is just right for durability.

If you do go electric stick with 7.4v LiPO batteries

My R/C car is a Traxxas Rustler VXL and the kids have a Bandit VXL each. They each came with a Traxxas 3300mah 7.4v 2s 25c battery. I wanted another battery so I took the advice of one of the hobby store guys (they’re very cool) and got a Venom 35C 3S 5000mAh 11.1v LiPO battery. Yay! More current! More voltage! The car goes noticeably faster!

It also doesn’t last as long. Using the 3300mah batteries I get about 20 minutes of run time. With the bigger 5000mah pack I get about 15. Going forward I may get a high capacity 7.4v battery but unless I’m racing (and I never will) I’ll stick with more play time versus more speed and power.

LiPO batteries are scary

OK they’re not really scary but the do have some risks especially if you puncture them: these batteries can catch fire. That’s if you abuse them; if you treat them as they should be handled then you will be fine.

This is the reason the kids cannot charge these batteries. When they get them to plugin into their cars I make sure to supervise them. They know to treat the batteries with respect and handle them carefully.

I haven’t yet but I am getting a LiPO charging bag as well as a fireproof box for storing them. I don’t really think I need that but A) you never know and B) parents need to set good safe examples for kids. Safety is not a game.

Visit and make friends with your local R/C dealer

You are going to break R/C car parts. Yes, you can get any of those parts online but getting them locally is faster and you’re local shop will take care of you.

I live near a shop called Elwood Hobbies and they’ve got parts, tools, kits, everything. I could probably rebuild my entire car just from the parts they already have in stock. If they do not have anything they’ll get it. They also service vehicles from big 1/8 scale nitro cars to R/C helicopters. They really know what they are doing and prevented me from making a few boneheaded mistakes already.

Find your local shop and get to know them. They’ll have parts plus advice and you’ll be glad you did.

Expect to buy upgrades

A not very sensitive friend of mine visited while I was replacing stub axle carriers on my son’s Bandit. My son broke them and I replaced them with aluminum versions. He summed up his thoughts concisely.

“Wow, what a scam! And the lexan shell uses cancer causing paint too???”

He’s like that. We all still like him anyway.

What he was referring to is that when I break things I upgrade to the anodized aluminum parts if I can. I didn’t just buy R/C cars (Lily is a very tolerant woman) I also had planned to maintain these cars.

This is not an inexpensive hobby. I limit the amount I spend simply by buying from a durable manufacturer. Our R/C cars will not win any races but high speed 10 foot jumps are usually alright.

Even if you destroy them it’s all good fun

This is a hobby and you may eventually ruin your toy. I mean R/C car. It’s happened to my brother and sort of happened to me in the past.

That’s fine and this hobby is all about fast, fun, and more fun. The kids and went to a parking lot nearby and had had hundreds of feet to zip around in all directions. It was great! And we broke all three of are cars in minor ways.

Using the tools that came with our cars (another upgrade coming soon) I was able to get 2 of the cars working for a while longer. But if the kids and I had wrecked them then we’d be upset but it would be alright. These little rockets move around 30 miles per hour and you can’t change physics.

I’m having a little unique fun with my kids. Even my daughter likes her customized R/C car (although I do wonder how much of this is just about competing with her brother). They’re learning to take care of their expensive toys and I’m learning to be more patient and tolerant of our mistakes. That experience alone makes me recommend these to any Dad.

I’ve become the kid’s R/C mechanic

For Father’s Day I celebrated by getting both kids an R/C car for their own. Since then they’ve broken pieces and we’ve visited the local hobby shop many times.

This is not a bad thing and it was all good clean fun.

When they break I’ve been showing the kids how to take apart different components of their cars. On the simple side they’ve installed wheelie bars and bumpers. On the more complicated side I’ve replaced the steering blocks and stub axle carriers with aluminum versions.

But the thing that I’m most pleased with is that my daughter asked me to get her a pink body for her R/C car. They don’t make them pink so I’d gotten a ProGraphix Bandit body, a can Tamiya florescent pink paint and  Pactra white paint.

I put many coats on the underside of the Tamiya paint and once it dried I then backed it with mores layers from the Pactra white paint. The Tamiya paint went on thin and clear; I always have problems with Tamiya paints. I’ve used their acrylic spray paint for my Gundam models and it just pools easily and goes on thin.

The Pactra paint was fantastic and next time I’m sticking with just that brand. It applies in good even coats and doesn’t run.

The end result was worth it.

you-go-rc-girl

I only take credit for the color, the lines and pattern came from the factory. It still looks awesome.

She really likes it and for a while today she was very hesitant to play with it. But I explained that these were meant to be used and I can always get a replacement body. She was back to crashing in very little time! Good fun.

I have a similar photo of my son with his blue version (blue stock body from the factory) but he looked like he was swallowing a lemon so I’ll post a different photo some other time.

We need to go to a parking lot more often. The three of use zipping up and down my narrow street has resulted in some interesting crashes. My son is at the moment is the best driver out of us but I expect the girl to give him a run for his money real soon now.

Oh and being the kid’s R/C mechanic? It’s a great job and I think they may continue to give me their business. 😉

Having hobbies is a good thing

Anyone who’s even given my blog a quick look can see that I’m all about my amusements. For the longest time that has been photography. I still love taking and sharing photos but lately I’ve been consumed with a new old hobby.

Radio controlled 1/10 scale cars! Vroom VROOM BABY!

Ahem. I’d first gotten into the hobby in college more than 20 years ago (what???) with a Kyosho Ultima, which I quickly wrecked by t-boning a concrete wall. The chassis was bent in a U shape but I was able to recover most of the parts and put them on a replacement carbon fiber chassis with a new Lexan body.

That was 1987 or so. It’s always been an expensive hobby. I think I was working at a White Castle when I bought that kit.

Now move up to 2013. Stefan recently got hold of a Traxxas Nitro Rustler (a modern 1/10 nitro powered truggy) and since I have a large back yard I got to play with it and had a great time. So I dug out my old R/C car and borrowed  an old Futaba controller.

ultima

More than 20 years later it worked! But not too well. A lot of things changed in the hobby in that time. Un-assembled kits are more expensive and all the big R/C car companies are selling Ready-to-Run kits that you just charge the battery and go. The batteries and ESC improved along with the motors.

Those little monsters take off like a rocket. After some healthy rationalization thoughtful consideration Lily and I went to a hobby shop and picked up the electric version of the one Stefan has. His is red, mine is silver.

It’s still an expensive and addictive hobby. This morning I took the Dremel and cut slots so that I can Velcro strap down the battery. In the weeks that I’ve been playing with it I’ve replaced the front broken caster blocks with aluminium ones as well as the stock tires with Pro-line Dirt Hawgs. Add a new Lexan body (I scratched and put holes in the original and have to paint this one) and it’s beginning to add up.

The kids (yes, my daughter too) and I love it though and that’s the point of all this really. You have to have something that you like to do outside of what you do for a living.

That’s not a hard rule of course. I like and have lots of fun at work and I’m part of a good team. But it’s work and you have to take that seriously even if you enjoy it.

Playing with the kids and spending time on these toys has no consequences other than possibly wasting my time and money. They thinks it’s cool and just zipping up and down the street can be great fun.

Here’s a YouTube video of just that. 🙂

That’s why I’ll continue to find new things all the time to get into. It’s really all about my amusement.

Better living through WordPress filters

codex

Every now and then you find an interesting support question in the WordPress forums. A member wanted to take the HTML YouTube oEmbed code and modify it to suit his needs.

It was an easy set of requirements.

  1. Replace ?feature=oembed with ?wmode=transparent
  2. Append add wmode=”Opaque” to the end of the start iframe tag

My solution was to find all of the embeded YouTube <iframe…> tags in the post and modify the_content via a filter with some preg_match_all code.

You can see the code I came up with via this pastebin.com link.

It’s a nice enough solution and really highlights the point I was trying to make:

You do not have to hack existing code in WordPress to get the results you want.

Just use the available WordPress filters to modify the output as you need.

Jan? You do know you got that completely wrong right?

Yes. Yes I do. Well maybe not completely wrong but the code I posted was not the best solution.

I filtered the content because I’m used to playing in that space and it’s so easy to do. But my solution did not work for the person asking because what he was referring to did not output via the_content. He had to add another filter to make it work.

The original question was about how to modify oEmbed output. That’s a completely different filter and using the right one gets you a targeted solution that will work (should work anyways) at any place the oEmbed output is used.

Last year Mika Epstein posted a plugin called Rickroll that does exactly what it sounds like. It takes oEmbed video and replaces it with the Rickroll video.

You can learn a lot looking at other people’s code. It also has exactly what I needed to examine and make the modification to the YouTube oEmbed html.

Here’s the new code in a plugin.

add_filter('embed_oembed_html','mh_adjustyoutube',10,3);
function mh_adjustyoutube( $html, $url, $args ) {
if ( strstr($url, 'youtube.com') ) {
	// Replace ?feature=oembed
	$mh_new = str_replace( "?feature=oembed" , "?wmode=transparent" , $html );
	// Append wmode="Opaque"
	$mh_new = preg_replace( '/></iframe>$/' , ' wmode="Opaque">' , $mh_new );
	$html = $mh_new;
}
// Modified or not return $html
return $html;
}

This has fewer lines, simpler logic, and it is a solution that specifically filters the oEmbed output. It directly addresses the original question and can be used where ever the oEmbed code gets outputted.

You can see an easier to read version via this new pastebin.com link.

The lesson I learned is this: using WordPress filters is a powerful feature but using them correctly is even better.

Jetpack Carousel for Themify themes

This is probably documented somewhere but I’m posting it here so I don’t forget (again).

I wanted to give Jetpack’s Carousel module a spin but the built in Themify Pretty Photo lightbox kept getting used instead.

To disable the PrettyPhoto lightbox add these lines to your child theme’s functions.php file.

add_action('wp_enqueue_scripts', 'mh_remove_pretty_photo', 20);
function mh_remove_pretty_photo() {
        wp_dequeue_style( 'pretty-photo' );
        wp_dequeue_script( 'pretty-photo' );
        wp_deregister_script( 'themify-carousel-js' );
}

That will let another lightbox be used instead such as Jetpack’s Carousel. The 20 argument in the add_action() is to make sure my function gets queued after the parent theme function.

Just don’t use it one handed

note-ii-phone

I’m not sure how it happened but my blog has been possessed by Android smart phone posts. I’m pretty sure I have an add_filter('the_content' , 'my_function') WordPress post in my head waiting to get out. Or at least a post about a small plugin.

When is a phone not a phone?

After Lily’s Note II came back to life we realized that her phone developed an odd condition. It stopped being able to make or receive phone calls. To fix this we called up Verizon on Sunday and spent way to much time with some nice people trying to make it work.

Did you know that Verizon’s tech support can with your permission remote desktop into your Android smart phone? I had no idea and it’s weird seeing someone else run apps and make menu selections. That didn’t really solve anything and eventually Lily and I were told that they’re escalating her problem to engineering.

Me: Engineering? That’s great, let’s get them on the call.

Verizon Support: Oh no sir. They will call you back in 24 to 72 hours.

That went over well. I asked them to create the ticket anyway and to see if we could visit a local Verizon store and swap out the LTE SIM card as that was suspected to be the problem. That didn’t solve anything but at least we got out of the house.

It’s all part of a Grand Plan, I’m just not privy to it

While at the Verizon store I took advantage of my upgrade option and purchased an iPhone 5. I then had them put my number on Lily’s not-a-phone Note II and she got the new iPhone 5. Seriously, that happened.

Lily and I commute into Manhattan together so as soon as she got her Note II smart phone I was playing with it. It’s got good battery life, the display is fantastic, and with a 1.6 Ghz quad core processor it is fast and zippy. I used it to tether my laptop during out commute and it worked fine. I told Lily that I’ll get one for myself from Costco.

Lily: That’s just not acceptable and we can’t have the same phone. Why don’t you get the iPhone 5?

Me: Sure I- What?? I’ll spray paint the back of it red. You’ll never mistake mine for yours. And I don’t want an iPhone.

Lily: You just don’t understand. Get the iPhone 5 and we’ll switch numbers.

Me: . . .

poor-marvin

I don’t claim to understand but years of conditioning have done me in. In another dozen years I’m going to be like Marvin in RED.

Monday morning I called Verizon back with “Nice one! Now when can you get me my replacement phone?” and on Thursday FedEx delivered it. This new one actually can makes and receive  phone calls.

Yeah but what about the Note II?

It’s a great smart phone. The one I had before it was an HTC Thunderbolt and it’s night and day in comparison. My old phone was giving me well deserved grief and was working very poorly. This one is fantastic and works like a charm.

There is one draw back though. This phone is ginormous. The screen is 5.5″ diagonally but that doesn’t convey it properly. Think of using the iPad Mini as phone  and you’ll get the idea. You have to operate it with both hands or you will either hurt yourself or drop the phone. It’s just too big and my hands are too small.

It’s the CURSE!

I’ve been complaining about my cell phone on Twitter and elsewhere for many months and have been contemplating getting a new phone. My choices have been narrowed down to the Samsung Galaxy Note II and the Motorola Droid Razr Maxx HD.

Lily got the Note II because she likes the big screen and battery life. I was leaning towards the Maxx HD (32 hour battery life!) but the Note II’s 4 core CPU makes the phone really zippy and the battery life is not bad even after abusing it.

So I took her phone with me to drop off the kids at Chinese school Saturday morning. That was her idea so I can see if it’s too large for my pocket (it’s not) and if I like using it (I do).

While there I saw a flower and took out her phone to take a quick snap. The Note II phone was dead. Dead as in 100% no lights, not responding, removing the battery did nothing. Naturally I did what most grown up men in my situation would do.

It’s important to appeal to the general public in case, you know, something unfortunate happens to me.

After getting home and apologizing to Lily profusely we found that removing the battery and SIM card (it’s an LTE phone and does have a SIM card) did bring it back to life.

he-broke-it

This is not the first time electronics have lost their mind around me but I wish my curse would remain localized to things that belong to me.

Maybe my phone problem IS my own fault

DSC_6302

I like to play with all of my toys and of course I rooted my HTC Thunderbolt phone long ago. I’ve done the whole gamut and have installed different ROMs including CyanogenMod, the unofficial ICS ROM from Team BAMF, and many flavors of Gingerbread. I’ve used apps that require root privileges, I’ve tethered and played with different radio code to get it all working well.

I’ve also created an unsupportable pile of poo that has been driving me nuts.

The damn phone loses data connectivity all the time. I have to baby it just to be able to read my Twitter feed. The battery life is embarrassing and I feel like my charger has become my lifeline. The phone crashes all the time and has spontaneously caught fire on more than one occasion.

That last part may have been an exaggeration but not by much. As sometimes it happens to people suffering in a crisis someone in my life intervened. Lily spoke those words that made me considered a new path filled with enlightenment:

“This happens to you with every phone you have. Maybe you are doing something wrong?”

She’s a smart woman. I’m lucky to have married her.

She is currently using an unmodified Samsung Galaxy SIII phone and except for the battery life not being as long as she’d like she hasn’t had any problems.

The real reason I hacked my phone (aside from the geek coolness factor) was to be able to run a tethering app. But now with the phone plan I have tethering comes with it at no additional charge. Instead of running a third party tethering app I can now just use the built in one from Verizon.

So last night I undid everything I did to my phone. I un-rooted it, I put it all back to the way it was from the factory and I’m now running the latest Verizon provided ROM on my phone. That includes the radio code as well and anyone looking at my phone would never be able to tell that I did anything to it.

I’ll still beat it to death and see if I can my phone to misbehave. I’ll also still get a new phone when I can as I’m up for getting new one, but maybe I’ll learn not to poke or break the next phone.

Golden Gate Bridge from Alcatraz

This was taken with my Sigma 30mm f/1.4 lens with a circular polarizer from Alcatraz Island.

Nikon D300s, Sigma 30mm @ ISO 200 f/5.6 1/8000 second, Aperture Priority

Not too shabby. Except for cropping and straightening it out (I can’t quite get the horizon right holding the camera by hand) I hardly made any changes at all.

Using Photoshop Elements 9 and saving for the web got me some banding on top, but the original Nikon RAW file is good and that’s what I’ll upload to Flickr.

Now to finish going through the pile and post the ones I like.