Browsing articles tagged with " Tricks"
Sep 21, 2011
jason

How to disable Automatic Updates restart prompt

If you are using Windows XP with Automatic Updates on, you’ll be quite familiar with the dialog box below.

automatic_updates_restart_prompt

It becomes very annoying when you are really busy and the dialog box keeps on coming back. Well, finally I’ve got the easiest solution to get rid of it.

Just go to Start menu –> Run, type services.msc.

You’ll see the following window and right-click on Automatic Updates, choose stop as follow:

services_stop

Right after you clicked “Stop”, the annoying “Do you want to restart your computer now?” dialog box will go away altogether with the system tray icon. Now you can focus on your work undisturbed.

Source : Microsoft Answers

Sep 14, 2011
jason

How to config ubuntu/debian to boot in text mode

I like Linux boxes to boot directly to terminal mode. If you’ve just moved to Ubuntu distro from Red Hat/ Fedora, you’ll think about changing the inittab. Well, bad news is in Debain or any of its derivatives, runlevels 2 to 5 are the same multi-user with display GUI. So if you type, sudo init 3, nothing will happen.

So here is how I make Ubuntu to boot into text mode by default. The requirement for this is you have to use grub as boot loader.

Just edit the /etc/default/grub using any of your favourite text editor, look for the line

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”

Then changed it to

GRUB_CMDLINE_LINUX_DEFAULT=”text”

The following is the screenshot for what my grub file looks like after the changes.

grub_ubuntu_screenshot

After that save the file and run sudo update-grub. That’s it. Starting from next reboot, your ubuntu/debian variants will start in text mode.

Source : UbuntuForums

Sep 13, 2011
jason

How to reverse a string using sed

I had got issue with having to reverse a string of number manually. Of course, that gave me a big headache. Thanks to Peter from Catonmat, I’ve got the following sed script.

sed ‘/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//’

As you can imagine, this is quite complicated, but luckily he’s given nice explanation as well.


sed ‘

/\n/ !G

s/\(.\)\(.*\n\)/&\2\1/

//D

s/.// ‘

The first line “/\n/ !G” appends a newline to the end of the pattern space if there was none.

The second line “s/\(.\)\(.*\n\)/&\2\1/” is a simple s/// expression which groups the first character as \1 and all the others as \2. Then it replaces the whole matched string with “&\2\1″, where “&” is the whole matched text (“\1\2″). For example, if the input string is “1234″ then after the s/// expression, it becomes “1234\n234\n1″.

The third line is “//D”. This statement is the key in this one-liner. An empty pattern // matches the last existing regex, so it’s exactly the same as: /\(.\)\(.*\n\)/D. The “D” command deletes from the start of the input till the first newline and then resumes editing with first command in script. It creates a loop. As long as /\(.\)\(.*\n\)/ is satisfied, sed will resume all previous operations. After several loops, the text in the pattern space becomes “\n4321″. Then /\(.\)\(.*\n\)/ fails and sed goes to the next command.

The fourth line “s/.//” removes the first character in the pattern space which is the newline char. The contents in pattern space becomes “4321″ — reverse of “1234″.

But what I want is the output to be separated by “.” aka dot character. So here’s what I come up with.

$ echo 123456789 | sed ‘/\n/!G;s/\(.\)\(.*\n\)/&\2.\1/;//D;s/.//’

.9.8.7.6.5.4.3.2.1

Still there’s one small issue, I don’t want dot at the start of the string. So after reading his explanation, I realize that I need to put one more “.” to be replaced at the fourth line. This is final script.

$ echo 123456789 | sed ‘/\n/!G;s/\(.\)\(.*\n\)/&\2.\1/;//D;s/..//’

9.8.7.6.5.4.3.2.1

So obviously, if you want “,” aka comma instead of dot, you can just substitute it. If you are curious about getting to know sed, why don’t you head over to catonmat.net. That site got so many cool sed one liners.

Source : Catonmat

Jul 7, 2009
Jason

How to delete every other row in excel

If you want to delete every other row in Excel, you’ll need to use the following macro.

  • On the Tools menu, point to Macro, and then click Visual Basic Editor.
  • For Excel 2007, click Visual Basic in the Code group on the Developer tab.
  • On the Insert menu, click Module.
  • Then copy paste the following code :
Sub Delete_Every_Other_Row()

' Dimension variables.
Y = False ' Change this to True if you want to
' delete rows 1, 3, 5, and so on.
I = 1
Set xRng = Selection

' Loop once for every row in the selection.
For xCounter = 1 To xRng.Rows.Count

' If Y is True, then...
If Y = True Then

' ...delete an entire row of cells.
xRng.Cells(I).EntireRow.Delete

' Otherwise...
Else

' ...increment I by one so we can cycle through range.
I = I + 1

End If

' If Y is True, make it False; if Y is False, make it True.
Y = Not Y

Next xCounter

End Sub
  • Switch to the worksheet that contains the data, and then select the cell that you want to delete.
  • To run the macro, point to Macro on the Tools menu, and then click Macros. (For Excel 2007, click Macros in the Code group on the Developer tab.)
  • Select the Delete_Every_Other_Row macro, and then click Run.

Hopefully, future Excel versions will have built-in functions to delete every other row.

Source : Microsoft KB

Jan 10, 2008
Jason

How to view feedburner subscriber counts from blogs that don’t display

Well, we are very curious with our competitions. Sometimes, we really want to know how much of the subscribers do they have too? For me, I haven’t publicly shown my feed subscriber counts yet even though I am having a quite impressive number for me.

Well, anyway, if you want to view the feedburner counts of the blogs that don’t display, you might be able to see it if you’re lucky. In fact, lucky here means those blog owners should have got change of mind and should be stupid too.

Here’s how to achieve this.

This is my feed address.

http://feeds.feedburner.com/BridgeToNova

If you want to see my subscriber, you should type in the address bar as follow.

http://feeds.feedburner.com/~fc/BridgeToNova

What do you see now?

I’m not lying to you. You can’t see my counts because I know this trick and I’ve already prevented from it by deactivating in my feedburner dashboard. But hey, there are a lot of bloggers out there who don’t know this and you can check their feed counts.

Dec 21, 2007
Jason

How to add ads code into Blogger Beta

If you’ve ever tried to insert the Google Adsense code directly into your Blogger XML Template as you want ads between post (not in the widget sidebar or anywhere else), you’ll be stunned like me when you get the following error message.

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The processing instruction target matching “[xX][mM][lL]” is not allowed.

This is because Blogger uses more strict and standardized XML. The above error simply mean the Adsense code is not standardized XML. To solve this, we need to replace all the html character such as ‘<’ with ‘>’ ‘”‘ with ‘”‘. Check the example below: This is original code.

This is XML standardized code:

You can use your text editor to replace all the HTML manually. Hey why don’t you check out Blogcrowds HTML parser. It is very easy and convenient. Be warned that changing the ads might violate the TOS of your specific ads company. So be sure to check with them to play safe.

Nov 29, 2007
Jason

How to lock computers when idle by using GPO

What I wanted to do is that, after my computer has been idle for 3 minutes, it should lock itself. How to achieve this is one of the trouble for me for almost two days. I have been digging around the net, but no answer. I tried to find myself in GPO (Group Policy Editor), but I don’t find the option directly.

But many articles I read on the net pointed me that I can changed four options in GPO. But that is for screensaver. I tweak a bit to achieve what I want. Remember I have told you guys about how to create shortcut to lock computer. Well, I used that tweak.

Here are the steps that I took:

  • First go to Start –>> gpedit.msc
  • Go to User Configuration –>> Administrative Templates –>> Control Panel –>> Display

There are many options there, but you just need to change four of them as follow.

  • For screen saver option, just choose Enabled.
  • For screen saver executable, choose Enabled and then type “rundll32 user32.dll,LockWorkStation
  • For password protect the screen saver, choose Enabled.
  • For screen saver timeout, choose Enabled and then type the amount of time you want to lock your computer in seconds. (For example, if you want to lock your computer after three minutes of idle time, type 180)

That’s it. Next time if you’re away, you don’t have to worry about some other would invade your computer.

BtoN’s Tips : I have tested this on Vista and should work on Windows XP too. For screen saver timeout, if I set value less than 60, it won’t work.

Nov 27, 2007
Jason

Google china can find warez

Believe it or not Google china can find many software easier than ordinary search. Seeing is believing. Let’s try now.

  • Go to http://www.google.com/intl/zh-cn/
  • Type the name of the program you want followed by cracked download (for example : Office 2007 cracked download)
  • Then click the third button.
  • All the results will be in Chinese. Just click randomly and you can download the software you want with no waiting time and no download limit.

I’m not sure downloading from Chinese site will be faster than your favourite download sites. So if this not work for you, just stick to the method whatever you used to. I’m not responsible for any of your action. This is just a tip.

Nov 23, 2007
Jason

How to open docx files without Office 2007


Microsoft has introduced a new file format called the Microsoft Open Office XML Format (.docx) with their latest office suite, Office 2007.

But most people are still using Office 2003. The big problem is that this new format is incompatible with older Microsoft Office versions or any other Office alternatives such as Open Office or Lotus, StarOffice, NeoOffice. Before anyone blame Microsoft, they have already created a program called Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats. After you’ve downloaded this program, you can easily convert new Office format such as .docx to old Office format .doc and vice versa.

Or if you don’t want to install any program, you can try .docx online converter. Hope this advice help your incompatibility headache.

Nov 13, 2007
Jason

How to create physical IDE disk in VMware

Yesterday, I’ve tried to install Windows XP in VMware 6.0. I’ve tried to use physical hard disk in VMware. But every time I create, VMware won’t let me choose the option of IDE or SCSI. Instead, it only let me select in SCSI whether I want Bus logic or LSI logic.

So I googled around and found out that I’ve to edit VMware hard disk configuration file manually as follows.

ddb.adapterType = “ide”
ddb.geometry.sectors = “63″
ddb.geometry.heads = “16″
ddb.geometry.cylinders = “16383″

And I delete these lines in VMware config file .vmx.

scsi0.present = “TRUE”
scsi0.virtualDev = “lsilogic”
scsi0:1.present = “TRUE”
scsi0:1.fileName = “disk-2.vmdk”
scsi0:1.deviceType = “rawDisk”

Your config file might not look exactly as mine. But you know what to look and how to change. Any question? You can contact me via contact form or leave a comment.

Reference : VMware forum

Pages:12345»