15 November 2008

5 Tips To Keep Clutter-Free

Very often when I’m working, I find my workspace very messy and cluttered. It starts off with one empty water bottle. Then maybe a couple stray papers come join the small gathering. Before I know it, I’m looking at a small country of clutter. However, there a couple small things you can do to prevent this from happening.

Why is a messy workspace so bad? You might think that it really doesn’t pose a problem. Most geniuses tend to be messy pigs right? Well, whether you’re that genius or not, messy workspaces slow you down both physically and mentally. You become less productive and sometimes less energetic.

There are some small things you can do to prevent clutter from accumulating.
  1. Clean in bits – Don’t let trash have a chance to grow bigger. Mess begets more mess. Whenever you take something out, make sure put it away! Whenever ever there’s a single piece of trash on your desk, throw it away immediately. It is much more manageable to clean up small things. By handling clutter when it’s small, you never need to worry about big messes and your desk always stays clean.

  2. Keep only what you need – Your things on your desk should be things that are in your immediate use. This has to do with cleaning in bits but whenever you finish a task, “archive” it. What does “archiving” mean? It means to store documents, projects, or anything in general for easy reference in the future. When you archive something, you know you won’t be using it for a while so you put it away (preferably in an organized fashion). For example, I like to keep one folder for things I’m working on during the current week. Whenever I’m done with a week, I archive those assignments put them in binders I leave in my room. Anything older than a week on your desk should probably be put away.

  3. Dust your desk – Wipe your desk with a moist cloth/paper towel every 3-4 days to keep dust away. Whenever there are food particles, dust, or small bits of any crap, you’ll start to mentally believe that it’s okay to have a bit of clutter on top. Actually dusting your desk forms a sense of cleanliness and a reason to keep it clean like “I just cleaned this desk…I should probably try to keep it clean.” Another reason that dusting keeps your clutter-free is that in order to really wipe your desk, you can’t have anything on top (that means clean that clutter on top before you wipe).

  4. Create a organizational system – I’m not talking about your files and documents. I’m actually talking about the top of your desk. Have a cup or something to hold your pencils and pens. Maybe have a special area or even a tray to hold papers, and if needed, another spot for your computer/laptop. Allot a certain area for staplers, tape, etc. Having some sort of system for everything on your desk lets you know what’s out of place and helps you fix it. You’ll easily be able to tell when clutter is forming. Not only this, but you’ll be able to find things quicker and hence be more productive.

  5. Make it “look” clean – Worst comes to worst, at least make your desk “look” like it’s clean. The eye works wonders on your brain. Just making something appear clean almost has the same effect on your productivity as if it really were clean. Don’t rely on this or substitute this for the real thing. What do I mean by this? If there’s a bunch of papers lying around, make them into a stack and place it in some corner. If you have knocked over soda cans, bottles, or bags lying around, make it at least look neater by putting the cans and bottles upright and together in some other corner. Put all those “miscellaneous” items together in some organized way. Essentially, what you are doing is setting up so that you can really clean this stuff up later. This is why this can’t substitute for real cleaning.

Every time you leave your desk, quickly go through these tips and you’ll be well on your way to staying clutter-free.

22 October 2008

Is Your Buttermilk Bad?


Ever since I've been living on my own, there's a lot of questions that come up that I've never had to worry about. This especially includes food going bad. Recently, I had orange specks (dots) in my buttermilk. Did my buttermilk go bad and what is this?

When I found I had bright orange specks in my buttermilk, I really thought it had gone bad. And me, being a maniac on not wasting stuff, starting thinking about all the ways I could use up everything before it goes "completely bad".

With some research, I found out that these specks are actually not bad... in fact, it's what's used to make buttermilk. They are actually supposed to be there!

Bacteria: The Good Kind
The orange dots are a strain of lactic acid bacteria that are used in the fermentation process in making buttermilk. Most buttermilk you buy in stores is inoculated with this bacteria to promote the growth of bacteria found in traditionally-made buttermilk (you know, with the churning and stuff). They usually disappear after a while in room temperature but it doesn't matter if it does not go away. It is a natural part of making buttermilk.

Mystery of the Orange Specks: Case Solved!
So next time you find orange specks in your buttermilk, be thankful they're there. They are actually used to make buttermilk and you might not have buttermilk otherwise!

Note: So when is your buttermilk really bad? You'll know. You think when I say this, you won't. But you'll really know. Usually buttermilk smells sweet/sour. When it's gone bad, there's either something else growing in it (not orange) and it'll start to smell reeaally bad (kind of like when milk goes bad).

Dead Space: Will Scare Horror-Addicts

I'm not even the horror-loving type but this game has a certain appeal that draws you toward it. Dead Space is the most brilliant and awesome-looking sci-fi horror game I have ever seen. The game combines various features of other hits in the genre to produce a nasty and thrilling mix.

Unfortunately, I don't have any 3rd-generation game consoles so even though I won't be able to play this game, I still feel like I have an attachment to it (or maybe it's that tentacle-sucking-my-insides-out type of attachment). However, I love interesting storylines, and it sounds like this one is pretty sweet.

Introduction
The game takes place in the future where Earth mines whole planets for minerals ("planet cracking"). USG Ishimura was one of these Planet Cracking ships that got caught up in something. You play as Isaac Clarke, an engineer that's been called to the USG Ishimura after receiving a distress signal.


Impressions
Since I haven't played the game myself, I'll just give you my impressions. Considering that the Flood in Halo actually kinda got me spooked out, I feel that if I ever play this game, I might just shit my pants. Something that really gets me interested in games is not the gameplay but the storyline. I really like games (no matter how simple or complicated) that have some interesting plot and develop it throughout the story. Just imagine what it would be like completely taking apart a planet for mining. What would you even encounter?

Apparently, some weird things called Necromorphs had taken over the ship and you basically find out more about the infestation and you slice your way through hordes of gory and grotesque pieces of flesh. After I got over the setting, I was actually looking at Isaac's actual suit/armor.

Super-Cool Mask
Isaac really wears something that I feel is realistic. You're a miner... so you might need a helmet/mask. It kind of reminded me of those masks you wear when you're welding things. But his mask looks very gothic and dark. It wouldn't be really surprising if he was a murderer in a horror-film but since he's the good guy, it feels so much more powerful. Too bad you might get your whole head bitten off by a Necromorph.



Lighting
Indescribably fantastic lighting makes the game more mysterious and will probably get you crawling closer to the screen before something jumps out of a air duct and impales you. Dead Space uses something called deferred shading which determines the texture/shade of an object in real-time. Most games have pre-defined shades in the environments so that a wall has a certain shade with the lights on and a different shade for a candle. Every situation has been pre-defined so you'll never find anything interesting in the walls. Deferred lighting determines what shade the wall needs to have while you play the game. So if there's multiple small light sources throughout the screen, then the walls will have some reflections appropriate to the situation. End-effect: everything looks spookier...

Real-Time Phobia
Everything is in real-time so even when you look through menus and stuff, the Necromorphs moving toward you will... keep moving towards you. There's no quick way to turn around other than to turn around the way you normally do. The sense of vulnerability keeps your heart racing every minute you play. The "weapons" are pretty interesting though since they are make-shift versions of mining equipment. Your Kinesis power let's you push and pull things around (in unlimited amounts). So feel free to grab some limbs and beat a Necromorph with it. The Statis power slows down objects. Probably very useful when you have angry dead things rushing towards you.

Never feel safe again, or at least not until you make Necromorphs into mush. Headshots don't work anymore. I used to feel so safe with a shotgot in Halo. In Dead Space, you have to dismember every limb before the Necromorph stops (I just hope arms don't move on their own).

In conclusion, you'll never feel safe in spaceships floating in the dark ever again. No really, considering I only look at games, this is the most exciting scare-myself-to-death game I've seen that I wouldn't mind buying a game console for.

Google PageRank: The Mathematics Behind It All

PageRank is some order for pages that rates them based on how important they are. Since "importance" is such a subjective term, how can you actually rank pages? Search engines have to solve this problem so they know what to display first. Luckily, I learned something interesting in my probability course about Google PageRank.

Let's start off with an amazing(ly vague) definition that tells us very little and a whole lot at the same time:
"A page has high rank if the sum of the ranks of its backlinks is high."

Wow. What a statement. Let's break it down.

What Is A Backlink?
It's when someone else links to your website. So it doesn't matter if you have a million links to other websites, it only matters if those million wesbites have links to you. Sounds simple enough.

So what if you have a thousands of dummy pages that all link to your page? Well, it would seem that your page gets a high rank then. However, how does Google prevent this? The pages that link to your page need to be important too. So if some big website links to you, you're somewhat important too.

Probability and Stationary Equations (for Math People)
Anyways, it turns out Google PageRank uses this nifty idea in probability involving stationary equations of Markov chains (anyone scared of math, close your eyes now and scroll to the end):






Putting it together, we get that the PageRank of page i is the sum of all the PageRanks of page j times the probability of it going to page i.

This is the exact formula for stationary equations in Markov chains. So now, if you have a bunch of dummy pages that link to your page, you're still not important because the probability that anyone goes to those dummy pages if very low (hence all of those PageRanks stay low). Now let's try to screw this thing up too.

What if you have some person that decides not link to anyone at all! Or maybe just links to itself. So if even one page has a link TO this page, then as time goes by, everyone will end up at this page and get "stuck" (we don't use the back button since we only follow links). This is called a deadend or spidertrap. In the stationary equations, what happens is that this page gets ALL the importance.

Taxation
One solution to this: taxation. Basically, "tax" everyone's page and take that percent and redistribute links randomly. So suppose there's a 30% tax. Then the probabilities of going through a link is only 70% of what it originally was. Then we take that 30%, and add a random link to some random page. So now, with probability 70%, the "spidertrap" goes back to itself. The other 30% goes to some other page(s).

So you might be thinking how do you calculate the probability of going from one webpage to another. Easy way: you don't! Just assume that you have equal probability. I guess there are better ways that might get only a slightly better answer, but to save time and calculation power, each link has an equal probability of being followed.

For the Non-Math People
So those that skipped over the previous section. Here's a summary: There's an interesting topic in probability called stationary equations that helps you find what "fraction" of the time you are on a webpage. Essentially, if you have a lot of high-ranked websites backlinking to you, many visitors are very likely spending lots of time on your webpage.

What if you try to hog all that importance? What if you don't put links out to other people? In theory (without the browser back button), visitors that come to your page will get "stuck" there. This is called a deadend or a spidertrap.

Taxes on Webpages (For Non-Math People)
Taxation solves this by solving the calculations in stationary equations with random links pointing from every page to every other page. In other words, it creates smaller and less important links that aren't really there when doing the calculations. So when you get stuck in some page, you can follow the non-existent link to something else. It's called a tax because you can think of it as though you're very unlikely to follow that non-existent link and the webpage loses some of it's PageRank (based on how big the tax is).


You can kind of think of it as money. Everyone gets money, everyone gives money. If someone only got money and never spent anything, you can imagine that over a long period of time, he would have most of the money in the world. The taxes basically take that money and give it back to everyone. (Think communism when you see 100% tax... everyone is equal).

Current Model
Google is constantly changing their PageRank algorithm but this is essentially the basis for their model. Understanding Google's PageRank can really help if you have a new website and you want become important really fast. Or if you're interested in working for Google (or planning on buying out Google), doesn't hurt to know this either.

07 October 2008

Crack Windows Passwords

Are you really sure no one can figure out your Windows password? It turns out Windows doesn't do a really good job of hiding your password.

Anyone that has access to your Windows XP/Vista has access to your password. It's almost fun after you learn how to do it. What do you need?

SAMInside is a great program that is fairly quick too in figuring out your password. You do need to copy some essential files though.

It turns out that Windows XP/Vista store passwords in a file in C:\Windows\syster32\config. Two files to be exact. The first file is named "SAM" (stands for Security Accounts Manager). A hash of your password is stored here but it turns out the algorithm Windows uses is horrible. If your password is less than 14 characters, then it splits the password into two 7-character pieces. Another file tries to make this crappy method more "secure" by using some special system properties to encrypt the SAM. The exact information needed for this is stored in the "SYSTEM" file. Once you have both of these files, SAMInside can crack alphanumeric passwords in about 3 hours.

3 hours?! Ok...well maybe a bit longer for some of the weirder people that use punctuation/symbols. But does it really matter? Once a person just copies the SAM and SYSTEM files, you're screwed. Windows does make accessing these files difficult but there are really easy ways around this (boot using a different operating system for example). So what do you do?

  1. Don't let anyone else touch your computer and make sure no one does... (I guess you could do this, but I prefer #2/#3...)
  2. Make your passwords longer than 14 characters. Windows puts a different algorithm to hash your password (takes years/eons to crack passwords now).
  3. Disable the LM hash.
So anyone who wants more information/details on any of this, I might have another post up later (or you could just ask).

17 July 2008

Keep Track of the Newest Beta Software/Sites


Have you ever wondered how people catch on to trends and new ideas online a long time before they happen? I honestly have no idea but BetaNews and MoMB certainly do a great job of helping out.

I've had friends that caught on to Wikipedia ages before it really became something. And Google? I'm not sure about that but I'm sure I knew someone, who knew someone that caught on. Either way, I've always wanted to keep a close neck on new betas and other stuff going on around the web and these two websites have become my new way of doing so.

BetaNews is a great site for software and some new technology stuff. It tells you the newest beta software, gives you links, and even tells you what the software is meant to do. It is set up so you can focus on the beta software if you want, or you can simply be up-to-date on the latest software news. I guess that's how the also came up with their title (I is smurt!). So if you really wanna get your hands (and maybe get them dirty) in the newest software for free, this site will lead you in the right direction!

Another fabulous find is MoMB (The Museum of Modern Betas). I've got to say, this is a pretty great site. Sure it's in blog format (but who doesn't loves blogs, right?!), but this has got the coolest new social networking, file sharing, and miscellaneous new websites. This is probably your best bet on finding amazing sites before they get popularized. It looks like it might have predicted things like Twitter, Flickr, Del.icio.us, and bunches of other stuff.

So, for software, better bookmark BetaNews! And for wonderfully new websites, hold on to MoMB!

13 July 2008

Push-Ups Made Easy


For the longest time, I've been wanting to do a lot of push-ups and be able to say, "Yup! I can do [insert big number here] push-ups!" But that devious little exercise always has me beat. Now, I think I may have a plan to beat it.

This does seem like the typical post you would find on health and fitness sites but this blog is gonna have it all (but mostly computer-related). But this summer, I had three goals in mind. One of them you already know (Java certification). The other one I had in mind was be able to do 50 push-ups (without breaks). I really didn't know how I was going to achieve this but I really didn't care. I had my mind set even though my current best was a weak 28-ish push-ups.

What Muscles Are Involved?
In fact, most people can only do around that amount. I would say you're doing fine if you can even do 20. So what the hell makes these damn things so hard? First of all, it works several muscles that people usually don't concentrate on(this is just my experience). As far as most people know, it works your upper body. Great! Off to a good start. It works your chest (pectoralis major). Alright. For those that go to the gym (or plan to), some bench presses can help that.

What about your arms? I mean half the motion comes from your arms! Some (maybe a lot) of people think it works your biceps. Having big biceps gives you a big arm right? So big biceps = more push-ups? No! In fact, your triceps have much more mass/volume in your arm than your biceps. So it's actually bigger triceps that can get you counting to 25 and more.

The most interesting thing I found out though was that doing push-ups also works your core (abs in general). Keeping your body straight and keeping balance while doing press-ups (as that call it in the UK) is all thanks to your core muscles. There's some other muscles that push-ups work but if you really want to know more about that, wiki it!

Routine
Alright, so how do I do more? Well, when I went to India this summer, I had a whole lot of time to do basically nothing. So what I did was...push-up! Ok, maybe not the whole time, but whenever I was feeling less lethargic than usual. My plan was basically do about 80% of my maximum number. Then shake off the tired feeling in your arms. Then do about 40% of my max. Then do as many as I can before I collapse.

Don't leave just yet. Thanks to my college roommate, I had found out you can do different kinds of push-ups to keep you going. So the everyday, average push-up is keeping your arms about shoulder-width apart. What my roommate calls wide push-ups are about 1.5 times your shoulder-width. Narrow push-up are basically those with your hands about typing-on-a-keyboard-distance apart (around 4 inches apart).

So I did 12 normal and 12 wide without any break. Then took a short 90 second break (you don't really have to be precise on the 90 seconds...I certainly wasn't). Just long enough until you can use your arms again. Then I did 12 narrow. Took a break. Then during my last part, did as many normal/wide push-ups as I could.

Make sure you really give your all out effort on the last part. Do it until you really can't push yourself up anymore. Like you'll fall to the floor (hopefully without smashing your face) and actually roll over onto your back so you can get up.

Thanks to all of that for several weeks, I can finally do 40 push-ups! Not at my goal yet but really close!

Striving for Hundred Push-Ups
It actually wasn't until I got back and did some surfing online did I find an amazing website that sets up a plan for being able to do 100 push-ups. 100?! Crazy! It's really informative and has you testing yourself on a weekly basis. The plan is structured so you're doing more push-ups every week yet still only working 3 days a week. Coincidentally enough, the site is called hundredpushups.com. I'll be starting out on about week 3 of this 6-week plan and hopefully I'll be able to reach my goal before my classes start!

12 July 2008

No Need for a Shovel: Digg!


I can't believe I hadn't started using this earlier. Digg is amazing at keeping you up to date on new and interesting things happening around you. I really wish I registered to their site much earlier, but now that I've found it, I love it!

What's so cool about Digg? Well, it's basically articles from all over the web that people have found interesting. So instead of you having to waste time surfing the web (especially if you don't have much time on your hands), you can just see what others have found interesting (yeah, my vocabulary's limited: cool, interesting...).

Whenever you find an article tending to your tastes, you can "digg" it. Or if you don't like it and you think it's not worth mentioning, you can "bury" it. That's basically the basics. I really like how you can even digg/bury other people's comments. So if someone says something witty like, "I dig Digg", you can digg it!

If you guys are using RSS readers, good for you (more on RSS for those of you who don't). You can easily stay up-to-date on the latest, random junk and crap going around through Digg's RSS feed. And especially since I'm so addicted to fast crack...I mean crap, I really dig Digg!

And by the way, don't be surprised if you see a couple of my posts relating recent things on Digg... I swear, there's no correlation if you find such a trend... (not!).

10 July 2008

BitTorrent to the Rescue


File-sharing clients have come a long way. The cool clients now are those using the BitTorrent protocol. It wasn't recently that I discovered they existed, but it was recently I discovered a few cool things about them.

So, what's so cool that I discovered? Well, I knew that you had to download .torrent files and what not and then use those to download stuff. But I really didn't know what the trackers were and whole lot of other stuff. As for as I knew, finding torrents meant Googling it (which is always a good way to find anything).

The thing I didn't know was the existence of private trackers. The trackers that make sure their torrents are well seeded (meaning people share after they have downloaded the file). This almost guarantees amazing download speeds. Only problem is, this is kind of a closed society. Not only do you have to register to these, the registrations are usually almost always closed. They keep their members in check making sure their ratio (upload-download ratio) is good and that they don't just leech (download then not share).

Once you're in, it's still not paradise (almost though). You've got a wide selection of stuff and pretty good quality. However, some private trackers are more suited for certain things. A few for example have a good array of everything (Demonoid, BitSoup, Torrent-Damage). Those are basically all the ones I've seen. Although there are some other private trackers such as BitMeTV that focuses on just TV episodes. And from what I've heard the torrents this site offers is super duper fast.

So how do I get in? Well, you could check back periodically and if you're lucky, you might get in! (These sites usually have a cap such as 40,000 users so when people get kicked out, there's an opening for someone else) Or you could just run a program such as Tracker Checker 2 (download) or visit the site here.


One last thing, don't think that once your in, you'll always be in. If you get kicked out, it's pretty hard to get back in (or as far as I've heard). As for me, I don't think I plan on getting kicked out anytime soon.

09 July 2008

Get Java Certification


A lot of people know Java. It's one of the easiest programming languages to learn. But it's really different when Sun says you know Java.

It's been around for a while: I don't mean the exam, but my wanting to become a SCJP (Sun Certified Java Programmer). I've been putting it off for about a year now. But I've set a goal that I won't be able to avoid... I've scheduled my exam. In about 10 days, whether I want to or not, I'll take the exam. But what exactly is this exam? What can it do for you? Can I find out the meaning of life with it? I can hopefully somewhat answer all of these questions (err...maybe not the last one).

The SCJP (I'll be taking the one for Java 5) really tests your skills on Java. Unless you do nothing but explore everything there is to Java, your not likely to know all of the details that the exam questions you about. For most Java programmers, you'll usually have your own niche. Some part of Java that your really good at and maybe you'll know a bit about everything else. The SCJP exam tests good understanding of all the fundamentals. It's like the SAT for a job in Java. In other words, if you know all of this, you should be able to tackle most problems. If you really want the specifics, then feel free to look at the Exam Objectives.

What can it do for you? Honestly, I'm not sure but I think I have a pretty good idea. For one thing, most companies are going to get a whole bunch of people that claim to know Java. I mean, I've been taking Java since 11th grade and I only claim to "know" Java. One of my friends took about year (or a bit more), and he already claims to be "proficient" in Java (you should know who you are...). But in reality, there is no evidence or standard of judgment for this. If you really want to let a company know that you can program in Java, get certified! Hopefully, this should let you stand out (at least a bit) from all those other Java-programmer-wannabees.

If you already have a basic understanding of Java, don't go running of taking the test just yet. You probably want to take a couple practice/mock exams just to see if your ready. I haven't taken any yet, but I've been studying (and from the likes of it, I don't even think I'm ready for a practice exam). I'll see when I do take the exam. Until I do, if any of you guys are interested or need help studying, let me know and I'll try my best to help.

04 February 2008

Learn to Write .BAT Files

Batch files (and .cmd files) are very useful for automating small tasks on Windows. If you know how to use command line arguments, then this should be simple. Otherwise, it's fairly easy to learn too. This is a small run through of some of the useful command line arguments you can string together and make into .bat (batch) files. Automate your cleanup and defragmenting or a whole bunch of other things.

So what exactly are .bat files? Batch files are basically command line arguments that you've entered into a text file so that they will run all at once. It's really useful when you want to click on one file in order to open up several things.

For people that are using Linux, this is basically shell scripting. If you have any other needs just type 'help' in command prompt to see all these commands and their usages. When you type 'help', it will tell you all of the basic usages, I'm gonna assume you know the basics stuff and how to use help to review the basic stuff. Let's have a look at the stuff 'help' doesn't show.

Quick tip before we begin: I'm not going to go over a lot of the extra features of these programs. Whenever you encount some command line utility you don't know how to use, just use 'utility /?' where 'utility' is the name of the program. This tells you how to use that program. Usages are usually in the form 'utility [/a][/b][/c]...drive:/path'. The things around '[]' are parameters. If you would like to use that feature, just type that specific letter preceded by a slash ('utility /a'). The other things like 'drive' should be self-explanatory and all other information about the parameters are explained in the usage as well.

Task Managing: In Command Line!
There's two very useful command line tools that work a bit better than task manager. There's are a lot of annoying programs that can sometimes hide themselves from Task Manager so it's kind of hard to stop them from running. These two utilities help you handle these tasks:

TASKLIST is used to list out all the programs that are running on your computer. TASKLIST shows EVERYTHING. There a lot of parameters for this but I've mainly used it without anything special. You can view the processes in different ways (table, list, etc) by using these parameters (type 'tasklist /?' for usage).

TASKKILL is used to ..well.. kill a task/process. This is just a quick way of killing a process. Let's go back to the situation where you can't see a program using Task Manager. Then find it using 'tasklist' and then end it using 'taskkill' if you need to. There's only two parameters I've ever used with this. '/f' forces the process to end (doesn't prompt you). '/im' allows you to specify the "image" name. Just type 'taskkill /f /im process' replacing "process" with your program name to end it.

START is used to start another command line window. I was about to leave this one out but it can come in quite handy if known how to use properly. You can look at the usage but the only things I use are the '/min' and '/wait' commands. In command line, you can type in the name of a file (including an executible) and it will open it with the default program. Using 'start' along with this can be used to open several inter-connected programs with one click. The '/min' starts a new window minimized and the '/wait' waits for the original parent window to wait until this new window closes before moving on.

File Management: Spring Cleaning and Such!
So maybe you know how to use Disk Defragmentor and Disk Cleanup (if you don't, you should learn - the two basically clean your hard drive so it runs faster). If you ever want a simple shortcut so you can double-click it and have them run right before you sleep, here's one way to do it.

DEFRAG is used to defragment your hard disk from command line. The usage is 'defrag <volume> [/a][/f][/v][/?]'. So type. Let's defrag the 'C:' with visual (verbose) output. Then type 'defrag C: /v'. Let's say you just want to analyze it. Then just do 'defrag C: /a'. '/f' is to force the defragmentation even if you have low hard disk space which you shouldn't do.

CLEANMGR is used to run Disk Cleanup from command line. The problem with this utility is that you can't view help info for this utility. So I'll tell you what you can do. The usage is 'cleanmgr [/d diskletter][/sageset:n][/sagerun:n]'. This is the most troublesome utility. You can clean ONE drive with the '/d' command but it opens up the actual Disk Cleanup utility window.

Or you can setup a customized clean method (pick what you want to clean up) using the '/sageset:n' where 'n' is any number from 0 to 65535 (example is 'defrag /sageset:123'. This also opens up a window. The last is '/sagerun:n' which runs one of your customized cleaning setting on ALL the drives. What this utility can't do is clean one drive with custom settings.

Batch File Creation
Alright, so with some of these utilities under your belt, here are some quick .bat files I often use.

The first one I use to cleanup and defrag my hard disk right before I go to sleep. Here it is:

  1. Use 'cleanmgr /sageset:n' to set some cleaning settings. I usually choose to clean Temporary Internet Files, Temporary Setup Files, Recycle Bin, Temporary Files, and Temporary Offline Files.
  2. Now have the following in a .bat file with a name of your choosing. Remember to use the same number 'n' you chose above, below as well.

cleanmgr /sagerun:n
defrag C: /v >> defrag.log


What the '>> defrag.log' does is it creates (or appends to) a file called 'defrag.log' whereever you run this batch file from which logs all of the verbose output from defragmenting.

Thunderbird and YPops
The next file is for those of you who use Mozilla Thunderbird and YPops!. This might be a small audience but I find it very useful. For those of you who don't know, the only way you can access a Yahoo account from any email manager such as Thunderbird is using YPops. YPops needs to be running before you run Thunderbird though but I hate processes that waste memory or CPU power when they are not used. So instead of having YPops running all the time, I do this:

@echo off
start "" "E:\Program Files\YPOPs\ypops.exe"
start "" /wait "E:\Program Files\Mozilla Thunderbird\thunderbird.exe"
taskkill /f /im ypops.exe

The first line disables anything from showing in the command window when you run this (if it's not needed, you don't need to see it).

The second line starts up YPops.

The third line starts up Thunderbird and we also tell command line to wait for Thunderbird to close before going on to the next command.

The last line kills YPops because we're done with Thunderbird and we don't need YPops anymore!

Although you may have command line looming in the background while you run this program, you shouldn't be bothered by this since you're using Thunderbird in the front anyways. Close Thunderbird and the command line window goes away too!

14 January 2008

Windows Vista: Really that Bad?

Many Vista users have been complaining about Vista's compatibility issues, battery life problems, and random other annoying features of Vista. I've come to dislike Vista almost as much as I dislike Macs. However, when I tried making the cookie copying article and some other stuff, I've come to realize maybe it isn't that bad.

Right after I wrote the article on secretly stealing cookies (See the article), I realized I never discussed what you can do if you have Windows Vista (and IE7 which comes installed). When I try to test out this program, first I find the cookies folder locked (gasp). Alright, so while I was at it, I tried another program that uses batch files to do some..umm..stuff. What the hell? I find out I don't have access again. What gives?

What I came to realize was that Vista's "least privileges" rule was actually "saving" my computer. While at the same time this property of Vista prevents users from opening a whole array of things without being bugged by the User Account Control (UAC), it also stops unwanted programs from executing scripts to access the registry or restricted folders.

Is it really that useful though? If you're an inexperienced user, maybe you'll read what UAC has to say the first couple times. Then you get accustomed to it and then click "Allow" every single time. What I found out was that Vista keeps a lot of things locked even UAC is turned off. So it might stop some people from doing stupid stuff but there's plenty of ways to get around this stuff.

Alright so Vista stopped me from doing some stuff. I figured out where the cookies were kept anyways without anything stopping me (see edit in IE Cookies: Yum!).

11 January 2008

IE Cookies: Yum!

Cookies are debated to be a dangerous thing. Website can track what you're doing whereas they also help you keep your cart in order when you shop online. So what are they? In this article, I'll show you one quick hack which will let you use someone elses cookies on your computer.

There's a couple things you should know about cookies first.
  1. Where they are located
  2. How to copy your cookies
  3. What is in a cookie
  4. What can you do with cookies (other than eat them)

1. Where Are They Located
Depending on the internet browser you have, your cookies are stored in different places. I'm only going to look at Internet Explorer and Mozilla Firefox.
  • Internet Explorer - %userprofile%\Cookies
  • Mozilla Firefox - %appdata%\Mozilla\Firefox\Profiles\[random number].default\cookies.txt
Note that whereas IE stores the cookies in a folder, Firefox stores it in one file.

EDIT: For Windows Vista with IE7, the cookies you can actually access are stored in a different location. They are in '%appdata%\Microsoft\Windows\Cookies'.

2. Copy Your Cookies
On Firefox, this is pretty simple. Just copy that 'cookies.txt' file and you're done. On IE, there are two ways. The easy way is to (this is using IE6) do File->Import and Export->Export Cookies and save the file. That will give you a cookies.txt file just like Firefox! If you want to copy to IE, just Import Cookies instead and pick the cookies file.

OK, so this wouldn't be an article without the hard and sneakier way. I started off learning the easy way before I wondered what else you could do if you just had the cookies folder. You start off by copying the 'Cookies' folder to a directory of your choice. If you try to paste this folder into some other another computer/user's folder, you find out a file called 'index.dat' can't be written! One solution to this is to logoff, and login as another user and then paste (to the first user). Ok, ok, that's a bit too annoying if you need to do that everytime. Before I teach the other way, there's some other stuff you should learn... (scroll to the bottom if you just want to know how)

3. What's in a Cookie
So you're looking at that exported cookie file from IE and wondering what the hell do all those numbers and other things mean. Here's the breakdown of all that stuff.

yahoo.com   TRUE   /   FALSE   2127949143  C  mg=1
  1. domain yahoo.com- what (the domain that) created the cookie
  2. flag TRUE- whether or not all machines in the domain can access this
  3. path /- place within the domain that has access
  4. secure FALSE- whether or not a secure connection is needed
  5. expiration 2127949143- when the cookie expires in epoch time (seconds since Jan. 1, 1970 00:00:00 GMT)
  6. name C- name of the cookie
  7. value mg=1- value of the cookie
Each cookie in the 'cookies.txt' file is seperated by a new line (or more sometimes). The Firefox 'cookies.txt' file looks a bit different because the "newline" character is different but don't worry about that.

4. What Can You Do With Cookies
The basics of what cookies are used for: shopping carts, tracking you (in good and bad ways), storing login information (for email, blogs, other websites), and a bunch of other stuff. You can copy your cookies if you're migrating from one internet browser to another.

Let's get back to copying then. Either just copy the folder, or create a .bat file to automate this. Just have:
'xcopy "%userprofile%\Cookies" "[destination]" \h \s \e'
in the file (where [destination] is replaced with the destination folder. So you've copied the Cookies folder (maybe even "sneakily" using the .bat file). How do you make a 'cookies.txt' file to use on another computer?

There's a freeware utility called IECookiesView (download) that will let you do this. Open IECV and go to File->'Select Cookies Folder' and find where you copied the cookies to.

Select all the cookies (Ctrl+A or Edit->'Select All Items') and then File->'Export to Netscape/Mozilla File'.

At first I thought this was all and tried to import using IE. Didn't work. So what was wrong? Two things: the file is exported with a different newline character (uses Unix LF carriage instead of Windows CRLF) and instead of using regular text in the files, it uses percent-encoding (which is just used in URLs..see the wiki).

Fix the first problem by downloading and installing Unix2Win (download), right-clicking the exported file from IECV and selecting 'Text Converter'->Unix2Windows. Cool..that was fairly easy.

EDIT: Alright, so I went back and found out you don't need to install Unix2Win. If you use my converter (see below), it will take care of everything. It will fix the newlines and the percent-encoding problem.

The next problem is a bit harder. Convert the the percent-encoded file to a normal text file. You can find an online solution or use mine. I made my own converter using Java (download). You have to use it from command prompt. Use 'java URL2UTF8 input output'. Perhaps you don't trust this file? If anyone wants to compile it on their own, I'll post up the source code too. If there are any errors that I haven't handled properly, please let me know. Ok, so maybe that wasn't hard for you either (it was for me...I tried searching on the web with no good results before I made it on my own).

Great, now you have the correct cookie text file and it actually works on IE (and Firefox too)!

08 January 2008

Skype on PSP?

All of you PSP users, you're in for a delight. Sony is planning to team up with Skype to develop a version of Skype for PSP users. In about a couple months when the new PSP model, the P-2000, comes out, gamers will be able to install firmware which will allow them to use Skype on their gaming system and talk in WiFi hotspots. (Read original article)

I think that's a great move. Adding extra functionality usually broadens the audience. So you're thinking of buying a game system one day and you're comparing what to get. The PSP is sure to stand out here right? So what's a part of this new functionality?
  1. Call PCs or PSPs that have Skype
  2. Call regular/mobile phone
  3. Get a phone number so PC/PSP Skype users can call

You won't be able to instant message and you will have to get a microphone and earbuds for the PSP, but you're adding phone functionality right?

So I've including all the above information so that you guys can know what's going on with this. I honestly think though that this is trying to make the PSP seem more like an iPhone. I mean you look at the PSP and the iPhone from a distance and they sorta look the same right? OK, maybe not that similar but it seems the PSP is trying to do the same thing though.

I think that all of these devices and companies are trying to do the same thing. They all seem to be trying to make some has-it-all device that will be all you need. Why carry around a phone and a PSP when you can carry just a PSP. Or why carry around a MP3 player, a phone and ...umm... a lot of stuff when you can just carry an iPhone?

There's an article ("Time to Do Everything Except Think" by David Brooks) that talks about a pretend society. Although it's an old article (April 2001), it talks about two people who are carrying devices that can do basically everything (it describes something like a Blackberry). The thing is, this article is starting to mimic what's going on now. David Brooks makes a lot of this stuff sound really bad and unhealthy. Sure to one extent it is, but I think it makes life a bit simpler too.

So as far as the PSP goes, you can choose to get that PSP with the phone or get an iPhone, but I don't really think it's really necessary. I'm into simplicity and I guess that also means not spending money. But whatever suits your life, I can understand your reasons if you get one too.

07 January 2008

Keeping Your USB Drive Safe: Part 1

This is gonna be the first part of several posts on how to keep your thumb drive encrypted, backed up, and safe from anyone who wants to steal it. This tutorial will teach you how to use TrueCrypt and autorun.inf files to secure your USB drive and automatically ask for a password when you plugin your USB.

Encryption

So the first situation to avoid is letting your "private" information come into the wrong hands. To do this, we're going to use TrueCrypt (download), a freeware encryption software.

To prepare your drive first, install TrueCrypt in the "traveller mode" and copy the files to the root directory of your USB drive and start up TrueCrypt from your USB.

Using TrueCrypt



There are two things you can do from here: 1) Encrypt your whole USB drive or 2) Make an encrypted file container. The bad thing about encrypting your whole drive is let's say you take your USB to work or anywhere else and they don't have TrueCrypt. Crap, what do you do? You can't do anything unless you have TrueCrypt. So in this example we're going to make a file container so that you can keep TrueCrypt on your USB (did I mention it's portable?) along with your encrypted files so you can access your secret files from anywhere. (**If you plan to encrypt your whole drive, then you'll have to start TrueCrypt from your hard drive.)

File Container



Click on 'Create Volume'. Pick your drive in the next screen and create a file container using some filename you don't already have on your drive.

Pick Your Algorithms



Pick some encryption and hash algorithm. I usually pick Twofish since it works the fastest for me and Whirlpool (no particular reason for that).

Size and Password

Once you click next, you're going to pick a file container size. I made the container the size of the whole drive so I could keep everything encrypted. Pick your size and then pick your password in the screen after that.



TrueCrypt will allocate the space for the file container and you're done! Just start TrueCrypt and select your file container, mount, and enter the password whenever you want to access your files.

Optional Stuff (My Addition to this Process)

Let's say you've done all this but you want to make sure a person has to enter in the password to view any files. There are some things you can do to make it slightly harder for other's to access your files and easier for you.



We're going to do two things: 1) Make TrueCrypt start automatically and 2) Keep all your unencrypted files 'hidden' and harder to access.

So let's start off by creating a file called 'mount.bat' in the root folder of your USB. As many of you may know, this will let you command line arguments from a file. If you followed the previous part (encrypting) as explained, then open 'mount.bat' using a text editor and type the following:

start "" truecrypt /v usb /a /q /e
**Instead of entering 'usb', enter the name of your file container.

Create another file called 'unmount.bat' (also in the root folder) and type:

start "" truecrypt /d /q

Now create one last file called 'autorun.inf'. This is the file that will automatically execute this stuff as soon as your USB drive is plugged in. Type this in that file:

[autorun]
open=mount.bat
UseAutoPlay=1
shell\mount=Mount
shell\mount\command=mount.bat
shell\unmount=Unmount
shell\unmount\command=unmount.bat
shell=mount




The first line with 'open=..." says to open the following file as soon as the drive is plugged in. The second line says to just run the file instead of having Windows ask what to do (disable Autoplay feature). The next four lines sets some shell menu options to 'Mount' and 'Unmount' the device. The last line says that whenever you double-click on your USB drive from My Computer (if you're using Windows), it will ask you to enter the password for the TrueCrypt container (only if you haven't already done so).

Lastly, open command prompt and navigate to your USB drive (Just type the letter of your drive and ':' [colon] and enter). Type 'attrib +r +h +s' and press enter. This will make all your files read-only, hidden, and system files.

If you have any questions feel free to comment below and I'll try to answer them.

06 January 2008

First Post: What Am I Doing?

So this is my first blog, first post, and first time using the internet (just kidding). I'm not entirely sure where this blog is going to be headed to but I'd love anyone and everyone to leave their comments and help me out. I'll just start off with a bit about me.

I'm a CS student at Carnegie Mellon University. I've come to realize that not everyone is meant to be a CS major. Sure you thought you knew stuff in high school. Then you get to college and you find out there's people operating on a different dimension of intelligence. So as far as my major, I didn't really know anything. Java was nice for a while, then they tell you that you need to know shell scripting, AWK, Perl, and C. The problem with this was, half the class already knew the stuff and I was one of the few that didn't.

I'm kinda a person that's in between everything but not great at anything. I'm good at math, but just not good enough to be a mathematics major. I'm good with computers, but maybe not enough to be a CS major. Basically I have no clue what the hell to do.

Well, that just meant I had a lot of learning to do. Basically, now I'm just on a rampage to learn as much as possible about everything computer-related. Maybe it doesn't have anything to do with my classes, but it's always nice to know random crap. That's where my blog begins. This I guess will be about all that "random crap" I find out and maybe even do stuff with.