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 is an easy to access terminal based on fps games terminal. In ubuntus; sudo apt-get install guake F12 to start

Mtop -mysql monitor

Mtop (MySQL Monitoring Tool) mtop screen Mtop is a little perl utility that shows in real time statistics of your MySQL server. It allows you to quickly identify problems related to mysql poor performance, using an interface similar to the normal ‘top’ command. If you are using Debian then the installation is trivial as mtop…

Gnu Screen Tip: Password Protect Session

1. Screen into the server and go into command mode C-a : 2. type “password” and hit enter, screen will then prompt for you to set a password for the session. You will have to type it in twice. You can have screen do this simply by placing the word ‘password’ at the bottom of…

phpinfo from the command line

Display information about your php install on the command line with the following: echo “< ?php phpinfo(); ?>” | php | less simple enough. Edit: php -i does the same thing. php -i |grep ffmpeg php -i |less


The NERD tree allows you to explore your filesystem and to open files and directories. It presents the filesystem to you in the form of a tree which you manipulate with the keyboard and/or mouse. It also allows you to perform simple filesystem operations. Download NerdTree Here. Install Unzip the archive into your ~/.vim directory….

Keep a command out of your history

Tip: Keep a command out of your history October 13, 2009, 3:43 pm terminal.png If you want an easy way to keep commands out of your ~/.bash_history, do the following: put this in your .bashrc: export HISTCONTROL=ignorespace then in a new bash session when you type in a command, if you put a space before…

/etc/sysconfig/iptables-config in RHEL/CentOS

Most of you know that you need to save your iptables changes using service iptables save before rebooting on Redhat, or else you’lllose all your rules. I brought up the setting IPTABLES_SAVE_ON_STOP to “yes” in /etc/sysconfig/iptables-config. There’s some pretty cool settings in there . Read on for details. The file /etc/sysconfig/iptables-config provides a place to…

Error: “Your platform is not thread-safe” on REL5/Centos5

If you are ever building packacges under RedHat Enterprise Linux or Centos and you get the error “Your platform is not thread-safe”, Make sure you have the following packacges installed along with the prerequsites. gcc-c++ libstdc++-devel redhat-rpm-config Hope this saves someone a few hours of pulling out hair

Ubuntu Force a filesystem check

HOWTO: Forcing a filesystem check Ubuntu makes a filesystem check every 30 boots or something. If for any case, you want a filesystem check you can do it by issuing the following command: shutdown -rF now This command will restart Ubuntu and will make a filesystem check.

WP2Social Auto Publish Powered By :