Computers blog postings

Computers Postings

Earliest: June 12, 2003Latest: April 29, 2017Total: 101

November 9, 2012

Belkin iPhone Cable F8Z277

Broken Belkin iPhone Cable

It looks like Belkin iPhone cables are not as strong as people think. After a couple of weeks, the end piece of my Belkin iPhone Cable F8Z277 broke off.

Now I have to carefully plug in the iPhone in order to get it working. Luckily for me that cables are pretty cheap to find on eBay or Amazon. However, the big advantage of this cable is that it's a Charge Only cable which is useful at work since I can plug it into an available port at my work computer and don't have to worry about applications opening up.

Charge-Only cables are not as easily to be found.

October 24, 2012

Google Adwords v201206 API

I created the above graphic to announce the updated Google AdWords API v201206 to my company. Other engineers might find it handy for their own release notes.

September 14, 2012

December 30 2037

Not sure what's so special about December 30 2037. But when you create an campaign in Google Ad Words, that is the default end date.

I guess they are planning on making some big change to Google AdWords 25 years from now!

April 10, 2012

Adding Code Snippets

Basic Instruction on Adding Code Snippets to Microsoft Visual Studio. This is useful when you find yourself typing the same commands over and over again. By adding your own Snippets you can significantly increase your productivity.

Create a directory to store your Snippets. I used C:/Snippets, but you can use what ever directory you want.

  1. You need to update the Microsoft Visual Studio Code Snippet Manager to point to the new directory. This should be located under the Tools Menu. If you can't find it, here's the instructions on enabling the Code Snippet Manager:
    1. Goto the Tools Menu and Select Customize, which is the second to last menu item.
    2. Under Categories select Tools.
    3. You should see "Code Snippets Manager" on the right. Its the 7th one down.
    4. Drag the Command any place you want, such as the Tool Menu.
  2. Open up the Code Snippets Manager
  3. Add your directory that you created in Step #1 and Click Ok

 
That's it! Now anything with a .snippet you create in your directory will appear in Visual Studio!
 

March 16, 2012

Firefox Sidebar

If you are all of sudden seeing a sidebar in Firebox and can't figure out a way to get rid of it, you have come to the right Blog posting!

The reason this appears is because somehow you click Ctrl-B or Ctrl-H. To remove the side bar, you need to do is repeat the step again:
  • If you see anything about bookmarks, you open the Bookmark Sidebar, type in Ctrl-B again and it will close the bar.
  • If you see 'Today', 'Last 7 days', or 'This month,' then you open the History sidebar, type in Ctrl-H and it will close the side bar.

Hopefully this helps someone close out the sidebar that they accidentally opened.

February 24, 2012

tar, gzip, and ftp with pipes


Using pipes in Unix can save a developer a lot of time with scripting and be more productive. Here's an example where you have compressed your postscript file, Layout.psd and now you want to see it without uncompressing it. You could use:

zcat Layout.ps.Z | gv - gunzip -c Layout.ps.gz | gv -

Of course, you could pipe this output into anything you wanted!

Tar Examples

One of the most useful applications of this is to move a directory as well as all its files and subdirectories to another location. This is done by creating a tar file and piping it into a subshell which runs in a different directory and untar's stdin. That is,

tar cvf - . | (cd ~/newdir ; tar xvf -)

GZip Examples

Finally, you can compress stdin and send it to stdout, or uncompress stdin and send it to stdout, using gzip and gunzip alone in a pipe. That is, these pairs are equivalent.

gunzip -c foo.gz > bar cat foo.gz | gunzip > bar

gzip -c foo > bar.gz cat foo | gzip > bar.gz

Combining Tar GZIP and FTP/sFTP

Now this combination is very useful due to a little know property of ftp. ftp allows you to specify pipes as source or receving files. For instance, you can get and view a gif image from an ftp site with

ftp> get file.gif "| xv -"

or view a file with your favorite page using

ftp> get README "| more"

This is useful, but you can also use this trick to create a tar file onto an ftp site without making that tar file on your local disk. This is invaluable for backup processes. An example of this is

ftp> put "| tar cvf - ." myfile.tar

And to retrieve and untar, use

ftp > get myfile.tar "| tar xvf -"

Or, to send and compress a tar file onto an ftp site, you can use this:

ftp> put "| tar cvf - . | gzip " myfile.tar.gz

That is, ftp makes a transfer transfer file dest by effectively taking the stdout of cat file and piping this into dest.

February 23, 2012

BASH Date

Recently I needed to use date formatting in some Bash scripts that I was writing. I was a little surprise on how hard it was to find how to add date and assign it to a variable.

Below are a couple of examples that I created to help others who are encountering the same issue. Here are a couple of Bash scripts and how to assign a date and manipulate the date too.

Note: There is a slight difference in date formatting between BSD and GNU. (OS X users take note on the BSD formatting.)

BSD:
#!/bin/bash
todaydate=$(date +"%B %d, %Y"")
yesterday=$(date -v -1d  +"%B %d, %Y")
lastmonth=$(date -v -1m  +"%B %d, %Y")
tomorrow=$(date -v +1d  +"%B %d, %Y")
lastyear=$(date -v -1y  +"%B %d, %Y")
ninetydaygoals=$(date -v +90d  +"%B %d, %Y")
echo "Yesterday was $yesterday"

GNU:
#!/bin/bash
todaydate=$(date +"%d/%b/%Y")
yesterday=$(date --date="-1 day" +"%B %d, %Y")
lastmonth=$(date --date="-1 month" +"%B %d, %Y"")
tomorrow=$(date --date="+1 day" +"%B %d, %Y"")
lastyear==$(date --date="-1 year" +"%B %d, %Y"")
ninetydaygoals=$(date --date="+90 day"  +"%B %d, %Y"")
echo "Yesterday was $yesterday"

February 22, 2012

Tar

The tar command archives and extracts files to  and  from  a single  file called a tarfile.  A tarfile is usually a mag-netic tape, but it can be any file.

Common Tar Commands Cheat Sheet

tar cvf filename.tar *Tar the complete directory.
tar xvf filename.tarUntar a Tar archive.
gzip directory.gz *Compress a Directory
gzip -d directory.gzUncompress a Directory.
put "| tar cvf - . |gzip " myfile.tar.gzSend and compress a tar file onto a ftp site
tar -cvf- mydir | gzip -9 > mydir.tar.gzTar and compress the directory at the sametime
gzcat mydir.tar.gz | tar -xvf-Retrieve the archive.

November 23, 2011

jZip and Searchqu Toolbar

Apparently if you install the free jZip application you also get to install the Searchqu Toolbar for Firefox. I don't read everything during the installation, but I am sure if it mention the toolbar I wouldn't have opt for that.

To disable the toolbar, since it doesn't appear to offer any value, you simple select the Firefox Add-ons and then disable the Searchqu Toolbar, this will probably be the last item in you list.

Your best bet would be to remove the application completely. However, I find that disabling it is better since the 'jZip' application will think that its still there and work normally. Who knows if the application checks to see if the toolbar is install, I didn't even know it was going to install the application.

Nice that when doing a Google search on SearchQu, that everything that shows up on the first page is how to get rid of the application, not what why you should keep it.

August 19, 2011

Restart Your PC Automatically after Power Outage

Simple steps to auto start your computer after power failure : BIOS Trick

  1. Get into the BIOS of your system.  (Alt-F12 on Start-up)
  2. Under BIOS settings you will get a tab for the power settings.
  3. Click on power settings,
  4. Check for ?AFTER POWER FAILURE? option and select ?POWER ON?.
  5. Simple and It?s Done.
If you apply the above steps to your computer, during the next power outage your computer will restart when the power comes back on. This is extremely useful when you need to VPN to your computer from home.

You should apply this now while your thinking of it. Don't wait until the next power outage to then take action.