depicus

changing the digital world one bit at a time...

Blants (noun) the rants of a blogger

  1. Change File Names of Videos in OSX with ExifTools

    March 26, 2018 by The Man
    1. Grab a copy of ExifTools from https://github.com/alchemy-fr/exiftool
    2. Run exiftool '-filename<CreateDate' -d '%Y-%m-%d %H.%M.%S%%-c.%%le' -r /Users/Depicus/Desktop/Videos

    Easy

     


  2. Apple’s Black Friday Con

    December 4, 2017 by The Man

    So it was time to replace my sofa laptop (a nice light one I do bits and bobs on and is currently a MacBook Air 11″) so I looked at the new MacBook Pro 13″ with Touch Bar. The first “con” is that while Apple sells base systems to resellers you can only buy a fully specced out model from Apple direct. And that means no discount.

    So I ordered a near fully specced out MacBook Pro 13″ which wasn’t cheap but as it was Black Friday Apple were offering a “free” £120 gift card, and by free they meant they charge you £120 for it. Ok they take that off the price of the laptop but there are two problems with that.

    First this is for work so I can claim it back on taxes but they invoice you £120 less on the laptop and don’t provide an invoice for the gift card. So I’ve lost £120 in taxable deductions, bummer but not then end of the world.

    However secondly if like me the shitty DHL fail to deliver and like me you cannot wait 2 weeks to get a replacement from China then you’ll be refunded the cost of the laptop but not the gift card which is non-returnable. And what’s the point of a £120 gift card for Apple when there are few things you cannot get elsewhere cheaper, especially the tat they pass off as cables at some incredible prices.

    Lesson learnt – never buy from anybody who used DHL and avoid Apple Online Stores as the support is pretty crap.

    Sad really.


  3. Find large files in OSX

    May 15, 2016 by The Man

    This is just a reminder to myself as finder doesn’t find all files so…

    sudo find / -size +1G


  4. Using HKBiologicalSexObject in HealthKit

    June 4, 2014 by The Man

    If you need to get the sex from Health then ask the normal way but add sex

    In your .h file

    @property (nonatomic, readwrite) HKHealthStore *healthStore;

    then in your .m file in didFinishLaunchingWithOptions or anywhere appropriate.

    // Set up an HKHealthStore, asking the user for read/write permissions.
        if ([HKHealthStore isHealthDataAvailable]) {
            self.healthStore = [[HKHealthStore alloc] init];
            NSSet *writeDataTypes = [self dataTypesToWrite];
            NSSet *readDataTypes = [self dataTypesToRead];
            
            [self.healthStore requestAuthorizationToShareTypes:writeDataTypes readTypes:readDataTypes completion:^(BOOL success, NSError *error) {
                
                if (!success) {
                    NSLog(@"You didn't allow HealthKit to access these read/write data types. In your app, try to handle this error gracefully when a user decides not to provide access. The error was: %@.", error);
                    return;
                }
                
                // Handle success in your app here.
                
            }];
        }
    

    Now we have healthStore and can ask for data… if we were ok above.

    HKBiologicalSexObject *sex = [self.healthStore biologicalSexWithError:&error];
        if (!error) {
            NSLog(@"you are %d sex",sex.biologicalSex);
            
            switch(sex.biologicalSex)
            {
                case 1:
                    // female
                    break;
                case 2:
                    // male
                    break;
                default:
                    // do nothing
                    break;
            }
        }
    
    

    which returns 0 for no sex, 1 for female and 2 for male.


  5. Add symlink folder to Dropbox on OS X

    September 4, 2013 by The Man

    Sometimes folders need to live outside your Dropbox folder so simply symlink them.

    1. Open Terminal and cd to your Dropbox folder

    2. type  ln -s /folder/anotherfolder

    Done.


  6. How to Enable PHP in Apache for Mac OS X

    June 19, 2013 by The Man

    Simply open terminal and type

    sudo nano /etc/apache2/httpd.conf

    Then find the line

    #LoadModule php5_module libexec/apache2/libphp5.so

    and remove the hashtag, save then type

    sudo apachectl restart

    to restart Apache.