Terminal Commands Every Geek Should Know: Part 2

This is part 2 of the “Terminal Commands Every Geek Should Know” series. This series explains a number of basic UNIX/Linux commands. You can read part 1 here.

1.  Text editors

There are a number of different text editors for UNIX/Linux systems. Two of the more popular and usually pre-installed text editors are nano and vi. To open a file in nano or vi, simply execute “nano” or “vi” followed by the text file you would like to edit. For example, if you wanted to edit a file called “textfile.txt”, you would execute either
nano textfile.txt” or “vi textfile.txt“.

2.  uptime

The “uptime” command simply prints how long the system has been up, when it was last down, load averages, etc.

3.  man

The “man” command, short for “manual”, will display a help page for a specific command. For example, “man ls” displays the help page for the “ls” command.

4.  cp

The “cp” command, short for “copy”, copies one file into another directory. For example, “cp /somedir/test.txt /anotherdir/test.txt” would make a copy of the file “/somedir/test.txt” in “/anotherdir/test.txt”.

5.  Ctrl + C

To immediately stop a command at any time, just press Control + C on your computer’s keyboard.

6.  id -un

The “id -un” command prints out the username of the user you are currently logged in as. “whoami” also works, but is obsolete and has been succeeded by “id -un“.

7. ping

The “ping” command sends a response request to a server hostname or IP address. It can help determine if a server is up and, if it is, what its response time is. For example, “ping example.com” would send a response request to the “example.com” server. If you see something like “64 bytes from 192.0.43.10: icmp_seq=0 ttl=246 time=25.208 ms“, then the server is up and has a response time of 25.208 milliseconds. If you see something like “Request timeout for icmp_seq 0“, then the server is down. To stop pinging the server, just press Control + C.

I hope you learned at least a few commands that you’ll find helpful. Again, make sure you read part 1 here if you haven’t already. Be on the lookout for part 3 in the near future!

A Few New Little Features in OS X Lion

Yes, there’s those few big announcements that Apple made at Back to the Mac and are constantly being advertised. But here’s a few little features that people don’t really take note of.

Change Background on Desktop Right Click

 

In the past, to change your desktop background you had to open System Preferences and open Desktop & Screensaver to change your Desktop Background. Now, you can simply right click anywhere on the desktop and there is a selection to change your background.

Different Backgrounds for Different Spaces

It used to be that you could have different wallpapers on different displays, but now you can also have different wallpapers on different spaces. Just go to the space for which background you would like to change, then right-click and select “Change Desktop Background.” Make sure you quit System Preferences every time you change the background on a Space.

Web Search in Spotlight

Spotlight is a great way for you to find files, look up definitions, and do basic arithmetic problems. With the update to OS X Lion, you can now also use it to search the Web or Wikipedia. Just type in your search and the Web and Wikipedia selections will always show up in the list.

Plus Button now Maximizes 

In the top left of every window, there are three distinct buttons: an x to close, a – to minimize, and a +. The + usually made the window some weird bigger size, and you could set it and toggle between them. It was so confusing that nobody really ever bothered to try and figure out how to use it. Now, however, it will actually make the window take up the screen (without using Lion’s full screen application feature).

With an External Display, closing the lid no longer sleeps

Previously, to use an external display with your MacBook’s lid closed you had to close the lid, wait for the computer to fall asleep, then use a bluetooth/external mouse to wake it up again. This is no longer the case; when you close the lid with an external monitor connected, your display will flash blue to adjust to the new display settings, but your computer will not go to sleep.

I hope you enjoyed this little guide on a few of the hidden features of Lion. They may come in handy someday, and they’re good to know. I’ll continue to post as I find others.

Creating a New Operating System for Your Tablet is No Good

You just designed an amazing tablet. It has an amazing camera, great screen, and good looks.

The only thing that it doesn’t have is software.

You contemplate Android and Windows. iOS would be nice, but as we all know Apple wouldn’t let that pass.

Android and Windows doesn’t have the base features you want, so you create a brand new operating system by your self.

Will the product succeed?

The answer is no. This is basically what is going on with things like the HP Veer and HP Touchpad. The same thing will happen with Sony’s new line of tablets.

Here’s why:

People buy tablets for a few things: Hardware, Operating System Features, internet support, and third party apps.

You need to have a good balance of all of the above.

Hardware, Operating System Features, and Internet Support are three things that as a developer you can program yourself.

However, third party apps rely on Developers. After all, you on your own can’t create every idea that all developers have.

And that’s why you’re in the end, better off going with Android. New products have domino effects.

People buy tablets with lots of apps.

Developers develop apps for tablets with lots of people. Only if there’s a lot of devs or a lot of people will it eventually balance out.

The android operating system has tons of apps, and it’s easy to port. It has good base features, and people really do love it. That’s the reason that you might as well design your hardware, then take advantage of Android for your operating system as it is stable, widely used, and most importantly it already has lots of developers building on it.

 

Google Music Beta

A little while ago, I was invited to the Google Music Beta. I’ve been using it for a while now, and I’m going to share my results here.

Google Music basically uploads your music to the cloud, then you can stream it from the Web or an Android device (no iOS support (yet)). To accomplish the upload of your music, you download a client to your computer that automatically uploads when you get new music. The uploads all happen in the background, so you don’t even have to worry about it.

The web interface is acceptable. It offers album/artist browsing with the album artwork, so it has a bit of similarity with iTunes. You have two main panes: The left one is a navigator where you can choose songs, artists, albums, or playlists; the right one is where your music is listed. It’s similar to iTunes in that regard.


To play a song, just double click it. You get a player bar at the bottom of the interface, where you can change volume, shuffle, repeat, etc.

The android app is basically identical to the built in music app. You have tabs across the top with artists, albums, etc. which you can navigate through and play your music. Unfortunately, I don’t have an android device at the moment (click here to learn why) so I can’t go too in-depth.

The Google Music Beta isn’t available publicly yet, but you can request an invite by going here.

 

 

How-to: Clean iPhone 4 Bumper Case

The Bumber is a sleek case made by Apple for your iPhone 4. It only goes around the edges, and is mainly made to protect your phone from scratches (not-so-drop-proof).

The edges of the case are made of hard plastic; the front and back edges, however, are made of a soft rubber – which tends to hold on to a fair amount of dirt.

On the web there’s lots of different suggestions that were said to fail. However, I found a solution that seems to work quite well.

Materials:

Sink

Warm, running water

Windex

Dish soap

Goo-Gone/Goof-off/Orange based stain remover

Sponge

Towel/Rag

Instructions

First, remove the case from the phone. Please don’t skip this step – if you do, I can’t be held responsible for any damages that will inevitably result.

Next, start the hot water running. Add in a bit of all three ingredients – a few sprays of Windex, a squirt of Dish soap, and a few sprays/a pour of the goo-gone/goof-off/orange citrus based cleaner.

Stop the water when the sink is about half full.

Next, let the sponge soak some of this up and then submerge the bumper in the sink. Scrub the edges clean with the sponge.

Once the bumper is clean to your liking, drain the water. Run cold water and rinse off the bumper well.

Then use the towel to dry it off.

Congratulations, your bumper should be clean as new!

Tinyletter

Tinyletter is so simple that this post wont end up being too long.

Newsletters are a good way to directly tell people about whatever you want to.

In the past newsletters required something big and complicated, the most common MailChimp.
But Tinyletter is making things a lot easier.

It’s really really really really simple.

Go to tinyletter.com and create an account. Then name your newsletter and make a description and youre done. You will have a page for your newsletter and you can send that to friends who can subscribe with their email address.

Then when you want to write a newsletter, just log in and click write newsletter. Type up your newsletter and hit send. Done.

You can also get embed code for your website, which looks something like this:

Enter your email address:

Delivered by TinyLetter

Let me just say: If you really don’t have anything interesting to say, don’t spam people with useless words. If you are some random person with no life, then I don’t think that this would be useful for you and many people would just end up filtering you to spam. Thanks!

Tinyletter homepage

Forgot your password on your computer?

Here’s how to fix it.

NOTE: THIS IS NOT INTENDED FOR MALICIOUS PURPOSES AND I CANNOT BE HELD LIABLE FOR ANY DAMAGE DONE TO YOUR COMPUTER IF THIS IS DONE INCORRECTLY.

What this does is creates a new admin account where you can change the old admin accounts password.


Turn off your computer and turn it back on. Right at the startup chime, hold down command S. This will boot the computer into a command line interface.

Once it is done settling itself type in:

mount -uw / (<–there is a space between -uw and /)

RETURN KEY

rm var/db/.AppleSetupDone

RETURN KEY

shutdown -h now

When you turn your computer back on, it will take you through setup like you just turned on your computer for the first time. It will play the intro, ask you for a language and keyboard layout, and ask you to register.

It will also ask you for a password, so put in a password that this time you will remember!

Now even though you might get worried that you have accidentally wiped your drive and reinstalled an operating system, don’t fret. Once you get into the account go to system preferences and click on accounts. Here, you should see your other admin account listed. Click on that account and click reset password. Here, you can type in your new password. Click OK and log out. You should see both your new admin account and your old one listed. then click on your old one and type in the password you reset it to, then you should be able to log in and access your files.

Once you have done this, open system preferences, click on accounts, and click on the new admin account you had just created. Then, click the -.

Tada! You just reset your admin password without knowing the old one.

Change your Google background

If you’ve been sing bing instead of google (I sure hope not, google overpowers all), you may have noticed that there is a beautiful background picture that changes daily on the hmepage. Google is finally allowing some more customization, and you can add your own picture to the google background! Here’s how:

1. Sign in to google

Go to google.com and click sign in on the top right. Enter your google username and password and you will be signed in and redirected to the main Google page.

2. Select a photo

If you want to upload a photo from your computer, it needs to be more than 800X600. In the bottom left, click change background image. You will be given the options to get the photo from your computer, picasa albums, or public feed stuff.

You can click browse to select a file on your computer’s hard drive. Then click Upload and your photo will be added to a picasa album and applied behind your Google logo. But if you don’t find a background you think is fitting, you can select a picture from the picasa public gallery and picasa editor’s choice.  Now beware that the Google Logo will be white, so if you want it to stand out make sure you select a picture that is not white or yellow. Now beware that the picture will only appear if you are logged into your account.

WeatherBug for iPad

If you just got that new shiny iPad, it may be a great tool for checking the weather, in fact, there’s an app for that!

So I have tried the weather channel, but similar to their iPhone app it is quite buggy. But luckily i found weatherbug which has a very nice interface and is very functional.

When you open the app, you are greeted with a radar map and a bar on the top.

The bar on the top has multiple squares with current conditions, live cameras, a forecast, and if you slide the bar left it acts like a page. You a then shows hourly forecast, active alerts, and a video thingy. You can tap the different boxes to see a more detailed view.

On the map, you can click on map settings to change the view to temperature, pressure, humidity, wind speed, infrared satellite, visible satellite, and radar. Cool!

You can also press the play button in the bottom left to see a time-lapse of the radar images.

The app is free from the app store as well. Yay!

Pictures of some of the features are shown here.

[ad code=1 align=left]

GrandPerspective

What does your hard drive look like?

No, I don’t mean a metal block. I mean the inside. No, I don’t mean a needle on some disks (depending on if you have an SSD of course). I mean on the disks (or chips, if on an SSD).

That’s what GrandPerspective is for.

But an even better way of using GrandPerspective. I was using a bit more than half of my hard drive space, but after using grandperspective and deleting the reallybig blocks that appeared, I was able to cut downTunes movies that I never watch anymore.Upon opening grand perspective, you will notice a window. I reccommendyou selecct your home folder, as scanning the Library and System folders will be useless and you can’t delete anything off of them. It will scan, and after you finish it will come out like the below image. The big blocks are files that take up A LOT of space. Smaller blocks take up less space. This gives you a perspective of what is taking up your hard drive space and how much hard drive space it is taking up, hence the name. Click a block to see its path at the bottom of the window. Click reval to open the containing folder in the Finder.

In finder, you can delete the big file then go back into grand perspective and press Command>Option>S to rescan the folder and conquer all of those other big files.

P.S. If you decide to scan your whole hard drive and you see a big block thatis located at /var/sleepimage, that cannot be deleted. It is the image that your RAM is saved to when you sleep the computer.

Also, for PC, try WinDirStat, download from Cnet available HERE.

Homepage

Download

Easily create an Ubuntu pen drive

Ubuntu. The most popular and (i think) best linux operating system there is.

Especially because it’s lite. It takes up less than a gigabyte to install.

But go before that. Go back to putting in the CD. You know how you could select “Try ubuntu without any change to my computer”? That’s where this post is coming from. You can create a CD but have it save data and instead of a CD be s USB disk.

This is actually simpler than it looks. You will need an internet connection (which I’m assuming you have as you are viewing this page), a PC with Ubuntu Karmic Koala (9.10) installed, and a USB disk, and preferably a mac as well.

First, open a web browser and go to www.ubuntu.com/download to get yourself the .iso of the Ubuntu install. disk. Then, plug in your USB disk to your Mac, open disk utility, select the disk and select Erase. In security options select Zero Out Data, and put the disk format to MS-DOS (FAT). Click erase, then go into the drive (not the partition), click the Partition Menu, from the Pop-up select 1 Partition, and on the right I would title it USB and slect the partition type to be MS-DOS (FAT) and click Partition. Let that finish, then Eject he disk from your mac. Unplug the disk and plug it into the PC that is running the latest ubuntu on it and has the .iso from ubuntu.com/download downloaded. Close all of the running applications and in the menus go to System>Administration>USB Startup Disk Creator. Here, drag in the .iso file to the top box. Select the USB drive from the box on the bottom. Change the slider that appears to a desired amount. I have a 4.4 GB drive and I let it have 1.5 GB. This is because I still wanted to use it as a normall USB drive.

Now click create startup disk and let it do the rest. It will take 10-30 minutes, but the outcome is great. Plug in the disk to a computer and on most computers on the initial bootup screen (usually with the logo of the computer manufacturer) hit escape. Select USB[-HDD/Hard Drive] and you are good to boot. Select “try ubuntu without making any changes to your computer” from the menu that follows and you will boot right into the ubuntu operating system from your USB disk. Here you can setup email, download files, etc. and after shutting down you can plug the USB drive into another computer and boot using the same process and your files and settings will remain.

If you can, try putting it on a necklace. This way you have an operating system with you and all you need is another computer, which there are probably plenty of around these days.

I used the PNY MicroSwivel which is great because it is 4GB and nobody would think that it was a USB disk until you opened it. And then you boot it up and your friends think you just screwed up their whole computer, until you shut it down, unplug the disk, turn it on again, and it’s like nothing ever happened!