This week we follow up on Apple Music issues, iTunes, the judicious use of shitty code with Design Stamina Hypothesis and Apple’s rumored Car. Greg and Aaron go on a couple of tangents on AI and the new Cross Point memory. Our Picks: Ghostery, open source Objective-C, ASCIIwwdc, Paint Code and Telekinesis (beta).
Episode 50 Show Notes:
Episode 50 Picks:
Podcast: Play in new window | Download
Subscribe: Android |
A few people have asked about hiring me on contract. So I put together this post:
I am and independent developer and designer working in iOS and web technologies. I have been involved in many app deployments on the AppStore, as the main idea guy or architect of apps; doing client work and some personal apps. Collectively we had over 500K downloads over the last 5 years, which I think it’s better than most. My background is in the graphic arts, print and publishing, and the IT work involved in those trades. However I have always made stuff and consider myself a solutions provider – my unique ability.
While I do wrangle developers, writers and artists, I spend the majority of my time actually writing code and assembling the apps. I am also the person who deals with the actual submission to the AppStore. So I can start an app from pen and paper sketches all the way to the App Store and analytics. While doing so I make stops to assemble copy, create graphics & UX, write the code, assemble the apps, localization, distribute the builds, wrangle git & branches, write server APIs, product management, as well as marketing and promotions. Soup to nuts as any indie IOS developer should be (and hiring out help on big projects).
I am located in Toronto Canada, where I try to run a small development company. I teach introductory courses on iOS development. I write for raywenderlich.com and I founded and host the More Than Just Code podcast.
resume and references available on request.
I’ve been using mySQL on Macs since I was running debian linux on a Quadra 700 in the late nineties. So you can say that I’ve had to deal with every curve that Apple throws at us with respect to web services. After debian, I ran darwin until Apple released Mac OX Beta in 1999.
The latest challenge was while upgrading my Intel Nahalan Xserve to Mountain Lion Server, 10.8.2. Lo and behold there is no mysql installed. So gleefully I went over the mysql.com to get the latest installer dmg (http://dev.mysql.com/downloads/mysql/). Once I tried to run “mysql” on the command line to test, I kept getting the age old “Cannot connect to /var/mysql/mysql.sock” error. No biggie, just check that the file is there or create a symbolic link to /tmp/mysql.sock…
However no matter what I tried, I kept getting the error… so I needed to dig deeper. Some sage user suggested checking the error log inside /var/mysql/data – by looking for a file matching your hostname and ending with .err . So I set up a tail and ran the mysql startUpItem script by hand and watched the log. (/Library/StartupItems.MySQLCOM/MySQLCOM start). Sure enough it would start and then immediately abort and shutdown.
Turns out the mySQL configuration file was wrong (/etc/my.cnf). I’m not sure where mine came from, possibly an older installer. You may not run into this problem, since Lion and Mountain Lion don’t come with mySQL installed. So the error I saw first was “unknown option skip-locking”. I commented that out (backing up the my.cnf before starting) and ran the start command again. I also had to comment out “table_cache=512” and “skip-thread-priority”. Afterwards mysql started up like it should. So I’m putting this out there, in case it helps the next poor sap.
Q. I have a MacBook and a couple of PCs. I also have an external 1TB drive on my Mac. I can mount the Macâ€™s internal hard drive on my PCs but I cannot mount the 1TB hard drive. Is this possible?
A. One of the cool things about Macintosh computers is that weâ€™ve always been able to read data on Windows drives and floppy disks. In the past there were utilities to that enabled Windows computer to run AppleTalk protocol and read Macintosh volumes.
Mac OS X includes Samba which allows users to run SMB (Server Message Block) protocol. SMB was developed by IBM, but has been highly modified by Microsoft. The open source Samba has reverse engineered SMB to provide a version for non-Microsoft systems.
By running SMB on your Macintosh you can share your files with your Windows neighbors. Go to System Preferences -> Sharing and check Windows Sharing. Then PC users can add your Mac to their Network Places or â€œmapâ€ your drive as a network drive by adding
The problem with external drives is that they are not automatically included in the smb shares. When you enable â€œWindows Sharingâ€ a configuration file is written to the Unix file system. Most configuration files are stored in the â€œ
etcâ€ directory and there youâ€™ll find the â€œ
So once again open the Terminal (Applications -> Utilities -> Terminal) and at the prompt enter â€œ
cd /etcâ€ and press enter â€“ to â€œchange directoriesâ€ the â€œetcâ€ directory. You need to be an administrator to edit the file and you should begin by backing up the file. Enter â€œ
sudo cp smb.conf smb.bakâ€ at the prompt to make a copy of the file. â€œsudoâ€ is a special command that lets you act as an administrator for a short period of time.
Check that youâ€™ve made a copy by listing the files with â€œls â€“laâ€ and Return. You should see both the original and the backup. Now edit the file with â€œedâ€, â€œviâ€ or â€œpicoâ€. With pico the display is similar to most text editors and the commands are at the bottom of the file. Enter â€œpico smb.confâ€ and scroll to the bottom (with Control V) and add the following to the bottom of the file:
path = /Volumes/LaCie_d2_156_GB
valid users = tmitra
writeable = yes
In the example above my â€œShare nameâ€ is â€œLaCieâ€ â€“ this is what the PC user will see. The Macintosh name of my drive is â€œLaCie_d2_156_GBâ€ â€“ note that I have replaced the spaces with underscores. The â€œvalid userâ€ is the name of a user on my Macintosh and â€œwriteableâ€ means that I can read and write to the drive.
Now on the PC go to â€œMy Computerâ€ and choose â€œMap Network Driveâ€ from the Tools menu. Then in the dialog enter the Macâ€™s IP as the server and the share name:
Then enter your username and password and the volume should be mounted. You can then copy files to and from your PC â€“ and share them with the Mac.
This month were going to take a closer look at taking control of MacOS X by becoming a super user. The underpinnings of MacOS X are after all UNIX, so you should be aware of the power a super user wields.
The root account is a â€œsuper userâ€ account built into every UNIX system, which you may remember is a multi-user environment. Other systems such as AppleShare IP or Windows Servers had highly privileged administrator accounts, however on a UNIX system the level of access that root has have seems to have no limits.
There are many processes and files are â€œownedâ€ by root. Weâ€™ve looked at â€œpermissionsâ€œ in past articles, and you may remember that permissions control what you can do and see. Keep in mind that the all-powerful root account must be treated with respect and root access should be limited to a small group of users. There is no way to stop the root account from altering any file on the system.
You have already experienced becoming a super user while using the Aqua GUI. Whenever you try to install an application or an update, you will have been asked to enter you username and password. Although youâ€™ve already logged in, the â€œAuthentication Managerâ€ is challenging you to prove that youâ€™re an administrator. This is one of the ways that Apple allows users to administrate their own machine.
The â€œsudoâ€ application is included so you can become a super user on the command line. If you try to run an application or see the contents of a file or folder that belongs to root, you will get an error like â€œpermission deniedâ€.
Iâ€™ll tell you a secret â€“ Built into MacOS X is the Apache Web Server. Unlike â€œPersonal Web Sharingâ€, your Mac can become a fully functional web server. In order to enable it youâ€™ll have to edit a file while becoming a super user.
Letâ€™s start by opening the Terminal application. (Applications => Utilities => Terminal) At that command prompt (%), weâ€™ll change directories to â€œetcâ€.
% cd /etc
â€œetcâ€ is a system directory that contains, among other things, configuration files. The mystery here is that one of the files in â€œetcâ€ enables the Apache Web Server. Last month I showed you the â€œfgrepâ€ program, which allows us to find text strings inside files. Weâ€™ll look for â€œWEBâ€ in â€œetcâ€. Type this:
% sudo fgrep “WEB” *
Unlike last month, this time weâ€™re going to precede the â€œfgrepâ€ with â€œsudoâ€ so that weâ€™re running the application as a super user. â€œsudoâ€ , or â€œsuper-user doâ€ allows us to assume a high level of authority to search through the files. The first time you use â€œsudoâ€, youâ€™ll get a short lecture about respecting others and most importantly â€œThink before you type.â€
If UNIX were like a car, it would be a tank . You can start the tank, put it gear and it will drive forward. Even if parts fell off, it would continue. If you, the driver, fell off â€“ It would continue to drive forward! So, think before you type.
After you enter your password (and hit â€œReturnâ€) your program will run, and you will see something like this:
fgrep: cups: Is a directory
fgrep: httpd: Is a directory
Ah ha! The file weâ€™re looking for is â€œhostconfigâ€. In order to activate the Apache Web Server weâ€™ll change the â€œNOâ€ to â€œYESâ€. Letâ€™s use the â€œedâ€ program (you can use â€œpicoâ€ or â€œviâ€ if you prefer) but weâ€™ll have to precede the command with â€œsudoâ€ again. If we donâ€™t start with â€œsudoâ€, we wonâ€™t have permission to save the file.
First letâ€™s backup the file. Type â€œsudo cp hostconfig hostconfig.backupâ€ to copy (cp) the original. Just in case! You can also use â€œlsâ€ to confirm that you made a copyâ€¦ Then weâ€™ll edit the file with â€œsudo ed hostconfigâ€
Begin by printing the file to screen with â€œ1,$pâ€ which will print (p) the file from line â€œ1â€ to the end ($).
Type â€œ/WEBâ€, to jump to the line that contains the string â€œWEBâ€. Next type, â€œs/NO/YES/pâ€ to substitute (s) â€œNOâ€ with â€œYESâ€, and then print (p) the line.
At any time, you can type â€œfâ€ to confirm the name of the file youâ€™re editing. You should also use â€œ1,$pâ€ to confirm your changes before you save the file by writing and quit. Type â€œwâ€ to write the file and â€œqâ€ to quit.
You have now enabled the Apache Web Server. Open your browser, and enter â€œlocalhostâ€ or â€œ127.0.0.1â€ in the URL and you will get the default Apache page. This was possible because you became a super user with â€œsudoâ€. Now you can put on your â€œHTMLâ€ hat and start writing your web site.