Half-Elf on Tech

Thoughts From a Professional Lesbian

Author: Ipstenu (Mika Epstein)

  • Replacing a Hard Drive

    Replacing a Hard Drive

    Once in a blue moon I play with hardware. My home laptop has been dropped more times than I care to admit, and it’s finally started to make bad noises. And be slow. As in, I can run one app at a time slow. So I buckled down and put the comic book money into a new hard drive.

    I picked Other World Computing’s Extreme Pro 6G SSD. At 450G.

    The content on my laptop has been around since I was in college and bought my first laptop. Literally. I have every paper I’ve written since high school on here, plus music I wrote, plus videos. It’s a lot. My old HD was 300G and I was always low on space. I also make copious backups to Time Machine. The last four times I got a new computer, I did a Mac transfer. This content, hell, this user account, has been around.

    You bet your ass I kept it again.

    Installing the new HD was easy. Unscrew the back, disconnect the battery, remove the old HD, get the mount screws out, put them and the sticker on the new HD, reconnect everything. screw it’s all back together. Next, though, is the hard part.

    I took my old HD and put it in an external drive case. OWC offers a deal where you get the case and a USB connector for cheap, plus all the tools. Perfect. While I have Time Machine, an over air restore would be 24+ hours. A USB restore, provided the HD doesn’t break, would be about 4. Instead of installing the OS and copying things over, I did a restore from Source.

    Once I got the old HDD in an enclosure, I attached it to your Mac via USB. Then I rebooted the Mac, which took me to OS X Recovery. From there, I clicked on Open Disk Utility and picked the new drive from the left hand pane. There I chose to Erase it and format it to Mac OS Extended (Journaled).

    Once done, I clicked on the Restore tab. I picked the external HD (the old one) as my ‘Source’ and the new one as my ‘Destination.’ Illogically, this is a drag and drop step. Sorry about the photo:

    Terrible photo of what it looks like

    When the data transfer was completed, it was as simple as a restart.

    If you’re skittish, you can put the new HD in the enclosure and copy it that way, booting off USB when you’re done to test it. I’m a little more daring.

  • The Bias of Transparency

    The Bias of Transparency

    When I was in elementary school, we used to go to SeaWorld all the time. I loved seeing the animals, I loved being able to pet and feed dolphins. I loved the whole data dump of the ocean information. I went back in the days where the trainers were in the water with the orcas. I fed one once, and patted it’s nose. I danced with a seal (and sea lion). I really fell for the whole “Humans and animals together!” patter.

    And then I grew up and read about how SeaWorld got those animals in the first place.

    Your personal feelings on movies like Blackfish aside, even SeaWorld admits today that they were wrong in how they captured orcas back in the day. They were cruel and wrong, and SeaWorld hasn’t done that in 35 years. But the part of me that is upset with them is the part that wants to know why it took Blackfish to make them step up and say that. And the part of me that’s livid is the part who asks why they don’t disclose their history as a learning experience?

    Transparent Fish

    Transparency in development is not a new thing. Technology used to be a magical black box, but the more people embrace open source, I feel they’re more willing to express their issues and explain things that have happened. Even when you don’t understand the whole explanation, being told something like “Yes, the outage was caused because some electrical work caught fire” is much more satisfying than “The outage has been resolved.”

    When I talked about why an outage didn’t inspire me to change my webhost, much of the reason was because of communication. While it could have been better, my host was transparent with me such that I knew what was going on. Perhaps not as fast as I wanted it, but I did, at all points in time, know what the deal was.

    Being up front about problems gets messier when you start to talk about things like security. Earlier in the year, MailPoet had a security vulnerability. They fixed it, pushed the fix, and then it was reported on and everyone found out. People were surprised to find that the exploit was hunted down by people now that the information was in the wild, and others pointed fingers at the reporters for publicizing of the issue.

    It’s a double edged sword. If they don’t report on the situation, people don’t understand how important it is to update. If they do make it public, the bad guys know what to look for. That’s why you get things like the accidental DDoS from TimThumb. People knew to attack for it, and they did. It’s the same thing with the HeartBeat vulnerability or the recent Bash issue. Once a vector is found, it will be exploited.

    There isn’t a perfect answer here. There isn’t a perfect balance between information and education and secrecy. We want people to know “Hey, fix this!” but we don’t have a way to tell them without telling evil people. This ends up making us want to keep secrets and hide the truth, which just isn’t going to work in the long run. The only practical answer would be to fix this as soon as possible and hope no one hits us in the meantime.

  • Featured Image Size Redux

    Featured Image Size Redux

    One of my themes didn’t have a Genesis Featured Image.

    Actually it did, but it didn’t have it as an named additional image. And this was a problem because I like to have the featured image size listed in my featured image box, as I explained how to do in my post about how to do this in Featured Image Size. That theme was using the ‘medium’ size for featured images, which meant by code made the box look like this:

    Busted Featured Image Size

    This is because I had no $_wp_additional_image_sizes, and that’s what I meant when I said there was no named additional image size. So I had to change up my calculation and check first if the name of the image size was one of the defaults, ‘thumbnail’, ‘medium’, or ‘large’, and size off that and then check the other options.

    Which gives me this:

    // What is my image size?
    add_filter( 'admin_post_thumbnail_html', 'helf_admin_post_thumbnail_html' );
    
    function helf_admin_post_thumbnail_html( $content ) {
    	// Define what the name of our featured image size is
    	$genesis = get_option('genesis-settings');
    	$genesis_image_size = $genesis['image_size'];
    
    	// Get featured image size
    	global $_wp_additional_image_sizes;
    
    	if ( in_array( $genesis_image_size, array( 'thumbnail', 'medium', 'large' ) ) ) {
    		$size_width = get_option( $genesis_image_size . '_size_w' );
    		$size_height = get_option( $genesis_image_size . '_size_h' ); 
    	} elseif ( isset( $_wp_additional_image_sizes[ $genesis_image_size ] ) ) {
    		$size_width = $_wp_additional_image_sizes[$genesis_image_size]['width'];
    		$size_height = $_wp_additional_image_sizes[$genesis_image_size]['height'];
    	}
    
    	$my_featured_image = $size_width.'x'.$size_height;
    
    	// Apply
    	$imagesize = '<p>Image Size: ' . $my_featured_image . 'px</p>';
    	$content = $imagesize . $content;
    
    	return $content;
    
    }
    

    Right below the global check, I do an if to scan the array and grab the sizes based on that. It’s exceptionally simple, and the major change was moving it to set variables and then setting based on those outside of the if/else check. But it works perfectly on both my sites with regular sizes and the fancy sizes.

    I still don’t have a check to see if the theme is Genesis or not, but this multisite is 100% Genesis for all sites, so it’s not an issue for me. If anyone has a way to check “Is this active theme on this site Genesis or a child,” please share. The world will thank you.

  • WordCamp Tokyo

    WordCamp Tokyo

    There was something about me being busy this year… I’m headed overseas on the 7th to my second international WordCamp (Montreal being the first, back in 2012).

    WordCamp Tokyo 2014

    WordCamp Tokyo, I will be on a panel discussing the Worldwide Usage of WordPress. Representing America, I’ll be on an international panel to explain where I see WordPress being used and where it’s going here (and in Canada, I can speak for them, I am half-Canadian, I’m my own hat!). I am highly delighted about getting to say ‘international panel’ to some of my family. This is my first time on a panel for WP, though!

    Wapu - MascotThis is my second trip to Japan. The last time was in 2008 when I spent 12 days hiking around Shikoku with my father and brother, visiting the temples of Henro in Awa Prefecture. One day I’d like to get the chance to finish the hike. It was beautiful and amazing and blew my mind.

    Also this is why I had to decline WordCamp Europe and Dallas/Fort-Worth, both of which I really wanted to attend. I can’t do that much travel in that short a time, seeing as WordCamp SF is right around the corner. I’m really excited to be going to Japan and getting to talk about WordPress while I’m there. This is one of those things you hope will happen when you get a job with a company as cool as DreamHost.

    I know I won’t see many of my regular followers there, but I will see some wonderful new faces and I can’t wait.

  • Drag to Choose File

    Drag to Choose File

    I don’t know why I never knew this. Did you know you can drag a file to the ‘select file’ button on Chrome?

    You know the button, right, this one that just says Choose File:

    Chose a File Dialog

    I happened to be testing if the drag/drop area was working (it wasn’t) and I noticed the button changed colors when I dragged the file over it:

    As you drag, the color on the button changes

    So I let go and it was there:

    Drag complete, and the file is selected

    And yes, it worked. This will save me hours of work!

  • Single Site Login Loop

    Single Site Login Loop

    Have you ever tried to log in to WordPress and have the login page just refresh with no errors?

    No, I don’t mean that Multisite Login Loop.

    After upgrading a bajillion people to WordPress 4.0 on DreamHost, I noticed something a little weird. People couldn’t login and they didn’t get an error. They would put in their ID and password and the screen just refreshed. So I took a look and decided to start with the obvious tests.

    Assuming that the username and password were correct, I checked what happened with a fake account and password. I put in ‘admin’ with a password of ‘areyouduckingme?’ (which no one but me would use) and expected to see a nice login error like this:

    WordPress failed login  - invalid username

    I did not. Right away I knew what was wrong. There was a miss-match with the home and site URLs!

    At DreamHost, we allow you to pick if you want to force www or non-www or not at all for your domains, and I always go to check what the customer did there, just to see. If they picked ‘neither,’ then I’ll usually flip it to non-www because I hate www in your domain and I’m fixing things. Of course, if they have set it to www or no-www, I make a note and honor that.

    Then I go check the home and site URL and make sure they’re both the same in so far as the domain does. If one is www.domain.com and the other is just domain.com, and 50% of the time, it was this all along. The other 50% is that WordPress thinks it should have www and the domain settings think it should not. The point here is that everything needs to match up nicely when it comes to your domains.

    It’s also a good idea to check the .htaccess to see if they’re forcing it one way or the other in there (I do).

    And you’re done. Refresh the page, see if you can login. Should be magic.

    Of course the question is then why did this happen, and the answer is that WordPress is trying to make it harder for people to break into your site. Part of these means making sure that cookies match domains properly, and when you have an inconsistency like www.domain.com and domain.com, the cookie is invalid and WordPress doesn’t know where to go. It wants to go to one but gets tossed to the other.