28
mar
1
2
3
4
  // if string start with string
  function strstart($string, $search) {
    return (strncmp($string, $search, strlen($search)) == 0);
  }

rif: albertopasca.it

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , ,

09
mar

Mount the Xcode 3.2.6 DMG and open Terminal

Enter commands:

sh-3.2# export COMMAND_LINE_INSTALL=1
sh-3.2# open /Volumes/Xcode\ and\ iOS\ SDK/Xcode\ and\ iOS\ SDK.mpkg/

You are now able to install Xcode 3.2.6 on Lion with no package modifications!


If the installer dialog while stage “Updating files…” show you this dialog:

In order to continue installation, please close the following application:
iTunes

but you think that have no iTunes opened, open Activity Monitor (located in Applications/Utilities),

Start typing “iTunes” into the filter box in the top right
Select iTunesHelper from the list and click the Quit Process button.





Don’t work?
Try second method:

- Download the Xcode 3.2.6 disk image, ‘xcode_3.2.6_and_ios_sdk_4.3.dmg’, (I will assume it’s in ~/Downloads for the next steps).

- Open up the Terminal and change to the directory where the image resides:

1
cd ~/Downloads

- Attach the disk image with a shadow image to make it writable. Terminal command (as one line):

1
hdiutil attach -shadow xcode_3.2.6_and_ios_sdk_4.3.shadow xcode_3.2.6_and_ios_sdk_4.3.dmg

-Remove the string ‘&& system.compareVersions(my.target.systemVersion.ProductVersion, ’10.7′) < 0 ‘ from line 148 in ‘Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist’. Assuming the disk image got mounted at ‘/Volumes/Xcode and iOS SDK’, you can use this one-liner:

1
cat '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist' | sed "s/&amp;&amp; system.compareVersions(my.target.systemVersion.ProductVersion, '10.7') &lt; 0 //g" > '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist.new' && mv '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist.new' '/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg/Contents/iPhoneSDKSL.dist'

Install Xcode!

done.

Ref: albertopasca.it
Ref: Catacombae




FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , , , , ,

08
mar



and

Today a simple tutorial to show a right click context menu on a selection on web pages with Chrome Browser!

This:
chrome context menu extension

First of all you need to read chrome developer reference (http://goo.gl/ND5z2) .

You can start reading from manifest files format (manifest.json):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
  // Required
  "name": "My Extension",
  "version": "versionString",

  // Recommended
  "description": "A plain text description",
  "icons": { ... },
  "default_locale": "en",

  // Pick one (or none)
  "browser_action": {...},
  "page_action": {...},
  "theme": {...},
  "app": {...},

  // Add any of these that you need
  "background_page": "aFile.html",
  "chrome_url_overrides": {...},
  "content_scripts": [...],
  "content_security_policy": "policyString",
  "file_browser_handlers": [...],
  "homepage_url": "http://path/to/homepage",
  "incognito": "spanning" or "split",
  "key": "publicKey",
  "minimum_chrome_version": "versionString",
  "nacl_modules": [...],
  "offline_enabled": true,
  "omnibox": { "keyword": "aString" },
  "options_page": "aFile.html",
  "permissions": [...],
  "plugins": [...],
  "requirements": {...},
  "update_url": "http://path/to/updateInfo.xml"
}


After that, open notepad and create 3 files in a folder:
- manifest.json
- rightclick.js
- background.html
and an optional icon file
- icon.png (http://goo.gl/3kK92)

In manifest.json copy/paste this code:

1
2
3
4
5
6
7
8
9
10
{
 "name": "YouTube Free Search",
 "description": "Search as you want from any web pages!",
 "version": "0.1",
 "permissions": ["contextMenus"],
 "background_page": "background.html",
 "icons": { "16": "icon.png",
            "48": "icon.png",
             "128": "icon.png" }
}

In background.html copy this string:

1
<script src="rightclick.js"></script>

In rightclick.js write:

1
2
3
4
5
6
7
8
9
10
11
12
13
function sendSearch(selectedText) {
 var serviceCall = 'http://www.youtube.com/results?search_query=' + selectedText;
 chrome.tabs.create({url: serviceCall});
}

chrome.contextMenus.create(
 {
  title: "Find '%s' on YouTube!",
  contexts:["selection"],
  onclick: function(info, tab) {
      sendSearch(info.selectionText);
  }
 });

Yeah!!

You can change serviceCall url with any search string you want like:
Google -> ‘http://www.google.com/q=’ + selectedText;
Facebook -> https://www.facebook.com/search/results.php?q=’ + selectedText;
Bing -> http://it.bing.com/search?q=’ + selectedText;
etc… etc…

Now,
open Google Chrome -> Tool -> Extensions -> Load unpacked extension.
chrome context menu extension
Done!

Select a text in any page and click to see result!
chrome context menu extension

enjoy!

Ref: albertopasca.it


FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , ,

07
mar

Una mail arrivata stamattina… giustamente sulla mail personale, mai comunicata soprattutto all’agenzia delle entrate!




agenzia entrate truffa

7 marzo 2012

NOTIFICA DI RIMBORSI FISCALI

Gentile Contribuente,

Dopo i calcoli ultimi annuale della vostra attività fiscali abbiamo stabilito che si ha diritto a ricevere un rimborso fiscale di 223,56 euro.

Si prega di inviare la richiesta di rimborso fiscale e ci permettono 6-9 giorni al fine di elaborarlo.

Per accedere al rimborso fiscale, seguire le istruzioni riportate di seguito:

…- scaricare il modulo di rimborso fiscale allegato a questa email
…- open it in a browser
…- seguire le istruzioni sullo schermo

Il rimborso può essere ritardata per una serie di motivi. Ad esempio sottoporre record non validi o applicare dopo la scadenza.

Tanto per iniziare la mail ha una frase in inglese… e c’è il primo sospetto!

In allegato alla mail c’è una pagina html, direi uguale a quella originale, ma con una piccolezza…
La form di invio chiama http://96.9.152.20/a/w.php, non il sito dell’agenzia!

1
  <form action="http://96.9.152.20/a/w.php" method="post" name="registrationDetails" >




e direi che quell’ip non è il sito dell’agenzia delle entrate ma bensì di qualcuno a Scranton, Pennsylvania, con un ip statico… come si può vedere dal whois:

NetRange: 96.9.128.0 – 96.9.191.255
CIDR: 96.9.128.0/18
OriginAS: AS21788
NetName: HOSTNOC-4BLK
NetHandle: NET-96-9-128-0-1
Parent: NET-96-0-0-0-0
NetType: Direct Allocation
RegDate: 2008-07-24
Updated: 2012-03-02
Ref: http://whois.arin.net/rest/net/NET-96-9-128-0-1

OrgName: Network Operations Center Inc.
OrgId: NOC
Address: PO Box 591
City: Scranton
StateProv: PA
PostalCode: 18501-0591
Country: US
RegDate: 2001-04-04
Updated: 2011-09-24
Comment: Abuse Dept: abuse@hostnoc.net
Ref: http://whois.arin.net/rest/org/NOC

ReferralServer: rwhois://rwhois.hostnoc.net:4321

OrgTechHandle: SMA4-ARIN
OrgTechName: Arcus, S. Matthew
OrgTechPhone: +1-570-343-8551
OrgTechEmail: nic@hostnoc.net
OrgTechRef: http://whois.arin.net/rest/poc/SMA4-ARIN

OrgAbuseHandle: SMA4-ARIN
OrgAbuseName: Arcus, S. Matthew
OrgAbusePhone: +1-570-343-8551
OrgAbuseEmail: nic@hostnoc.net
OrgAbuseRef: http://whois.arin.net/rest/poc/SMA4-ARIN

A voi il compito di fornire i dati della vostra carta di credito a questo qui, per il rimborso…
L’agenzia delle entrate che vi fa un rimborso…. uhm…

fate attenzione!

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , , , , , , , ,

18
feb

Hi nerdz,
today i’ll show you how to easily control remotely your room with a stupid motion detector, a piro sensor (or you can use other sensors, like ultrasonic, infrared, light sensor, pressure, etc etc…) and two lines of PHP code and C.

* Useful if you want to know if anyone enter in your room and the time that remains there! *


You can get this sensor from AirWick deo! :)

How it works?
Your piro sensor, when detect a motion, notify arduino, that was programmed to send to serial port a value (“m” or “n”).
These value are interpreted by a serial reader (c# program, objective-c, java, c++, or somethig else) that call a PHP page that send email if is enabled sending mode.
Second php page, permit you to control arduino (enable/disable/show logs/clear all).

Steps:
Connect your piro sensor to arduino, easy way, like this:
Arduino Connecting Piro Sensor

After that, write your simple arduino code:

Continue reading “[Arduino] Room Spy Email Notificator” »

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , , , , , ,

18
feb

Well, done!
Developer preview 1 installed successfully.

It works.

FacebookTwitterDeliciousLinkedInGoogle BookmarksNetlogGoogle GmailMySpaceGoogle ReaderShare

, , ,

Switch to our mobile site