Monthly Archives: October 2007

Passing data using AJAX

The XML data is not the only way how to pass data from the server to browser. The data can be passwd as XML, HTML, just a string, or JSON.

What is JSON?

JSON is JavaScript Object Notation. It is much easy to work with JSON then parse XML data.

When you receive JSON data from the server you will need to evaluate the data into variable and access the data as structure or an array.

This is JSON data:

[ { author: 'name a', title: 'title #1' },   { author: 'name b', title: 'title #2' },   { author: 'name b', title: 'title #3' } ]

This is how to access this data:

var books = reval( req.responseText ); element.innerHTML = books[0].author;

This is how to modify and produce JSON stream:

books[0].author = "me"; String newJSONstream = books.toJSONString();

This is simple. Enjoy!

Seting up NIS automount on Tru64 UNIX (OSF)

Recently I had to enable auto-mounter onTru64 UNIX. The things worked well for NFS host mounts but keep failing the home folders for user login.

The fix was simple. I added following to the end of the automount argument line “/home -nosuid auto.home“.

The full argument line is: “-m /net -hosts -nosuid -M / /home -nosuid auto.home

PS: easy way to setup automount is to use X-window appliaction sysman:

# sysman nfs

VS 2005 ActiveX failed to load in browser windows (Microsoft.mshtml).

Recently I was struggled with issue where ActiveX component developed in Visual Studio 2005 was working on some machines and failed to load into browser window on another.

It was no evidence on what is missing until I spot a message where it was complaint about missing Miscrosoft.mshtml assembly.

It turnout that the Visual Studio 2005 Setup wizard is not adding this assembly into dependency list and therefore into package.

To fix the problem I manually added Miscrosoft.mshtml.dll and stdole.dll to the setup project to copy them into application folder without registration.

Clothing: How to Iron a Button-Down ShirtLifehacker

button-shirt.pngIroning a button-down shirt is a bit of an acquired skill. Home improvement site DIY Life has a quick and dirty tutorial on how to get that shirt wrinkle-free in five easy steps:

  • Begin with the collar, inside and out, starting at the tips and working your way to the back.
  • Do the cuffs.
  • Slide the shoulder onto the end of the board and do the sleeves. Start new the cuff opening then move to the top.
  • Iron the body. Start at the top and go down. The back is low priority — it will wrinkles from sitting against the back of a chair or in a car.
  • Slide the tip of the iron between the buttons.

Pretty easy. Personally, I hate ironing, so I just hang my wrinkly clothes in the bathroom while everyone showers and let the steam do the work for me.

Featured Download: Puppy Linux 3.0 Now AvailableLifehacker

puppylinux.png
PC only: Minuscule Linux distro Puppy Linux got a major upgrade this week to version 3.0, adding Slackware compatibility (which lets users install Slackware packages on Puppy). At a slim 97.6MB, Puppy’s meant to be run from a bootable CD or USB drive and offers a full-on portable desktop operating system environment with the Mozilla Application Suite, AbiWord, Sodipodi, Gnumeric, and Gxine/xine built in, and the whole shebang runs from RAM. Puppy’s a free download for PC’s that can boot from USB stick or CD.

Shopping: Buy the Right Size TV to Fit Your SpaceLifehacker

hdtv-size.png
If you’re finally taking the plunge to the world of HDTV, it’s tempting to go out and buy the biggest screen you can afford. But before you whip out your wallet and plop down for a 65-inch HDTV, make sure you take your practical viewing distance into account with CNET’s simple TV-viewing distances chart. For example, if you want to buy that 65 incher, you’d better be able to veg out at least 8.1 feet away from the screen. Want some more HDTV buying tips? Check out our HDTV guide.

Lifehacker Top 10: Top 10 Wi-Fi Boosts, Tweaks and AppsLifehacker

wifi-header.jpg
No doubt you’ve got a home wireless network or you've connected to hotspots at the local coffee shop or airport—but are you getting the most out of your Wi-Fi? Whether you want to strengthen, extend, bridge, secure, sniff, detect, or obscure your signal, today we've got our top 10 best Wi-Fi utilities and tweaks for the power wireless user. Photo by thms.nl.

10. Improve Coverage with Better Placement

While there are several software and hardware hacks for boosting your Wi-Fi signal (see below), there are also a few simple adjustments you can make to an unmodded access point to get the best coverage. The NY Times says:

  • Place the base station centrally on an upper floor, or atop furniture, because radio waves spread best laterally and down

  • Reception will be better if the signal does not have to travel at steep angles and if it doesn’t have to go through thick walls, mirrors, fish tanks or anything metal
  • Place wireless network components far from other devices in the house that can cause interference, like cordless phones, microwave ovens, baby monitors or halogen lamps
  • Change the default signal channel (usually set to 6) to avoid interference with neighbors’ network devices

9. Extend Your Signal with a Repeater or Wire It With a Bridge

Still not getting enough bars in the basement? Have to perch yourself on the windowsill to get a usable signal from your neighbors? Get yourself a wireless signal repeater (or turn your own router into one) to extend your coverage even further.

For those of you with wired devices far from the access point who need a little connection love, a wireless bridge (sometimes called an Ethernet converter) can be used to convert your wireless signal and provide a few plugs for wired devices (like your media center in the living room.)

8. Sniff Packet Data with Wireshark

On a wireless network and want to take a peek at some of the data passing through the air? Previously mentioned Wireshark (formerly Ethereal) is a handy packet sniffer for those of you interested in seeing the nitty gritty on your wireless network, as shown:

7. Enable WPA Encryption

wpa.pngWi-Fi security isn’t very secure at all, but if your access point is more secure than others, evil-doing crackers are more likely to move on. In the spirit of “best of what’s offered” security, most wireless access points are set to use WEP encryption to password their connections, but WPA (supported on most modern routers and computers) is less easy to crack than WEP. To switch to WPA, on your access point’s administration page, change the security level and set your WPA passphrase to something long and difficult to crack.

6. Limit MAC addresses

macaddresses.png

Along the same lines, you can limit exactly what devices can connect to your wireless network by creating a device access list of MAC addresses. (A Media Access Control address is a unique identifier for networked devices like laptops, phones, repeaters, etc.) Head on into your access point’s configuration screen to set what MAC addresses can use it (like, say, all the computers in your house).

5. Stop Broadcasting Your Network’s Name

Don’t want to advertise your network in the surrounding area? Turn off SSID broadcasting, which will keep regular old laptops and other devices from listing your network as one of the detected options. To do so, in your access point’s administration page, uncheck “Enable SSID Broadcast.”

Like the other security measures mentioned above, just because SSID broadcasting is off, it won't prevent users with the right software from seeing your access point—just users with default wireless detection their computers. Speaking of the right software…

4. Detect Networks with NetStumbler

The excellent free NetStumbler software for Windows will detect all the wireless networks in your area, whether or not the SSID is broadcasted, whether or not they’re passworded and how strong the signal is. Great for war-driving or internet cafe hunting, Mac users should check out MacStumbler.

3. Share Your Computer’s Wired Connection Wirelessly

In a hotel room with one Ethernet jack and two laptops? Plug one computer in and have it share the internet connection wirelessly with the other. Here’s how to share a wired internet connection with other computers wirelessly.

2. Boost Your Signal with Tinfoil

If high placement isn’t getting your signal as far as you’d like, break out the Reynold’s wrap. This video shows how a little tinfoil fashioned into a “Windsurfer” parabola can increase your signal strength several decibels.

1. Unlock Your Wi-Fi Router‘s Capabilities with the DD-WRT Firmware

dd-wrt.jpg

Boost your signal, throttle bandwidth for certain applications, turn your regular old router into a signal repeater and more by installing the fabulous Linux-based DD-WRT firmware which unlocks tons of configuration options on your Wi-Fi router. Here’s how to upgrade your router with the DD-WRT firmware.

Any good security measures, hacks, tweaks or apps we missed? Tell us about ‘em in the comments.

Hack Attack: A Seller’s Guide to CraigslistLifehacker

posting.png
If you live in a city with a thriving Craigslist community, the free, popular online classified ads site is more than just a great place to find excellent deals in your community. It’s also an outstanding tool for selling stuff you no longer need, effectively earning you a little extra cash while helping you declutter your overflowing closets. We’ve already given you the power-users guide to buying on Craigslist, but today is all about the sellers. By following a few simple steps, you can make your Craigslist selling experience simple, painless and profitable.

Part One: Posting Your Item

Prepare Your Item for Sale: No matter what you're selling, chances are you'll need to do a little preparation before it's time to put the item up for sale on Craigslist. For example, if you're selling an old cell phone, you should get rid of all of your contacts and personal information—ideally through some sort of software restore. If you're selling a couch, give it a good cleaning, even if that just means lifting the cushions to gather loose change and vacuum out old crumbs.

A little work cleaning and preparing your item for sale can go a long way toward making sure your privacy is protected and your item looks ready to buy.

Research Similar Postings: After I’ve prepared my item for selling but before I start writing up the Craigslist posting, I always check for similar postings of the item I’m selling on my local Craigslist. It’s good to see what other items are being sold for to get a better idea of the market and to get an idea of what details you might want to include in the post.compare.png

It can also be useful to check the item on eBay, again for prices and posting ideas. When I’m using Craigslist, it’s generally to get rid of things that are just taking up space in my life, anyway, so I normally try to undercut comparable listings by 20% or so, which generally means my items go fast. If you’ve got more time, feel free to price more competitively. But if you just want to free up some space and make a little money doing it, don’t be afraid to go a little cheaper.

Take Good Photos: When I’m shopping on Craigslist, I almost never pursue an item I can’t see a picture of (though it can be a good way to find a deal when you’re shopping on Craigslist, if you’re willing to make the effort of asking for a photo or visiting the seller). The point is, if you have a choice, always include an image. When you’re taking a picture of the item, try to set up your picture in natural light settings so you can get a nice, crisp photo without using your flash.

In addition, if you're selling something for which you can find a product picture—like a gadget, for example—it's great to include a stock photo of the item looking its best.

specs.pngProvide Detailed Information: You don’t have to put together a full product listing, but it’s useful to provide some of the most important details regarding the item. For example, if you’re selling your old cell phone, let your potential buyers know its feature highlights. How many megapixels is the cameraphone? Does it have Bluetooth? What carrier does it support? Once you’ve got down a few of the most important features, find the product’s web site so you can also link to fuller specifications.

Be Honest: Your buyer will be seeing the item in the flesh before purchasing, so don’t try to pull the wool over anyone’s eyes. If you’re selling a TV with a crack in the frame, say so. Otherwise you’re going to waste both your time and the potential buyer’s time. If it’s not brand new, don’t call it brand new. Most Craigslist postings are for second hand items, so buyers expect a certain amount of wear. If the item is really that far gone, just be sure to price accordingly.honesty.png

Publish the Listing: Once you’ve written up and published the listing in the appropriate For Sale category, Craigslist will send you a confirmation link from which you officially publish your post. Just follow the link and click the Publish button. Keep this email handy. You can use it to edit the post in the future or delete it once it’s sold.

Part Two: Handling the Sale

Optimize Communication: As you probably know, Craigslist requires you give them your email address when you’re posting an item. If you want to make yourself available to buyers over email, you can include an anonymized Craigslist email address that will forward to your email address (yay for your privacy!).

If you’ve posted a hot item, get ready for an onslaught of email in your inbox. First things first: set up a filter in your inbox for handling your Craigslist ads. Since all of the emails will initially come to your anonymous Craigslist address, you can filter with the To: field of the email. With Gmail, for example, just filter out emails sent to “craiglist.org” and tag them with a label and you’ve got a good start.

Since you may be handling a lot of email, I’d recommend setting up some text replacement macros for answering email using an application like Texter (Windows) or TextExpander (Mac).texter.png

I prefer to stick with email-only for my initial Craigslist post, but a lot of people prefer doing things over the phone. I wouldn’t recommend posting your phone number in the post; instead, try out a service like previously mentioned Numbr, which creates a temporary disposable phone number you can safely post to Craigslist.numbr.png

Stick with Cash: This one probably goes without saying, but—like a garage sale—you really don't want to accept anything but cold hard cash for your goods. There are a lot of scammers on Craigslist, but they’re easy to avoid. Just deal locally, meet in person, and stick with cash and you should be okay.

Part Three: After the Sale (or lack thereof)

delete.pngRemove the Item Once It’s Sold: You’ll save your inbox and other Craigslisters a lot of hassle by removing the listing once the item has sold. To do so, just follow the post page link you received from Craigslist when you first published your post and click the Delete button to remove the post.

Consider a Trade or Give It Away: If you’ve tried selling an item for a few weeks and you’ve made a couple of different postings and you’re not having any luck, it may be time to give up the dream and give this thing away for free. Craigslist has a very active Free Stuff section, and chances are that even if you didn’t have any luck selling the item, someone will be willing to get it out of your hair rather quickly if you post it in the Free Stuff section.

Those of you who itemize your taxes might want to drop off items at Goodwill rather than giving it away on Craigslist so you can get that receipt and deduct your charitable contributions, but if you really want it out of your hair and don’t feel like making the drive to Goodwill, enjoy the good karma of giving it away for nothing in return.

On the other hand, for a more interesting Craigslist transaction, you might consider posting your item for barter.

This guide is far from exhaustive, but if you’ve never sold an item on Craigslist before, this should give you a good start. If you’ve had experience selling items on Craigslist, share your experience in the comments.

Adam Pash is a senior editor for Lifehacker who thanks the gods every day for Craigslist—as a buyer and a seller. His special feature Hack Attack appears every Tuesday on Lifehacker. Subscribe to the Hack Attack RSS feed to get new installments in your newsreader.

Configuring Services on RedHat 4

It is not an every day task to configure services on RedHat 4 server.

In case you need add/remove or enable/disable services on RedHat 4 server, try to use utility called system-config-services. This is a GUI interface to manage UNIX services.

See RedHat manual for more information url

Etiquette: Get Clothing Recommendations from Dress Code GuideLifehacker

tuxedo_tie.jpg
If you’ve ever scratched your head at dress code jargon for interviews or business meetings and still don’t know the difference between “business casual” and “semi-formal,” worry no longer: web site Dress Code Guide recommends all the appropriate articles of clothing for different situations. For example, if you’re a male and need to know what counts as “business casual” garb, the site suggests a collared shirt with an optional jacket or tie, high quality pants and dark leather shoes. The guide suggests women wear pressed white blouses, knee-length skirts or slacks and closed-toe shoes (does this seem a touch archaic?). Dress codes can be difficult to nail down since they’re ultimately very subjective, so share your interpretations of the casual to formal gamut in the comments.

WP Like Button Plugin by Free WordPress Templates