Everything Linux - Web Development, Linux Administration and Networking

October 16, 2007

Arrow Keys In Vim

Filed under: Blog, Linux — bpeh @ 1:02 am

When you navigate using the arrow keys in vim, you might get some funny characters like A, B, C…etc. In .vimrc, add this line:

:set nocompatible

This should do the trick.

September 12, 2007

Linux Network Printing

Filed under: Blog, Linux — bpeh @ 5:18 am

I installed a linux network printer for a friend and thought I post the steps here. First of all, find out the ip address of the printer. Go to http://localhost:631 to add a printer. You might need root access.

Under device, choose ipp and in Device URI, type ipp://hostname/ipp/. Then add the model and follow through the rest of the prompts. When you have finished, go to http://localhost:631/printers/ and you should see your printer listed there. do a test print. If it works, congrats. If not, click on modify printer and under Device URI try using socket://address:9100 instead of ipp. The later seems to work quite well with alot of printers. if in doubt, always telnet host 9000 to see if the port is accessible.

If you do not have access to cups via http://localhost:631, just edit the printers.conf file

vi /etc/cups/printers.conf

the config will be something like this:


Info HP laserjet 4100
Location myhouse
DeviceURI socket://your-ip:9100
State Idle
StateTime 1189572516
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer

when done, do a “sudo /etc/init.d/cupsys restart”

hopefully, everything should be working.

September 11, 2007

Internet Security Is About Common Sense

Filed under: Blog — bpeh @ 10:15 am

I find remembering passwords the hardest thing in life. When creating user accounts on the net, we often need the username and password. To save trouble, a lot of people use the same username and password in alot of places - including bank accounts!

Not every website uses encryption for password, so if you happen to register yourself in a hacker’s website, the hacker might use your username and password to try and login to other websites. Account Registration is always necessary but remember to keep a few low security user id and passwords for untrusted site. Some comon sense stuff but people don’t practice it.

September 7, 2007

copy and paste between vim windows - stupid indentation

Filed under: Blog, Linux — bpeh @ 1:00 am

if you are using vim and tries to copy and paste between windows or shells, you may find that vim adds some extra spaces / identations to your code. Irritation? yes. The quick solution is to do a

:set noautoident

or add this in the vimrc file to make it a default.

Newer Posts »

Powered by WordPress