Operating Systems
Quickly Resize a HFS+ Partition in Mac OS X
by Cristian Sandu on Aug.28, 2010, under Mac OS X, Operating Systems
Hi all,
Here’s a quick tip if you need to re-size a partition in Mac OS X WITHOUT destroying its data. Usually, you would get the commercial software iPartition – which, by the by won’t let you re-size the disk from which you are booting, you need to create a boot disk and whatever.
However, I just discovered that diskutil has a hidden command option. Yey! (Thanks to some internet dude, of course).
Open a terminal, do a “sudo bash” and then type “diskutil resizeVolume”.
You will be prompted with some text telling you how to use the command. I just ran “diskutil resizeVolume /Volumes/VolumeToReisze 200G” where 200G is the new size I want for my partition. It took a few minutes; after that I created a new partition in the empty space using the GUI version of diskutil, Disk Utility.
And that is that. Oh, this only works for Tiger and later. You are telling me you are still on Panther? Wow, dude… upgrade your OS.
Target Me
by Cristian Sandu on Jan.25, 2010, under Networking, Operating Systems
Hello.
Don’t get me wrong, I don’t feel special at all in the vast and somewhat uncontrollable mass that is the Internet. However…
I use a small router with OpenWrt as a home gateway and for a while now I have been seeing in my logs that I receive ssh login attempts from all over the world. I don’t understand why. Why would anyone target me for hacking? I have nothing interesting to hide on that little router of mine.
I decided to keep track of all the attackers’ IP addresses here. Not yet sure what purpose this will serve, maybe they will read this? I know my blog is not that popular at the moment but maybe someday it will be
.
So here it is(I will add entries as I catch them):
Location data is from http://www.ip2location.com/
| IP Address | Country (Short) | Country (Full) | Flag | Region | City | ISP | Date Recorded |
| 65.37.156.100 | US | UNITED STATES | ![]() |
NEW YORK | FAR ROCKAWAY | EARTHLINK INC | Jan 25, 2010 |
| 202.100.108.25 | CN | CHINA | ![]() |
BEIJING | YINCHUAN | PG2-BAR | Jan 25, 2010 |
| 110.15.149.1415 | KOR | KOREA, REPUBLIC OF | ![]() |
SEOUL | KYONGGI-DO | HANARO TELECOM | Jan 28, 2010 |
| 121.34.248.1 | CN | CHINA | ![]() |
GUANGDONG | SHENZHEN | CHINANET GUANGDONG PROVINCE NETWORK | Jan 29, 2010 |
Antivirus Protection And You
by Cristian Sandu on Jan.06, 2010, under Operating Systems, Windows
Happy New Year everyone!
It’s time to give up the dreams of a prolonged vacation and get cracking.
I was thinking the other day that a lot of people overestimate the importance of an anti-virus program(let’s call it AV for short). Don’t get me wrong, security is extremely important, for many reasons, no matter who you are but AV software in my opinion is not as important. Let me explain.
You see, there was a time, back in the wild days of the Internet when horrible viruses like WIN32/CIH roamed free causing havoc on your PCs. I should know, I was infected twice and survived. That cheeky virus got distributed on magazine discs and even came preloaded with some IBM PCs. It was ridiculous. I got mine from a computer games magazine’s disc, from a movie file in .exe format. Now listen to me: those days are gone. The dude who wrote the infamous CIH is serving time in the big house back in China and won’t do it again
. The windows operating system was much more frail back then. I myself wrote a simplistic VB program that upon running would erase your system.ini file(wow, no protection guys?) making your system unusable – it would no longer boot. But that was back in the 1990s. Things HAVE changed.
I remember attending a lecture with a Microsoft person who, like me, was not very fond of AV software (this was back when Windows XP SP2 was released). He said, and I agree, that a rather large amount of protection comes from simply keeping your OS up to date. Security flaws that malevolent people might exploit to get your sensible information via worms and such get patched all the time once they are discovered. So that’s one thing you can do to be safe – just turn on automatic updates(Windows 7 makes it even easier than any other Windows OS).
To avoid any confusion – I am not saying you don’t need an AV program. I am just saying you shouldn’t spend your money on one. You can get all the protection a sensible person needs from a free AV.
All you really need is an AV program with a nice up-to-date database of worms and other junk. In my opinion, the most you are going to get infected with is some worm or malware trying to email all your friends porn or some silly thing like that. They get detected instantly by any AV if you have it. Also, your Windows OS periodically runs the malicious software removal tool. As free AVs go, I use Microsoft Security Essentials and like it. I like it because it is not intrusive and scans the executable files I open – that’s all you really need.
I will repeat myself – the days of hardware destructive viruses are behind us. Also, just avoid dodgy download sites and you will never pick up a worm – it’s really that easy. Internet scam sites aren’t usually very clever and are easy to spot – just don’t download that creepy program that will allow you access to…well, you know.
I am not trying to discredit AV companies, I am just saying that I don’t agree with AV solutions that are overpriced and which are horribly intrusive all in the name of protecting you from the Evil Internet. The Internet is only as evil as you make it. Oh, and don’t get me started on secondary firewalls – your OS already has a firewall – how many damn firewalls do you need?
Feel free to tell me about your AV software experiences.
That is all. Be safe
.
Disk Drive Disaster
by Cristian Sandu on Dec.07, 2009, under Operating Systems
I imagine there’s a special place in Hell for people who don’t backup their important files. If there is, I am sure they are saving a spot for me
. You probably get tortured by having to recover your drive with nothing but a Windows recovery disk and a few floppies and if you actually succeed your disk crashes again and you have to start over, Sisyphus style.
Now, I have recovered from more than one logical disk failure and I’ve learned a few things – backing up not being one of them it seems
. Seriously though, I do backup but not everything and not as regularly as I should. I don’t have for example a backup of my music and my ebook collection. Losing my music could be a bit tragic but I would recover. I do have a backup of my projects, my precious code and documents I wrote, via a SVN server that I keep on my router which has a disk drive attached. That might not be enough if you’re paranoid but hey… we all lose something at some point. Another thing I backup are my general documents – I hadn’t done a recent backup though, and the pictures I took – these are truly irreplaceable and I usually keep at least 2 copies for redundancy. Sometimes I use online services as well to keep my pictures safe.
Backup is nice but hey, nobody really prepares for the worst so I will discuss things you can do if disaster really hits you hard. These are things I learned over time from my own mistakes.
Hard drive failures are of two types: logical and physical.
I do not have any experience with physical drive failures, I admit. I’ve always used quality disk drives and I renew them every two years or so, buying newer, better ones. Since hard drive capacity grows exponentially with time you can always buy a bigger disk which will replace your old one leaving you with plenty of room to spare. I’ve even experimented with a RAID striping setup. I don’t recommend it for keeping your most important files. Software RAIDs are prone to failure – yeah, mine failed too. True hardware RAID is expensive and you have to buy specialized hardware. It wasn’t that big a deal when my nForce RAID failed because I didn’t keep very important files on it – just the OS which was easy to reinstall and files I downloaded and could recover. So when it started failing I dismantled it and formatted the drives that made up my RAID. I’ve heard about other people who lost their RAIDs and didn’t recover much. So let’s keep it simple: use a RAID if you want to speed up your OS or something or use one of the RAIDs that provide data mirroring for data safety. Any RAID that does data striping reduces your data safety. A n-disks striping RAID will have a MTBF(mean time between failures) equal to the MTBF of the composing disks divided by n. But enough about RAIDs.
If you have a serious physical drive failure be aware that unless you take a hammer to the drive you could still recover the data. Most hardware repair services will probably tell you that you need to scrape the drive and get a new one but I am sure that if you are willing to pay they will help you get your data back – this is hearsay, I have never used such a company. The main component that needs to be intact are the magnetic disks that even if wiped still have a trace of your files. If the electronic component fails you can fix it if you know what you are doing. However, never, absolutely never open the disk’s enclosure, even a tiny speck of dust can destroy your disk. So the simple rule to obey here is: don’t be a cheap skate, upgrade your disk drives, storage is cheap these days. Even notebook disk drives can be upgraded. You should be safe, disk drives don’t fail as much as you would think. And, of course backup your most important files. Sorry, physical failures are scary and recovery is probably expensive but probably not impossible.
Moving on to something that I do have experience with: logical disk failures. There are a few things that might happen and here’s how to deal with them.
1. Your partition gets corrupted, files go missing and such. The best thing you can do is use a proper file system repair tool. On windows use chkdsk – I am not aware of any other tool better suited for fixing NTFS/FAT32 drives. If your logical drive is beyond recovery for some reason – I feel this should be impossible but hey, nothing is impossible, then you need to get a data recovery software – I discuss this a bit further down. For Linux use fsck/e2fsprogs/whatever; ext2/3 is a solid file system. In Mac OS you have Disk Utility and the command line version – use it to fix up your damaged HFS+ partitions. There is one big problem though – how do you recover if the drive corrupted is your OS drive? Now, If you’re like me you have more than one OS and you can use your secondary OS to fix up your primary OS’s drive. You can even attempt to fix NTFS drives from Linux and Mac OS using ntfs-3g tools – not very healthy but it might do the job(better third-party tools are available for money). If however you don’t have another OS then you need to get yourself a boot CD and work your magic from there. For Windows just use your install disc and go to recovery mode and run chkdsk from there – Windows 7, if it can still boot, can do this without a disc inserted, by pressing F8 at startup and choosing recovery. Be aware that Windows has the annoying habit of reading all your disk drives when going into recovery mode – if one is damaged this could take very long to forever. If you are impatient try to use another boot CD like Hiren’s or maybe a Linux live CD. In my experience nothing fixes up a damaged windows drive like chkdsk. For Linux damaged disks just boot some live CD and fix it up, what else?
Warning: you might get some lost & found files when fixing a journaled file system like NTFS and ext2/3 – it’s all good, keep ‘em or throw them away, it’s up to you.
2. You have messed up your partition table – whoops! You have accidentally deleted an important partition when installing another OS or using some stupid partitioning software or you have just erased the MBR completely(yes, I’ve done both – I can be a bit dumb at times). Don’t panic! Your data is still there. Don’t write absolutely nothing to the drive to maximize your recovery chances. Your files are still there, in fact if you would read your drive with a hex editor you could see the data. They are just “lost”, the OS no longer knows how to find them. If you erased your MBR completely and you have a backup of your MBR – which you don’t, who does that anyway, you can just rewrite it and all will be fine. If you don’t have a backup, most common case, you’ll have to recover your partition table. There are a bunch of tools out there that will do that but I believe the best is Acronis Disk Director Suite. The MBR can be rebuilt at times by analyzing the disk and finding out where the partitions were, what size they had etc. I am not aware of a free software that can do that, though – maybe that Easus thing. At this point you have to use disk recovery software (’cause you didn’t backup your MBR, that why!). If you can’t recover your partitions because you did something to the disk – maybe you wrote something to the disk and it’s MBR even though I told you not to – then you can just use a file recovery software to read the raw disk and reassemble your files. The best tool for the job that I am aware of is R-Studio for FAT and NTFS. I am unaware of a similar tool for ext2/3 but I am sure you can find one. This kind of software simply reads your entire disk and piece back your files – this is a time-consuming process but it saves your files, damn it! Sorry for all the unintentional product placement.
Again, remember not to write anything to your drive, should you delete your partitions, just use recovery software right away on it. This also applies to a situation where you simply and stupidly formatted a drive by mistake (dude, like how?) – same rules apply. Unless you used some wiping mechanism, files can still be recovered. Modern formatting software just marks the space as “free” not actually zero-ing out data so you’re safe even if you are the kind of person that formats their disks and then whines that your files are gone.
3. Should any combination of the first two occur, just use recovery data right away, don’t write anything to the drive! No 3 is actually completely unnecessary but good things come in threes, you know.
One last thing, when you are recovering files you are going to need some free space on another disk to write the recovered data. It would simply be disastrous to recover files to the same disk. By disk I mean a logical or a physical disk.
This is it. Should disaster hit you, don’t panic, nothing is as hopeless as it seems. In fact if you do panic you might do more damage than if you were calm and rational.
P.S.
In my Data Hell experience, I could never recover password protected RAR archives – not sure why that happens, they become corrupted after recovery. I must look in to that. I don’t use passwords anymore.
Windows 7: The Beginning of a Beautiful Friendship?
by Cristian Sandu on Nov.06, 2009, under Operating Systems, Windows
Microsoft is making a big marketing push for Windows 7, including the somewhat hilarious Windows house parties(really now?), so I decided to share a bit about my experience with Windows 7 so far.
First of all, let me tell you a few things about my history as a Windows user. I started with Windows 95 back in 1998 or 1999(my junior year in high school); I had almost no experience with computers – my previous computer was a local Spectrum clone that had almost no OS, just a BASIC interpreter – and I remember being fascinated by the way the OS worked. I think that at that time it was the most user friendly OS you could get (MAC users, don’t frown). I also started using Red Hat Linux at that time, but that’s a different story. Windows 95 was a great OS at the time. Windows 98 was never really for me; the improvements it was boasting weren’t very appealing to me and I never made the jump. I have a vague recollection of Windows 98SE but I am not sure if it was ever installed on my PC. I used Windows ME for a while when it came out. It was for all intent and purposes and improved Windows 98, drawing from the experience Microsoft had with the server version, Windows 2000. When XP came out, I admit I wasn’t an early adopter, I was comfortable with my setup and my PC wasn’t top of the line and I was worried it couldn’t handle XP. Plus, driver support for XP at the beginning was sketchy – not many device manufacturers jumped at the building drivers for the new Windows architecture. What finally made me switch to XP was the fact that my old Windows ME couldn’t handle more than 512MB of RAM and I had just purchased 256MB of RAM and installed it(a weird but functional combination). It must have been a year after the release of XP that I really got on the Windows XP train. Now, Windows XP has proven itself as the Microsoft’s greatest achievement with its multiple service packs and all. Users all over the world still use Windows XP after so many years have passed, not being impressed by Vista’s pretty graphics. When Vista came out, I admit I was an early adopter, I got myself Vista x64 Business via MSDNAA (I was a student at the time). Installing it for the first time was not as easy as they said it would be but, thank God, they had fixed the SATA drivers issue that XP’s installer had – you had to either inject the drivers into the installer disc or have a floppy disk ready which was so ’99 of them. I made the jump early to Vista because I wanted DirectX 10 graphics and I had purchased a copy of Halo 2 which ran only on Vista with DX10. I don’t regret being an early adopter of Vista but I do admit I hit a lot of bumps in the road. We all know what Vista’s flaws were, including the ever so annoying User Access Control so I won’t reiterate. Vista was not a bad experience overall, as some might have you think – OS stability was greatly improved – no more nasty blue screens of death – driver support was good, right out of the box, making it easier for you just plug and play stuff into your PC. Vista had a good heart (kernel I mean) but users turned away from it because of the UAC and the reworked interface that got many of them confused. Vista wasn’t the success they hoped it would be, that much is clear. But they learned their lesson and eventually fixed it. The result would be Windows 7.
If you are still reading, this is the part were I actually discuss Windows 7
. I’ve got Windows &7 when it first came out as a Release Candidate but only installed it in a virtual machine. I had access via MSDN to the final release a few weeks before the actual retail launch so I have been using it for a few months now. Now, Windows 7 feels like Vista in many ways but don’t be fooled, the user experience is greatly improved. I did encounter some problems I had with Vista in Windows 7 as well, but I guess it couldn’t be perfect. Yeah, Steve Jobs, Microsoft did break some promises but you see Windows runs on all kinds of PC not just proprietary built machines like OS X so they have to work harder at making a stable OS.In case you missed it, Apple’s advertising response to Windows 7 is something like this:
Before any Mac people out there get upset I will lay this down: I have used Tiger and Leopard and admit they are great OSes that are easy to pick up and use and there are many pros and cons to have OS X instead of Windows but I don’t want to get into that now.
Let’s talk major improvements in Windows 7. User Access Control was dialed down so that it will not annoy you so much. In fact, you can disable it for your user completely without getting any damn security warnings in your system tray. It was clear that UAC had to be made more friendly – it was natural development given the user response to it. The task bar was redesigned; for real this time. While it could be argued that it is a rip off Leopard’s dock(which has stacks, we know) it manages to actually be better. I often find myself “losing” windows in Leopard and reopening them while in Windows 7 they are cleanly grouped and stored in the task bar. It might take some getting used to for people who are jumping from XP but it is a pretty well designed feature. I am loving the new task bar. With the new task bar comes the new system tray which is now more customizable and less cluttered; you can hide/show what icons you want and more. In other respects, the user interface is almost the same as in Vista with some improvements so Vista users should feel right at home – sorry, XP users, the new control panel might take some time to get used to.
Kernel wise it feels like it’s pretty much the same architecture as Vista – one hint would be that you can install and use Vista drivers – I am still having the same problems I had with Vista when it comes to the stability of some drivers. I am still investigating the root cause of the issues I’ve encountered over time. So, no, Windows 7 doesn’t fix all the problems Vista had but I assume that would have been impossible. I am sure there are lot of behind-the-scenes improvements to the kernel but at this point I haven’t noticed that much of a difference.
Graphics wise, it feels like Vista with a hidden plus: DirectX11. Now, there are now DX11 games or applications yet and while AMD/ATI jumped at shipping the first DX11 capable graphics card, I am not sure yet how this will play out. Surely, developers will start using DX11 but it might take a while to get started. As for hardware, I am waiting for a DX11 solution from nVIDIA.
To sum up, I would say that Windows 7 feels like what Vista should have been but that’s how progress works – developers learn from their mistakes. It’s far from perfect, but maybe we’ll reach that point someday. So, if you are an XP user on the fence about switching to Windows 7, I have only one advice for you: time to leave the golden ages behind and move into the modern era.



