Tagged: os

iOS 7 Functions Compatibility Matrix

- by admin



iOS 7, the latest version of Apple's mobile operating system, is now available for download. The update can be installed on any compatible iPhone, iPad, or iPod touch by visiting your device's settings menu, choosing "general," and then selecting the software update option. iOS 7 can also be installed with the help of the newly-released iTunes 11.1 on Windows and OS X. (You'll want to download that anyway, as it's required to sync music, videos, and other content to your device.)

The most immediate and striking change in Apple's latest OS is the all-new user interface designed under the eye of Jony Ive. iOS has been given a comprehensive visual makeover intended to make the overall user experience "simpler, more useful, and more enjoyable." But changes aren't just skin deep; iOS 7 introduces new features like iTunes Radio, AirDrop sharing, Control Center, and improved card-style multitasking.

Note that not all of Apple's latest features are available across all iOS hardware. If you're running the new software on anything older than an iPhone 5 or iPad 4, you stand to lose out on some functionality. Please find below those differences matrix.


How to check DNS cache status in Mac OS X

- by admin

As a follow-up to How to Flush DNS Cache in Mac OS X I have received a question:

how do I know if it worked? In other words, is there a way to check if the DNS cache is cleared?

To see the DNS cache status you may run
sudo killall -INFO mDNSResponder

Thus the SIGINFO signal will dump a snapshot summary of the DNS internal state to
/var/log/system.log

Voilà :-)


 

Print-screen (screenshots) in Mac OS X

- by admin

Keyboard shortcuts



  • Command-Shift-3: Take a screenshot of the screen, and save it as a file on the desktop

  • Command-Shift-4, then select an area: Take a screenshot of an area and save it as a file on the desktop

  • Command-Shift-4, then space, then click a window: Take a screenshot of a window and save it as a file on the desktop

  • Command-Control-Shift-3: Take a screenshot of the screen, and save it to the clipboard

  • Command-Control-Shift-4, then select an area: Take a screenshot of an area and save it to the clipboard

  • Command-Control-Shift-4, then space, then click a window: Take a screenshot of a window and save it to the clipboard


In Leopard and later, the following keys can be held down while selecting an area (via Command-Shift-4 or Command-Control-Shift-4):

  • Space, to lock the size of the selected region and instead move it when the mouse moves

  • Shift, to resize only one edge of the selected region

  • Option, to resize the selected region with its center as the anchor point


Formats


Different versions of Mac OS X have different formats for screenshots.

  • Mac OS X 10.2 (Jaguar): jpg

  • Mac OS X 10.3 (Panther): pdf

  • Mac OS X 10.4 (Tiger) and later: png


In Mac OS X 10.4 and later, the default screenshot format can be changed, by opening Terminal (located at /Applications/Utilities/Terminal) and typing in:
defaults write com.apple.screencapture type image_format
killall SystemUIServer

Where image_format is one of jpg, tiff, pdf, png, bmp or pict (among others). If you omit the second line, you will need to log out and in again for the change to take effect.

Grab and Preview


Instead of using the keyboard shortcuts above, screenshots can be taken by using the Grab application included with Mac OS X. It is located at /Applications/Utilities/Grab.

In Mac OS X 10.4, the Preview application can also be used to take screenshots, by using the Grab submenu in the File menu.

From the Terminal


The screencapture command in the Terminal can also be used to capture screenshots, and is useful for scripts. Here is an example.
screencapture -iW ~/Desktop/screen.jpg

How to Flush DNS Cache in Mac OS X

- by admin

After upgrading to 10.8.2 I have got a problem with adding a new entry into hosts file: the update was recognised only after system restart. But a more easy solution was just to flash DNS cache! So,

... flushing your DNS cache in Mac OS X is actually really easy, and there are two different commands to use, one for Leopard and for Tiger. Depending on your version of OS X, open your Terminal and follow the appropriate directions below:

Flushing DNS Cache in OS X Lion (10.7) and OS X Mountain Lion (10.8)


Launch Terminal and enter the following command, you will need to enter an administrative password:
sudo killall -HUP mDNSResponder

Note the dscacheutil still exists in 10.7 and 10.8, but the official method to clear out DNS caches is through killing mDNSResponder. You can also find that process running in Activity Monitor.

Flush DNS Cache in Mac OS X 10.5, Mac OS X 10.6


Launch Terminal and issue the following command:
dscacheutil -flushcache

All done, your DNS has been flushed. On a side note, the dscacheutil is interesting in general and worth taking a look at, try the -statistics flag instead for some stats.

Flush your DNS Cache in Mac OS X 10.4 Tiger


Type the following command in the Terminal:
lookupd -flushcache

That’s it - now your DNS settings should be as you intended them to be :-)

Find (search) and replace text from command line in multiple files (Linu

- by admin

Another (and more easy) way to change text in multiple files is to use grep:
grep -lr -e 'oldtext' * | xargs sed -i 's/oldtext/newtext/g'

or to use PERL:
perl -p -i -e ’s/oldtext/newtext/g’ *

 

Find (search) and replace text from command line in multiple files (Linu

- by admin

Just after I posted this article the second more easy solution has been found. Here it is:

Find (search) and replace text from command line in multiple files (Linux) #2

When you are working on the Linux command line and you come across a large file or a large number of files in which you need to replace a certain text with another, finding and pasting over each instance of the text can be a bit time consuming. Well, worry no more. Linux has just the solution for you. Here’s a way to find and replace a string of text in one or more files automatically.

For the purpose of this exercise we will use a Linux command line tool called “sed”.  ”sed” is a very powerful and versatile tool, and a lot can be written about its capabilities. We are using a very limited aspect of “sed” here. I would definitely recommend that you read up a little more on “sed” if you find this aspect of it interesting.

We are going to use the following syntax to find and replace a string of text in a file:
# sed -i 's/[orginal_text]/[new_text]/' filename.txt

Say you have a file called “database.txt” with numerous instances of the IP address of your database server in it. You have just switched to a new database server and need to update it with the new server’s IP address. The old IP address is 192.168.1.16 and the new one is 192.168.1.22. Here’s how you go about it:
# cat database.txt
LOCAL_DATABASE = 192.168.1.16
LOCAL_DIR = /home/calvin/
PROD_DB = 192.168.1.16

# sed -i 's/192.168.1.16/192.168.1.22/g' database.txt
# cat database.txt
LOCAL_DATABASE = 192.168.1.22
LOCAL_DIR = /home/calvin/
PROD_DB = 192.168.1.22

Now open the file “database.inc” and check to see if the new IP address has taken place of your old one. Here’s the breakup of the above command. First you call the “sed” command. Then you pass it the parameter “-s” which stands for “in place of”. Now we use a little bit of regular expressions, commonly known as “regex”  for the next bit. The “s” in the quoted string stands for “substitute”, and the “g” at the end stands for “global”. Between them they result in a “global substitution of the the string of text you place in between them.

You can optionally skip the “g” at the end. This means that the substitution will not be global, which practically translates to the substitution of only the first instance of the string in a line. So if you had a line with multiple instances of the text you are trying to replace, here’s what will happen
# cat database.txt
LOCAL_DATABASE = 192.168.1.16
LOCAL_DIR = /home/calvin/
PROD_DB = 192.168.1.16, 192.168.1.16

# sed -i 's/192.168.1.16/192.168.1.22/' database.txt
# cat database.txt
LOCAL_DATABASE = 192.168.1.22
LOCAL_DIR = /home/calvin/
PROD_DB = 192.168.1.22, 192.168.1.16

Here comes the real magic. Now, say you want to change a string of text not just in a single file, but in the entire directory you are in. There are a number of text files in which you need to find and replace the “wine” with “champagne”.
# find . -maxdepth 1 -name "*.txt" -type f -exec sed -i 's/wine/champagne/' {} \

We use the find command to get a list of all the text files in the current directory. That’s the “find . -maxdepth 1 -name “*.txt” -type f” part. “find . maxdepth 1″ tell the computer to look in the current directory and go no deeper than the current directory. The ‘-name  ”*.txt”‘ part tells find to only list files with the extension of “.txt”. Then the “-type f” section specifies that “find” should only pick exactly matching files. Finally the “-exec” part tells “find” to execute the command that follows, which, in this case, is the “sed” command to replace the text – “sed -i ‘s/wine/champagne/’ {} \”.

I realize that the above command seems complicated. However, once you use it a little bit you will realize that it is probably worth noting it down and using it. Now try changing a string of text in multiple levels of directories.

Disable automatic unzipping on file download in Safari (Mac OS X)

- by admin

After file downloading a ZIP file with Safari this file is unzipped automatically. The original ZIP file appears to be deleted. Not so good!

To fix this behaviour just go to
Safari->Preferences->General

and uncheck "Open Safe Files After Downloading".

Mac OS, MySQL: No such file or directory (trying to connect via unix:///

- by admin

Error on attempt to connect locally to MySQL server DB with PHP on MacOS X Lion 10.7:

No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)

Solution 1:

instead of localhost use 127.0.0.1:
mysql_connect ('127.0.0.1', $user, $password);

Solution 2:

In /etc/php.ini change
pdo_mysql.default_socket = /var/mysql/mysql.sock
mysql.default_socket = /var/mysql/mysql.sock
mysqli.default_socket = /var/mysql/mysql.sock

to
pdo_mysql.default_socket = /tmp/mysql.sock
mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock

Do not forget to restart Apache after update :-)

FYI: If no /etc/php.ini found just copy /etc/php.ini.default to /etc/php.ini

Mac X11 window font size change

- by admin

The most simple way is adding the following new command in the X11-> application -> customize:
xterm -geometry 72x34+100+40 -fn *-fixed-*-*-*-20-* &

Mac OS X Lion: configure: error: C compiler cannot create executables

- by admin

After Xcode installation and trying to build mc I've got:
configure: error: C compiler cannot create executables

Google offers to install Xcode correctly (this is a different story however) or to reinstall it. Hmmm. Good idea but in my case the following simple action solved the issue: symlinks for compilers - that's all ! KISS
sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2

sudo ln -s /usr/bin/llvm-g++-4.2 /usr/bin/g++-4.2

Voila !

« All tags

Older posts »