Get to the point – Code Snippets: Dialing a number, sending SMS & Email from within your app
Feb 8th
These code snippets will allow you to dial a number, send an SMS & send an e-mail from within your application. They will all open up the selected application and close yours.
Dialing a number
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://123456"]];
Sending an SMS
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:123456"]];
Sending an E-mail
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto:amasso@amasso.info?subject=Hello&body=Testing your code snippet."]];
Get to the point – Code Snippets: NSString to NSInteger & vice versa
Feb 7th
NSString to NSInteger code snippet:
NSString *strTest = [NSString stringWithFormat:@"%d", 10];
NSInteger to NSString code snippet:
NSInteger iTest = [strTest integerValue];
clouding.me beta launched!
Aug 26th
The beta version of www.clouding.me is online. Register to beta test this new clouding service. I will soon add an iPhone web version. The iPhone app version is on its way, hopefully Apple will approve it.

Follow me on Twitter
Dynamic username as subdomain system with .htaccess
Feb 8th
Create an .htaccess file with the following code to build a dynamic username as subdomain.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain\.com [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?username=%1 [L]
All visits to http://username.mydomain.com will redirect to index.php?username=subdomain. You can then assign that username to a cookie and build the user’s web page.
Follow me on Twitter
IP2Country in 4 simple steps
Jan 31st
If you need to detect from which country your visitors are connecting to your website follow these 4 steps:
1) wget http://ip-to-country.webhosting.info/downloads/ip-to-country.csv.zip
2) unzip ip-to-country.csv.zip
3) chmod 777 ip-to-country.csv
4) MySQL:
- CREATE DATABASE ip2country;
-
CREATE TABLE `ip2country` ( `ipFrom` int(15) NOT NULL default ‘0′, `ipTo` int(15) NOT NULL default ‘0′, `country2` char(2) NOT NULL default ”, `country3` char(3) NOT NULL default ”, `country` varchar(25) NOT NULL default ”);
-
load data infile ‘/home/downloads/ip-to-country.csv’ into table ip2country fields terminated by ‘,’ enclosed by ‘”‘ lines terminated by ‘\n’;
To test if everything is working create a PHP file with the following code:
<?
$ip = $_SERVER['REMOTE_ADDR'];
$dbh = mysql_connect(“localhost”, “username”, “Password”) or die(“Could not connect: ” . mysql_error());
mysql_select_db(“ip2country”);
$country_query = “SELECT country2, country FROM ip2country WHERE ipFrom<=INET_ATON(‘” . $ip . “‘) AND ipTo>=INET_ATON(‘” . $ip . “‘)”;
$country_exec = mysql_query($country_query);
$ccode_array = mysql_fetch_array($country_exec);
mysql_close($dbh);
$country_code = $ccode_array['country2'];
$country_name = $ccode_array['country'];
echo “Country: $country_name ($country_code)”;
?>
Follow me on Twitter
Enviando comandos a Telnet mediante scripting
Oct 30th
Click here to translate this post
Si en algún momento necesitáis (en Windows) enviar una secuencia de comandos, bajaros este program TST10-Telnet Client
Imaginemos que necesitamos conectarnos automáticamente a un servidor de telnet sin tener que teclear el usuario y password. Con el cliente telnet que Windows nos proporciona no se puede realizar un login automático. Con el cliente TST10 sí podemos conseguirlo, tan sólo se debe crear un TXT llamado script.txt con el siguiente contenido:
localhost
WAIT “Username:”
SEND “usuario\m”
WAIT “Password:”
SEND “password\m”
WAIT “>”
WAIT es el texto que el servidor nos envía. Si vuestro servidor contesta Usuario: en vez de Username: deberéis cambiarlo. Se puede crear un script utilizando todas las funciones que el servidor FTP dispone.
Para ejecutarlo en la línea de comandos introducimos:
TST10.exe /r:script.txt
Follow me on Twitter
























