-rw-r--r-- 3.8K Aug 29, 2011 · A8CAA25 · ~4 min

MacBook Pro is afraid of sand

ремонт macbook pro

The weekend was spoiled by my MacBook Pro: it had gone to sleep at the office, woke up at home, and a few seconds later froze solid. Had to do a hard reset.

The OS refused to boot — neither from the main partition nor from the Recovery HD partition that OS X Lion creates for restoring/reinstalling the system. Although the MacBook could see both partitions. I managed to boot from a USB stick.

My first thought was something wrong with the hard drive — either partitions had detached or the disk was dying. I pulled the drive, hooked it up to my second Mac via a USB enclosure. All files in place, no signs of trouble. OK, I figured, time to reinstall macOS from scratch — looked like a software glitch, those upgrade-from-previous-version updates can be flaky.

Backed up everything, ran Disk Utility’s repair, it fixed something I didn’t understand. Stuck the drive back in — decided to try booting from it — and lo and behold, everything worked. I breathed a sigh of relief, shut down, started up, slept the laptop, woke it — all fine.

[↵] open page macbook-pro-boitsya-peska.md
-rw-r--r-- 290B Aug 29, 2011 · 6D6EADB · ~1 min

Mounting HFS+ partitions on Ubuntu

ubuntu hfs

Needed to mount a drive with the HFS+ file system (the one Mac OS X uses). It’s pretty easy. Ubuntu’s repos have a package called hfsplus.

sudo aptitude install hfsplus
sudo mount -t hfsplus /dev/sdf2 /home/username/folder

To unmount:

sudo umount -t hfsplus /dev/sdb2
[↵] open page podkluchenie-hfs-razdelov-v-ubuntu.md
-rw-r--r-- 1003B Aug 28, 2011 · 6D3A132 · ~1 min

Canon 60D

canon 60d фото

Hooray — got myself a new body, the Canon 60D. I’d been wanting a 7D for a long time, but eventually, thanks to @theproof and a couple of other people, it turned out the 60D has the same internals as the 7D — same processor and same sensor. The 7D just has two processors, which only really affects burst-shooting speed and how many frames in a row it can manage. A few photos taken on the way home, below the cut.

[↵] open page canon-60d.md
-rw-r--r-- 5.1K Aug 23, 2011 · 897ADAD · ~4 min

Working with JSON (parsing) in Objective-C for iOS

ios разработка json twitter

Another post — to help things settle in my own head. About working with JSON in Objective-C, using parsing of tweets from Twitter’s public timeline as an example.

[↵] open page rabota-s-json-parsing-v-objective-c-pri-razrabotke-pod-ios.md
-rw-r--r-- 1015B Aug 22, 2011 · 1F09394 · ~1 min

Trimming the trailing slash in URLs with a 301 redirect

php seo полезное

Why not pin this here — easier to find later, when I need it again. Search engines often treat pages like

arm1.ru/blog/yandex-upal-panika-v-twitter

and

arm1.ru/blog/yandex-upal-panika-v-twitter/

as different pages. So you end up with the same content technically living at two URLs, which isn’t great. Below the cut — code that automatically strips a trailing / via a 301 redirect, so search engines don’t end up with duplicate pages.

<?php

# strip the QUERY_STRING from REQUEST_URI
$uri = $_SERVER['REQUEST_URI'];
if ( false === empty( $_SERVER['QUERY_STRING'] ) )
    $uri = str_replace( '?' . $_SERVER['QUERY_STRING'], '', $uri );
			
# 301 redirect when there is a trailing slash on $uri
if ( substr( $uri, -1 ) == '/' && strlen( $uri ) > 1 ) {
    $queryString = '';
    if ( false === empty( $_SERVER['QUERY_STRING'] ) )
        $queryString = '?' . $_SERVER['QUERY_STRING'];
 
    header( 'Location: ' . substr( $uri, 0, -1 ) . $queryString, true, 301 );
    exit;
}
[↵] open page obrezanie-slesha-v-url-s-301-redirectom.md
-rw-r--r-- 3.5K Aug 16, 2011 · 457C13F · ~3 min

Recap of Apple Developers Community #7 meetup

ios продвижение приложений

Went to Apple Developers Community #7 today. The talks were about marketing iOS apps. Two people effectively presented — a representative from Nevosoft, who seem to crank out games on a conveyor belt, and one indie developer.

[↵] open page resume-vstrechi-apple-developers-community-7.md
makoni@arm1:~/blog$ cd ../page-35/ // ← previous cd ./page-37/ // more posts →