Month: November 2009

Force passwords change on 1st login

How to force users to change their passwords on 1st login 1.) First, lock the account to prevent the user from using the login until the change has been made: # usermod -L 2.) Change the password expiration date to 0 to ensure the user changes the password during the next login: # chage -d…


Fping

fping is a ping like program which uses the Internet Control Message Protocol (ICMP) echo request to determine if a host is up. fping is different from ping in that you can specify any number of hosts on the command line, or specify a file containing the lists of hosts to ping. Instead of trying…


Dig

How to use the dig command dig is a command-line tool for querying DNS name servers for information about host addresses, mail exchanges, name servers, and related information. Understanding the default output The most typical, simplest query is for a single host. By default, however, dig is pretty verbose. You probably don’t need all the…


Vimdiff

Vimdiff is a tool that comes bundled with Vim and its a wonderful tool for comparing code and merging changes. Vimdiff starts Vim on two (or three) files. Each file gets its own window. The differences between the files are highlighted. This is a nice way to inspect changes and to move changes from one…


Fix cron problems on cPanel 11.x servers

I’ve noticed that on some new installs of cPanel 11.x + CentOS 5.0 there is a problem with cron jobs where the crons are not saved at all with no apparent reason and with no errors. After some investigations I’ve found out that this is do to the fact that crontab doesn’t have the correct…


Take screenshot of limited desktop area

Take screenshot of a rectangular area and save it as png file import –frame myScreenShot.png After this command, the mouse pointer changes to a set of cross-hairs; left-click and drag the mouse across an area of the screen and release the mouse to capture the selected area.


Run remote applications in GUI

If you want to run remote applications such as OpenOffice or Eclipse, just uncomment ForwardX11 yes in /etc/ssh/ssh_config file. After that if you type, eclipse, for an example, the remote application will run in full GUI mode.


Accepting domain literals on a mail server

Accepting domain literals on a mail server Q I have a Red Hat 8.0 server with one primary domain. A friend of mine recommended I check out www.DNSreport.com, which performs a variety of useful tests on the DNS records as well as the server itself. Everything went through fairly well but my domain failed on…


Regex Pattern for Matching URLs

A Liberal, Accurate Regex Pattern for Matching URLs Friday, 27 November 2009 A common programming problem: identify the URLs in an arbitrary string of text, where by “arbitrary” let’s agree we mean something unstructured such as an email message or a tweet. I offer a solution, in the form of the following regex pattern: \b(([\w-]+://?|www[.])[^\s()]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))…


Guake!

Guake is an easy to access terminal based on fps games terminal. In ubuntus; sudo apt-get install guake F12 to start