nedjelja, 31. srpnja 2011.

Best internet prepaid data plan if you go to Croatia (2011)

If you are planning vacation in Croatia, you will probably need some internet access. Maybe city where you are going have some free internet hotspots, but you never know, until you get there. So other solution is prepaid internet stick with some data plan. Best data plan is Bonbon internet data SIM (you can use daily package) where you can get 300 mb for 3 kn (about 0.45 Euro). Problem with this package is that you still cannot buy it in store, and you can only buy it if you order it by mail ( https://www.bonbon.com.hr/ponuda/internet_sim ). Second best solution is from T-mobile and Simpa internet. You can buy Simpa internet start paket (SIM only) for 20 kn (about 3 Euros). If you register you will get 500 mb of data. If you also need USB modem, you can buy bundle for 198 kn ( 30 Euros). When you spend first 500 mb, you can buy extra packages, depending what you need.http://www.visitingcroatia.info/internet_tarrifs.asp

petak, 15. srpnja 2011.

Wordpress jQuery hell

If you were caught in javascript hell, here is a quick fix for you(found here):

you need to add <?php wp_enqueue_script("jquery"); ?> before <?php wp_head(); ?> so it would look like this:



<?php wp_enqueue_script("jquery"); ?>

<?php wp_head(); ?>


also, you may need to rewrite some javascript functions, just like this:


var $j = jQuery.noConflict();

$j(function(){

    $j("#sidebar li a").hover(function(){
     $j(this).stop().animate({
      paddingLeft: "20px&"
     }, 400);
    }, function() {
     $j(this).stop().animate({
      paddingLeft: 0
     }, 400);
    });

});

nedjelja, 10. srpnja 2011.

Intuitive way to insert data into mysql

So instead of standard:

INSERT INTO sometable
     ( field1, field2, field3 )
VALUES
     ( 'value1', 'value2', 'value3' )

you can do this:

INSERT INTO sometable
   SET field1 = 'value1',
       field2 = 'value2',
       field3 = 'value3'

Securing your mysql queries from $_POST or $_GET injections

Easiest way is to do this:


foreach ($_POST as $k=>$v) {
    $_POST[$k] = mysql_real_escape_string($v);
}

ponedjeljak, 4. srpnja 2011.

Best linux distribution for Asus EEE PC (900)

I had my Asus EEE pc 900 lying around and almost never used it, because it was slow while running Windows XP. So I decided to try some linux distribution. I found #! ( http://crunchbanglinux.org/ )and I was a bit sceptical at first. I installed it on my 4 GB SD card. I installed it from USB stick which I created with unetbootin ( http://unetbootin.sourceforge.net/ ).
Installation passed without a problem and all hardware was detected (Wow!!! :)
Because it is based on debian, apt-get work also.
I used liquorix kernel that setup offers to install.
My web n walk stick for broadband internet works out of the box :)
Wine works perfectly ( I needed for Mikrotik managing program winbox.exe , even mac detect devices (wow) )
Only little problem I found that default speaker volume was muted, so you have to bring up the volume in mixer.
CRUNCHBANG comes with Chromium browser, and flash player. Youtbe videos are working without a glitch on my 900 mhz Asus EEE 900.
All in all, if you need a distribution for your asus eee, go with CRUNCHBANG :)

Debian: How to send and read SMS with your web n walk stick

If you have T-mobile web n walk stick, witch is Qualcomm 3g CDMA model GIO255 and you want to send sms this is the way:

first check is the device detected:
:~$ dmesg
....
usb 3-1: new full speed USB device using uhci_hcd and address 6
usb 3-1: New USB device found, idVendor=0af0, idProduct=6971
usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-1: Product: Globetrotter HSDPA Modem
usb 3-1: Manufacturer: Option N.V.
usb 3-1: SerialNumber: Serial Number
usb-storage: probe of 3-1:1.0 failed with error -5
hso 3-1:1.0: Not our interface
usb 3-1: USB disconnect, address 6
usb 3-1: new full speed USB device using uhci_hcd and address 7
usb 3-1: New USB device found, idVendor=0af0, idProduct=6971
usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=4
usb 3-1: Product: Globetrotter HSDPA Modem
usb 3-1: Manufacturer: Option N.V.
usb 3-1: SerialNumber: Serial Number
hso0: Disabled Privacy Extensions



then you should look in /dev/ for device ttyHS*

:~$ ls /dev/ttyHS*
/dev/ttyHS0  /dev/ttyHS1  /dev/ttyHS2

For sending sms you will be using /dev/ttyHS0.
Now you can install and run gammu or wammu

apt-get install gammu

or

apt-get install wammu

You can reconfigure gammu with sudo gammu-config

So as port you should use /dev/ttyHS0 , then save and that is it.
You can test it with 

sudo gammu getallsms