FreeRADIUS is the most widely deployed RADIUS server in the world. It is the basis for multiple commercial offerings. It supplies the AAA needs of many Fortune-500 companies and Tier …
Month: January 2011
Detect mobile browser (smartphone)
Detecting mobile browsers is very easy when you know the right regular expression. Here are two examples (for PHP and JSP) PHP <?php $useragent = $_SERVER[’HTTP_USER_AGENT’]; if (preg_match(’/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( …
MySQL – Update one table from another
If you need to update one table with information from another table, you can use next query. UPDATE sourceTable s, destTable d SET d.something = s.something WHERE d.fieldId = s.idUPDATE …
Detect visitor IP address with PHP
Two post in 2 days… 🙂 Here is a small PHP function to detect remote IP address (visitor IP address). This should work even if the client/visitor is behind a …
Simple FTP backup script
The first post for this year… Simple FTP backup script # nano backup_script# nano backup_script Add next lines and save. #!/bin/bash DM=$(date +"%Y-%m-%d") tar -Pzcf /backup/backup_$DM.tar.gz /backup/some_dir/ cd /backup ftp …