Feeds:
Posts
Comments

Posts Tagged ‘Mac OS X’

If you’ve attached an external hard drive to your system, then decided to use your partitioner to format it to EXT4 for greater efficiency (or just to match your Ubuntu system), you may have been shocked to find that your empty drive seemed to be missing a few gigabytes when mounted afterwards. And this has nothing to do with the good old binary (base-8) vs decimal (base-10) situation which would see your “750Gb” drive be more like 700Gb (in Windows and earlier versions of Ubuntu – now Mac OS X and Ubuntu have followed hardware manufacturers and use decimal, so that’s more like 738Gb).

This is because Ubuntu (and other Linux distributions) reserve typically around 5% of the space for the root user and system services, so should you run out of hard drive space, the administrator can still log in, and system services continue to run.

However, this is only really needed for your Ubuntu partition, so if you have an external EXT4 drive, or have an EXT4 partition on your internal drive (other than the one your system is on), you are needlessly wasting space (40Gb of the drive in the example). But you can free up that disk space quite easily, without having to re-partition the drive or anything. All it takes is a couple of commands pasted into the terminal.

In the following example, an external hard-drive will have the reserve set to 0 (zero), since this is what most people will need this for. First, we have to determine the device name, as using its mounted name – /media/700Gb Ext4 – won’t suffice. To do so, enter the following into the terminal:

mount|grep ^'/dev'

Look for the line containing your device:

/dev/sdc1 on /media/700Gb Ext4 type ext4 (rw,nosuid,nodev,uhelper=udisks)

… and you can see what it is named (/dev/sdc1 in this case). To free up reserved space, enter the following (replacing /dev/sdc1 with whatever the appropriate device name is, if need be – just make sure you don’t do it to your main drive!):

sudo tune2fs -m 0 /dev/sdc1

You should then be presented with the following message:

Setting reserved blocks percentage to 0% (0 blocks)

To confirm all has gone well, you can right-click an empty area of the folder window for the device and choose Properties, then compare the free space from before and after, or run the following command (once again replacing the device name with the correct one in your case):

sudo tune2fs -l /dev/sdc1 | grep 'Reserved block count'

You should be greeted with the following:

Reserved block count: 0

That’s it – you now have all of your drive to use.

ΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘΘ

Note: if you receive the following error message:

tune2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn’t find valid filesystem superblock.

… then the filesystem likely isn’t EXT4 – chances are the drive is actually formatted as NTFS or FAT for use on Windows systems (which would be the case if you’ve bought an external drive, and never did anything other than copy files to it). You would have needed to partition/format the drive to EXT4, so if you didn’t, then you actually don’t need this guide.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Advertisements

Read Full Post »

A Quick Intro to End-Of-Line Conventions

Most people don’t realise that when they hit the Enter key to create a new paragraph in a text file, something very different is going on behind the scenes in the three major operating systems: Windows, Macintosh and Linux. The “end-of-line delimiter” (often expressed as “End-Of-Line“, “End of Line“, or just “EOL“) – which some of you know as the “line break” or “newline” – is a special character used to designate the end of a line within a text file.

UNIX-based operating systems (like all Linux distros and BSD derivatives) use the line feed character (\n or <LF>), “classic” Mac OS uses a carriage return (\r or <CR>), while DOS/Windows uses a carriage return followed by a line feed (\r\n or <CR><LF>). Now that Mac OS X is based on FreeBSD‘s file system, it follows the UNIX convention.

Now, the reason most people don’t know about all this is because nobody really should have to. But while users of Linux distros and Mac OS can open Windows text files in basically any available editor and not even know the difference, the same can’t be said for Windows users opening files created in one of the other operating systems.

If you type up a simple text file in Ubuntu and save it in the default “Unix/Linux” format, in Windows it will appear as one continuous paragraph, with black squares where the line breaks (or new paragraphs) should be. While you can open the file in a more advanced text editor (or proper word processor) to view it as it should look, others you’ve sent it to are just likely to double-click it and let it open in Notepad (which can only handle MS-DOS EOL).

But you can save text files as Windows EOL easily with Gedit, as well as convert to that from UNIX via the terminal, so hopefully the following guide will be of use.

For more detailed info on End-Of-Line, go to the Wikipedia page.

And if you find the editor you’re using to display Windows files in Ubuntu shows ^M instead of a line break (not very likely with even the most lightweight text editors, but something you’ll probably come across if you display the text in a terminal), check out how to convert to Unix/Linux.

Saving Windows Text Files in Text Editor (Gedit)

It’s actually very easy to create text files with Windows EOL in Ubuntu using the default Text Editor, Gedit. When saving a file, go to Line Ending in the dialogue box and choose Windows instead of the default Unix/Linux. For files that were previously created, you can open them in Gedit and use Save As… to convert them (or save copies with the correct EOL).

As you can see, that’s pretty easy, but for more than one or two files, it is way too much work, so check out how to batch-convert multiple files via the terminal.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

A Quick Intro to End-Of-Line

Most people don’t realise that when they hit the Enter key to create a new paragraph in a text file, something very different is going on behind the scenes in the three major operating systems: Windows, Macintosh and Linux. The “end-of-line delimiter” (often expressed as “End-Of-Line“, “End of Line“, or just “EOL“) – which some of you know as the “line break” or “newline” – is a special character used to designate the end of a line within a text file.

UNIX-based operating systems (like all Linux distros and BSD derivatives) use the line feed character (\n or <LF>), “classic” Mac OS uses a carriage return (\r or <CR>), while DOS/Windows uses a carriage return followed by a line feed (\r\n or <CR><LF>). Now that Mac OS X is based on FreeBSD‘s file system, it follows the UNIX convention.

Now, the reason most people don’t know about all this is because nobody really should have to. But while users of Linux distros and Mac OS can open Windows text files in basically any available editor and not even know the difference, the same can’t be said for Windows users opening files created in one of the other operating systems.

If you type up a simple text file in Ubuntu and save it in the default “Unix/Linux” format, in Windows it will appear as one continuous paragraph, with black squares where the line breaks (or new paragraphs) should be. While you can open the file in a more advanced text editor (or proper word processor) to view it as it should look, others you’ve sent it to are just likely to double-click it and let it open in Notepad (which can only handle MS-DOS EOL).

But you can save text files as Windows EOL easily with Gedit, as well as convert to that from UNIX via the terminal, so hopefully the following guide will be of use.

For more detailed info on End-Of-Line, go to the Wikipedia page.

If you’d like a more WYSIWYG approach, check out how to save and convert via Gedit.

And if you find the editor you’re using to display Windows files in Ubuntu shows ^M instead of a line break (not very likely with even the most lightweight text editors, but something you’ll probably come across if you display the text in a terminal), check out how to convert to Unix/Linux.

Converting Linux EOL to Windows via the Terminal

It’s easy enough to create new text files with Windows EOL in Ubuntu using the default Text Editor (Gedit), but what if you’ve created a whole bunch with the default Unix/Linux EOL and need to convert them for Windows users? Well, you can actually open them in Gedit and use Save As… to save over them (or to create copies), but for more than a couple of files this would be the long, complicated solution.

By far the quickest and easiest approach is to convert the offending files via the command-line. This way, you could batch-convert hundreds of such files at once, not have to do them individually.
There are actually quite a few ways to do this, but we’ll look at a couple of tiny packages you can install, and the related commands to use.

The first – the tofrodos package – is undoubtedly the most widely-used, so we’ll look at that in detail – especially since many of the guides out there are outdated, since the commands it contains have been renamed.

The second is a little package called flip, and since it’s tiny and won’t cause any issues, it’s worth installing as a backup (just in case. I found it useful after trying to get tofrodos going on a new system, before I found out the commands were changed).

There is no actual command tofrodos, as it is just the package that contains the commands todos and fromdos. Currently, the vast majority of online guides will list the commands as unix2dos and dos2unix, but as the developer states:

With this release the symlinks “unix2dos” and “dos2unix” are dropped from the package. This will allow the introduction of the original dos2unix package, which also supports conversion to MacOS style files.

So now you can choose to use either todos (to convert to Windows) and fromdos (to convert to Linux), or just fromdos with options (fromdos -u to convert to DOS, and fromdos -d to convert to UNIX, though obviously the -d option really isn’t needed, as it is the default behaviour for the fromdos command).

We’ll use todos, as it is easier to remember, and show how to alter a single file, or all text files in a given folder. When you’re ready to proceed, open a terminal in the folder containing the text file(s) and use one of the following commands (note that for the purpose of illustration, the .txt suffix is used, but you can specify any other extension for your text files).

To convert to DOS/Windows format:

Single file (remember to replace filename.txt with the actual name of the file)

todos filename.txt

All text files in a folder (if the extension differs to .txt, simply replace it in the command)

todos *.txt

Similarly, flip is easy to use:

flip -m filename.txt (or flip -m *.txt for multiple files).

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

A Quick Intro to End-Of-Line

Most people don’t realise that when they hit the Enter key to create a new paragraph in a text file, something very different is going on behind the scenes in the three major operating systems: Windows, Macintosh and Linux. The “end-of-line delimiter” (often expressed as “End-Of-Line“, “End of Line“, or just “EOL“) – which some of you know as the “line break” or “newline” – is a special character used to designate the end of a line within a text file.

UNIX-based operating systems (like all Linux distros and BSD derivatives) use the line feed character (\n or <LF>), “classic” Mac OS uses a carriage return (\r or <CR>), while DOS/Windows uses a carriage return followed by a line feed (\r\n or <CR><LF>). Now that Mac OS X is based on FreeBSD‘s file system, it follows the UNIX convention.

Now, the reason most people don’t know about all this is because nobody really should have to. But while users of Linux distros and Mac OS can open Windows text files in basically any available editor and not even know the difference, the same can’t be said for Windows users opening files created in one of the other operating systems.

If you type up a simple text file in Ubuntu and save it in the default “Unix/Linux” format, in Windows it will appear as one continuous paragraph, with black squares where the line breaks (or new paragraphs) should be. While you can open the file in a more advanced text editor (or proper word processor) to view it as it should look, others you’ve sent it to are just likely to double-click it and let it open in Notepad (which can only handle MS-DOS EOL).

Occasionally, the reverse is the issue, but you can convert Windows text files to UNIX easily with Gedit, as well as convert them via the terminal, so hopefully the following guide will be of use.

For more detailed info on End-Of-Line, go to the Wikipedia page.

Or if you’re wanting to do the reverse, check out how to convert to Windows format via the terminal and with Save As… in Gedit.

Converting Windows EOL to Linux via the Terminal

If you find the text editor you’re using to display Windows files in Ubuntu shows ^M instead of a line break (not very likely with even the most lightweight text editors, but something you’ll probably come across if you display the text in a terminal), don’t worry – just convert them to Unix/Linux format.

While you can actually open them in Gedit and use Save As… to save over them (or to create copies) in the correct format, for more than a couple of files this would be the long, complicated solution.

By far the quickest and easiest approach is to convert the offending files via the command-line. This way, you could batch-convert hundreds of such files at once, not have to do them individually.
There are actually quite a few ways to do this, but we’ll look at a couple of tiny packages you can install, and the related commands to use.

The first – the tofrodos package – is undoubtedly the most widely-used, so we’ll look at that in detail – especially since many of the guides out there are outdated, since the commands it contains have been renamed.

The second is a little package called flip, and since it’s tiny and won’t cause any issues, it’s worth installing as a backup (just in case. I found it useful after trying to get tofrodos going on a new system, before I found out the commands were changed).

There is no actual command tofrodos, as it is just the package that contains the commands todos and fromdos. Currently, the vast majority of online guides will list the commands as unix2dos and dos2unix, but as the developer states:

With this release the symlinks “unix2dos” and “dos2unix” are dropped from the package. This will allow the introduction of the original dos2unix package, which also supports conversion to MacOS style files.

So now you can choose to use either todos (to convert to Windows) and fromdos (to convert to Linux), or just fromdos with options (fromdos -u to convert to DOS, and fromdos -d to convert to UNIX, though obviously the -d option really isn’t needed, as it is the default behaviour for the fromdos command).

We’ll use fromdos, as it is easier to remember, and show how to alter a single file, or all text files in a given folder. When you’re ready to proceed, open a terminal in the folder containing the text file(s) and use one of the following commands (note that for the purpose of illustration, the .txt suffix is used, but you can specify any other extension for your text files).

To Convert to UNIX/Linux via Terminal:

Single file (remember to replace filename.txt with the actual name of the file)

fromdos filename.txt

All text files in a folder (if the extension differs to .txt, simply replace it in the command)

fromdos *.txt

Similarly, flip is easy to use:

flip -u filename.txt (or flip -u *.txt for multiple files)

Converting Windows EOL to Linux with Gedit

It’s actually very easy to convert text files with Windows EOL to Unix/Linux in Ubuntu using the default Text Editor, Gedit. Simply open the files, choose Save As…, go to Line Ending in the dialogue box and choose Unix/Linux instead of Windows. While that is easy enough, for more than one or two you’d really want to save yourself some time and hassle and perform a batch-conversion via the terminal.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

The Search bar in Firefox – which many still look at as the “Google bar”, even though it lists other search engines – is extremely useful, but you can make it even more so by adding your own localised version of Google. This is handy for many reasons, like being able to search for products/prices in your own country, ignoring overseas stores.

For the purpose of this article, we’ll look at how to add Google Australia to the list of search engines, but you can apply this to your own country (as long as it is one of those supported).

Now, if you go to the Firefox Add-ons site, you’ll probably find there is nothing for your country’s version of Google, but you can find Google add-ons here.

Once you’ve located one you want to add, simply click its link. You will then be asked:

Add “Google Australia – from Australia” to the list of engines available in the search bar?

… so just click the Add button, and you’ll find the new Google entry in the Search pull-down menu.

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

Nautilus – the default file manager for Gnome, and therefore Ubuntu – is feature-rich and easy-to-use, but you can make it even more powerful, and with very little effort.

With Windows or Mac OS X, if there are features missing in the built-in file browser, the only option is to install another, usually at some expense (software developers in those worlds haven’t quite embraced the concept of open-source). In Ubuntu and other Linux distributions, other file managers – like Thunar (Xfce), Dolphin (KDE) and Konqueror (KDE) – can easily be installed (for free), even if they were made for a desktop environment other than Gnome.

But another way to get some of the features you might find lacking in Nautilus is to install some plugins or “extensions“, most of which are in the official repos and easily installed via Synaptic Package Manager.

Here I’ll feature the most popular and useful ones, but there are others out there, from adding more integration with messaging to technical tasks most of us don’t need (or understand). While I’ll be keeping this post up to date as new extensions are created, a Google search for “nautilus plugin extension” will reveal those I have left out (or missed). And don’t forget that you can also open Synaptic, paste the word “nautilus” into the Quick search bar, and all extensions available in the repositories will be displayed.

Essential Extensions:

Nautilus Open Terminal: Command-Line in the Current Folder

Nautilus GKSU: Open Files & Folders with Administrative Privileges

More Cool Plugins:

Nautilus Image Converter: Easily Resize & Rotate Pictures

Nautilus Pastebin: Send Text Clips to the Web

°ºÒθÓº°

Other Nautilus Enhancements:

Add Buttons for New Folder, Cut, Copy, Paste & Trash/Delete to the Nautilus Toolbar

Add a File/Folder “Properties” Button to the Nautilus Toolbar

°ºÒθÓº°

Guide to Customising & Enhancing Nautilus

☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻☻

Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

You know, it really sucks being gullible. I like to think of myself as over-optimistic, but when I really should know better, yet persist in dreaming loftily, only one word comes to mind: sucker.

For years the free open source software (FOSS) community has called upon the Evil Empire Microsoft to work with it in making the world of computing better for all of us. Developers of free programs (who obviously don’t do this for the money) have continually had to beg Microsoft for access to details of their file formats, and have even had to fight them in court as the monopolistic giant drove to crush any opposition. And all this when Microsoft laughed at the idea that FOSS and Linux could ever be serious threats.

Now, all of a sudden, Microsoft is extending hands in welcome to FOSS developers, claiming to want to work with them for the benefit of all, and most people people are greeting this with “Yes! About time!”, rather than “Hmmm… OK… what the hell is going on here? Back away… slowly.”

While it is no longer any secret that Ubuntu has finally forced them to turn their heads towards Linux, the majority of people still see OpenOffice.org (OOo) – the free office suite – as not much of a threat to MS Office. But Microsoft are taking note of the increasing number of Windows-based PCs running OOo and are obviously alarmed, because they’ve set up a strike force and are recruiting heavily.

Previously, Linux was a minor pain to Microsoft, less so than Mac, and businesses using it for their servers still usually had Windows machines connected to them. But now, not only are more “home” users switching to Linux distros like Ubuntu, and using the FOSS that comes on them, but more Windows users are opting to try out free alternatives rather than keep paying to upgrade their Microsoft programs.

Even more frightening for Microsoft is the decline in those lucrative contracts from businesses and government departments around the world. Not only are they seeing their expensive products like Office replaced by OOo (as well as free products like Internet Explorer and Outlook Express being replaced by Mozilla‘s Firefox and Thunderbird), but schools, corporations, institutions and government agencies are now turning their Windows-based workstations into Linux boxes.

While Ubuntu’s success has certainly had something to do with this (since many people hadn’t even heard to word “Linux” until they came across Ubuntu), it’s also due to the fact that great programs from the FOSS world, like OOo, are gaining popularity in the Windows world. When people see that these programs are as good as (if not better than) Microsoft’s, then get exposed to user-friendly distros like Ubuntu (which usually come with heaps of programs installed, including the full OOo suite), the step away from dependence on Microsoft suddenly seems not so scary.

And now that this is happening at a rate that is causing palpitations at Redmond, all of a sudden Microsoft is ready for dialogue and a working partnership with the FOSS world. And while most should be worried about this, it seems the prospect of this unprecedented opportunity is dazzling the caution out of many. It really isn’t that strange though, just human nature: even an avid anti-monarchist would feel at least a small thrill meeting the Queen (though probably wouldn’t admit it). But the trouble with this is that Microsoft isn’t human; while it has the legal rights of one, its obligation is to increasing profits for its shareholders, not worry about moral or legal issues, so is in fact a monster (or perhaps psychopath is more apt – watch the documentary “The Corporation” and be enlightened!).

So, while smiling and shaking hands with FOSS developers, Microsoft’s henchmen aren’t there to help usher in a glorious new era, they’re there to infiltrate. The plan to get as much inside knowledge as possible, with only one purpose in mind: to use it against the FOSS world. Microsoft have finally realised two things – that the FOSS/Linux threat is real, and that they need a new approach to dealing with it – so have sued for peace while quietly readying for war.

Rather than just undermine open source (quite loudly) at conferences, or send out misinformation to the media, Microsoft HQ has gotten clever and sent out its wolves in sheep’s clothing. Under the guise of mutually-beneficial co-operation, Microsoft’s henchmen will be gathering as much inside info as possible, in order to help defeat the enemies they pretend to embrace.

If you’re thinking this is just a paranoid conspiracy theory, then you’ve obviously forgotten all the previous ones that ended up being true, landing Microsoft in court on numerous occasions. But go to Google and choose a few choice words to search for (like “Linux and Open Office Compete”), and you’ll see more and more on this. Or why not just check out Microsoft’s recruitment department, perhaps searching for “Linux Compete”? It won’t take long before you see Microsoft is very serious about this silent but deadly war of theirs; they’re so serious, they don’t even seem to care about hiding the fact!

Here is a copy of Microsoft’s recruitment ad for a “Linux and Open Office Compete Lead, US Subsidiary” position (note the position is no longer available, but the link for it is currently right at the top of a Google search for “Linux and Open Office Compete”).

Job Category: Marketing
Location: United States, WA, Bellevue
Job ID: 700901 9914
Division: Marketing
Linux and Open Office Compete Lead, US Subsidiary (CSI Lead)

If you’re looking for a new role where you’ll focus on one of the biggest issues that is top of mind for KT and Steve B in “Compete”, build a complete left to right understanding of the subsidiary, have a large amount of executive exposure, build and manage the activities of a v-team of 13 district Linux & Open Office Compete Leads, and develop a broad set of marketing skills and report to a management team committed to development and recognized for high WHI this is the position for you!
The Commercial Software Initiative (CSI) Lead plays a pivotal role for the Subsidiary GM, the BG leads and the BMO by building a discipline within the US that is focused on competing against. The core mission of CSI is to win share against Linux and OpenOffice.org by designing and driving marketing programs, changing perceptions, engaging with Open Source communities and organizations, and drive internal readiness on how to compete with Commercial Linux and participate with Open Source Communities.

While any emphasis above was my doing, to highlight certain points, the words are all theirs, including mention of how worried CEO Steve Ballmer is about open source software and operating systems!

If you want to read more about this, you can also check out this summary of the impending war with OOo, as well this search page for “Linux” at Microsoft’s recruitment page.

And if you’re still a loyal Microsoft customer but feel like having some fun throwing rocks at a giant, download OpenOffice.org now and give it a go! And when you finally get sick of Windows, then it’s time to give a Linux distro like Ubuntu a try!

Read Full Post »

Older Posts »