Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Where did my disk space go?

May 11, 2012
Have you ever noticed missing disk space on newly bought hard disks? Here are some possible reasons:
  1. Unit confusion: The most common confusion in between GB/GiB or MB/MiB.
  2. Reserved space in linux partitions.
  3. Filesystem overheads.

Unit Confusion

Many people have questions like: Why my 1 TB hard disk shows only 930 GB? This is purely a confusion of units and bases used when words like 'kilo', 'mega' etc. are used. Following table, from AskUbuntu, explains the situation. Prefix Bytes Prefix Bytes 1 Byte = (2^10)^0 = 1 1 Byte = (10^3)^0 = 1 1 Kibibyte(KiB) = (2^10)^1 = 1024 1 Kilobyte(KB) = (10^3)^1 = 1000 1 Mebibyte(MiB) = (2^10)^2 = 1048576 1 Megabyte(MB) = (10^3)^2 = 1000000 1 Gibibyte(GiB) = (2^10)^3 = 1073741824 1 Gigabyte(GB) = (10^3)^3 = 1000000000 1 Tebibyte(TiB) = (2^10)^4 = 1099511627776 1 Terabyte(TB) = (10^3)^4 = 1000000000000 Many softwares and operating systems often calculate size in GiB and put GB when they are displaying it. This becomes even worse because most of the harddisks are labelled with actual GBs and hence when numbers are reported in GiB, it creates the confusion. Online calculators like this can help to remove the confusion. NIST states very interesting historical reason of this confusing prefix:

Once upon a time, computer professionals noticed that 210 was very nearly equal to 1000 and started using the SI prefix "kilo" to mean 1024. That worked well enough for a decade or two because everybody who talked kilobytes knew that the term implied 1024 bytes. But, almost overnight a much more numerous "everybody" bought computers, and the trade computer professionals needed to talk to physicists and engineers and even to ordinary people, most of whom know that a kilometer is 1000 meters and a kilogram is 1000 grams.
Then data storage for gigabytes, and even terabytes, became practical, and the storage devices were not constructed on binary trees, which meant that, for many practical purposes, binary arithmetic was less convenient than decimal arithmetic. The result is that today "everybody" does not "know" what a megabyte is. When discussing computer memory, most manufacturers use megabyte to mean 220 = 1 048 576 bytes, but the manufacturers of computer storage devices usually use the term to mean 1 000 000 bytes. Some designers of local area networks have used megabit per second to mean 1 048 576 bit/s, but all telecommunications engineers use it to mean 106 bit/s. And if two definitions of the megabyte are not enough, a third megabyte of 1 024 000 bytes is the megabyte used to format the familiar 90 mm (3 1/2 inch), "1.44 MB" diskette. The confusion is real, as is the potential for incompatibility in standards and in implemented systems.

Reserved space

While formatting Linux partitions like ext2/ext3/ext4, 5% of the drive's total space is reserved for the super-user (root) so that the operating system can still write to the disk even if it is full. This space is wasted if the drive is being used solely for data storage especially on large partitions. The details of the reserved space can be seen by running following command (replace sda1 by your drive name)sudo tune2fs -l /dev/sda1 The reserved space can be decreased to 1% of the drive's total space by running following command. To completely remove this reserved space replace 1 by 0. sudo tune2fs -m 1 /dev/sda1 As explained in Ubuntu Documentation, using this command does not change any existing data on the drive. You can use it on a drive which already contains data. This should be left to 5% on drives containing filesystem /, /var, /tmp in order to avoid any problems.

Filesystem overheads

Journaling file systems like ext2/ext3/ext4/NTFS used file tables for managing the filesystem. These tables take up lots of space (2-3% of drive size). Different file system allocates space to these tables differently. For example ext4 allocates all its space during the format itself, which shows up as used disk space. Where as NTFS allocates it when more files are written to disk.

The exact details are more complicated than this handy wavy explanation. Many forum posts has discussed this issue.

Read more ...

AUCTeX on windows

May 13, 2011
It’s a little tricky to get AUCTeX working on windows, specially the preview feature working. Following steps helped me.
  1. Install MikTeX.
  2. Install Ghostscript & GSview.
  3. Install Emacs & AUCTeX from here.
  4. Add to system PATH the location of gsview32c.exe. (Required for LaTeX-preview). Restart the system (Did not work without restart for me)
  5. Add following lines to .emacs file (load "auctex.el" nil t t) (load "preview-latex.el" nil t t) .emacs file can be found in C:/users/username/appdata/roaming/ or in the home directory. 
  6. Change variable (see next section) preview-image-type to pnm. To use other types install correct dll files in bin directory of emacs.
Other customizations:
To customize/change a variables in Emacs use M-x customize-variable
  • Change default viewer: <to-find-out>
  • Change preview size: Customize variable display-mm-dimensions-alist. Experiment with width height. My setting: Width-250, height-180
Read more ...

Gcal with time in Rainmeter

Jan 18, 2011

I have been using Rainmeter for some time & have started liking it. But the default Google Calendar reader do not show any information about starting time and ending time of the events. So I modified the default .ini file according to my needs. The difference can be seen in attached pictures.

Notice the time in 3rd row from last. Its NOT perfect. This script fails whenever the event description reads like “Thu Jan 20, 2011 3pm to Thu Jan 20, 2011 5pm PST” instead of “Thu Jan 20, 2011 3pm to 5pm PST”. It is a problem of regular expression. But I guess its sufficient for me. Let me know if you can fix it. The script can be downloaded from here. Copy the file to Gcal folder in Rainmeter skins folder.

Read more ...

Matlab Font(s) - Windows

Jan 14, 2011
I do not find Matlab default font to be soothing to eyes, specially the fonts in figure windows. See more about fonts here. So, here are the instructions to change the fonts in matlab. Make sure that you have installed the font of your choice.
  • For editor, main window, GUI
    Navigate to File->Preference. Select "Fonts" in the left panel. Then follow the instructions over there. You can also check the 'Custom' tab for advanced settings.
  • For figure window
    Add following lines to your startup.m. See next section for details. set(0,'DefaultAxesFontName','DejaVu Sans'); set(0,'DefaultAxesFontSize',10); set(0,'DefaultAxesFontWeight','Bold'); set(0,'DefaultTextFontName','DejaVu Sans'); set(0,'DefaultTextFontSize',10); set(0,'DefaultTextFontWeight','Bold'); Change the font-name & size according your choice. You can find a list of installed fonts by typing following command at matlab prompt. listfonts
startup.m
Each time matlab is started, it searches all the matlab path for this file. The most common place to keep this file is: C:\Users\<user-name>\Documents\MATLAB\ This is good place to put/over-ride settings. Create this file, if it is not present.

I am having hard-time  to configure the same thing in Ubuntu. I will be posting the same, if I get some success.
Update: I was not able to get anti-aliased fonts in linux. But, I found a font called 'Andale Mono', which gives good result with aliased fonts. This link might help in some cases.
Read more ...

Change default location of Desktop folder in Windows 7

Dec 22, 2010

Navigate to folder containing current Desktop folder (usually C:\Users\<user_name>)and Right click on it. Then go to ‘Location’ tab. Follow the instruction over there. The same steps are valid for other user folders like Downloads, My Documents etc.

PS: I am trying Windows Live Writer for the first time to write and publish a post. At first, I could not figure out where to put post title. It seems Live writer had tough time detecting my blog theme correctly. Turning off the ‘Blog theme’ in ‘Blog Account’ tab fixed the problem.

Read more ...

Useful applications for Windows 7

Oct 12, 2010
  • TeraCopy - Enhanced copy / move
  • xplorer2 Lite - Better Windows explorer
  • 4t Tray Minimizer - Additional options in windows title bar
  • Cute PDF Writer - Free PDF converter
  • AutoHotKey - Change keyboard key behavior
  • Foobar2000 - Highly customizable music player
  • Handbrake - Convert video formats for iPod etc.
  • WinDirStat - Hard-disk usage statistics
  • Foxit reader - Free, light PDF viewer
  • MPlayer WW - Video player (best mplayer) for windows
  • LockHunter - File unlocker
Read more ...

Configuration Files

Sep 13, 2010
Updated weekly irrespective of the date of this blog post.

Ubuntu


Windows

Read more ...