Rilasciato VirtualBox 2.2.4
Rilasciata oggi, ad un mese circa dal precedente rilascio, una nuova versione di VirtualBox, la 2.2.4. Si tratta di una versione di mantenimento della precedente, con la correzione di diversi bug
Rilasciata oggi, ad un mese circa dal precedente rilascio, una nuova versione di VirtualBox, la 2.2.4. Si tratta di una versione di mantenimento della precedente, con la correzione di diversi bug
Da qualche giorno ho iniziato a studiare Zend Framework, di cui non mancherò di scrivere qualche tutorial quanto prima. Intanto volevo mettere in evidenza un plugin chiamato ZFDebug (ex Scienta ZF Debug Bar) che è molto utile per il debug della propria applicazione. Il plugin visualizza una piccola barra in basso nel browser con le … Leggi tutto
La proprietà min-height non viene gestita (come a solito) allo stesso modo da tutti i browser. Di seguito un hack per avere lo stesso risultato sui vari browser:
|
1 2 3 |
height: 20px; height: auto !important; min-height: 20px; |
Debian di default installa il browser web iceweasel. L’installazione del Flash Player 10 non è immediata su questo browser, perché non ufficialmente supportato. E’ comunque possibile utilizzare il Flash Player 10 su Iceweasel (ed in generale sui browser istallati sulla vostra Debian) seguendo questa procedura. Innanzitutto va aggiunto il repository lenny-backports al vostro /etc/apt/sources.list nel … Leggi tutto
Sulle distribuzioni che usano il formato rpm per i pacchetti, c’è l’utility chkconfig che consente di vedere/gestire in maniera grafica i processi che vanno avviati al boot. Sulle distribuzioni basate su Debian, è possibile utilizzare sysv-rc-conf ovvero un gestore di run-level per sistemi basati su SysV init scrip. Su Debian l’installazione è molto semplice e … Leggi tutto
In un precedente articolo, avevo indicato come si poteva creare un tunnel ssh verso un host non raggiungibile direttamente su internet. Segue la procedura per la connessione in Remote Desktop ad una postazione windows non raggiungibile direttamente da internet, tramite un host OSX. Chiaramente deve essere disponibile un host intermedio raggiungibile sia dall’host Windows che … Leggi tutto
Riporto di seguito un script php, reperito dal sito sastgroup, utile per validare le carte di credito:
|
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
< ? if( checkCreditCard ("40236007878787", "Visa", &$errornumber, &$errortext)) echo "OK"; else echo"MO"; function checkCreditCard ($cardnumber, $cardname, &$errornumber, &$errortext) { $cards = array ( array ('name' => 'American Express', 'length' => '15', 'prefixes' => '34,37', 'checkdigit' => true ), array ('name' => 'Carte Blanche', 'length' => '14', 'prefixes' => '300,301,302,303,304,305,36,38', 'checkdigit' => true ), array ('name' => 'Diners Club', 'length' => '14', 'prefixes' => '300,301,302,303,304,305,36,38', 'checkdigit' => true ), array ('name' => 'Discover', 'length' => '16', 'prefixes' => '6011', 'checkdigit' => true ), array ('name' => 'Enroute', 'length' => '15', 'prefixes' => '2014,2149', 'checkdigit' => true ), array ('name' => 'JCB', 'length' => '15,16', 'prefixes' => '3,1800,2131', 'checkdigit' => true ), array ('name' => 'Maestro', 'length' => '16,18', 'prefixes' => '5020,6', 'checkdigit' => true ), array ('name' => 'MasterCard', 'length' => '16', 'prefixes' => '51,52,53,54,55', 'checkdigit' => true ), array ('name' => 'Solo', 'length' => '16,18,19', 'prefixes' => '6334,6767', 'checkdigit' => true ), array ('name' => 'Switch', 'length' => '16,18,19', 'prefixes' => '4903,4905,4911,4936,564182,633110,6333,6759', 'checkdigit' => true ), array ('name' => 'Visa', 'length' => '13,16', 'prefixes' => '4', 'checkdigit' => true ), array ('name' => 'Visa Electron', 'length' => '16', 'prefixes' => '417500,4917,4913', 'checkdigit' => true ) ); $ccErrorNo = 0; $ccErrors [0] = "Unknown card type"; $ccErrors [1] = "No card number provided"; $ccErrors [2] = "Credit card number has invalid format"; $ccErrors [3] = "Credit card number is invalid"; $ccErrors [4] = "Credit card number is wrong length"; // Establish card type $cardType = -1; for ($i=0; $i // See if it is this card (ignoring the case of the string) if (strtolower($cardname) == strtolower($cards[$i]['name'])) { $cardType = $i; break; } } // If card type not found, report an error if ($cardType == -1) { $errornumber = 0; $errortext = $ccErrors [$errornumber]; return false; } // Ensure that the user has provided a credit card number if (strlen($cardnumber) == 0) { $errornumber = 1; $errortext = $ccErrors [$errornumber]; return false; } // Remove any spaces from the credit card number $cardNo = str_replace (' ', '', $cardnumber); // Check that the number is numeric and of the right sort of length. if (!eregi('^[0-9]{13,19}$',$cardNo)) { $errornumber = 2; $errortext = $ccErrors [$errornumber]; return false; } // Now check the modulus 10 check digit - if required if ($cards[$cardType]['checkdigit']) { $checksum = 0; // running checksum total $mychar = ""; // next char to process $j = 1; // takes value of 1 or 2 // Process each digit one by one starting at the right for ($i = strlen($cardNo) - 1; $i >= 0; $i--) { // Extract the next digit and multiply by 1 or 2 on alternative digits. $calc = $cardNo{$i} * $j; // If the result is in two digits add 1 to the checksum total if ($calc > 9) { $checksum = $checksum + 1; $calc = $calc - 10; } // Add the units element to the checksum total $checksum = $checksum + $calc; // Switch the value of j if ($j ==1) {$j = 2;} else {$j = 1;}; } // All done - if checksum is divisible by 10, it is a valid modulus 10. // If not, report an error. if ($checksum % 10 != 0) { $errornumber = 3; $errortext = $ccErrors [$errornumber]; return false; } } // The following are the card-specific checks we undertake. // Load an array with the valid prefixes for this card $prefix = split(',',$cards[$cardType]['prefixes']); // Now see if any of them match what we have in the card number $PrefixValid = false; for ($i=0; $i $exp = '^' . $prefix[$i]; if (ereg($exp,$cardNo)) { $PrefixValid = true; break; } } // If it isn't a valid prefix there's no point at looking at the length if (!$PrefixValid) { $errornumber = 3; $errortext = $ccErrors [$errornumber]; return false; } // See if the length is valid for this card $LengthValid = false; $lengths = split(',',$cards[$cardType]['length']); for ($j=0; $j if (strlen($cardNo) == $lengths[$j]) { $LengthValid = true; break; } } // See if all is OK by seeing if the length was valid. if (!$LengthValid) { $errornumber = 4; $errortext = $ccErrors [$errornumber]; return false; }; // The credit card is in the required format. return true; } ?> |
Mi è capitato tra le mani un packard-bell ZG5 su cui installare Debian. L’installazione è stata fatta tramite pendrive, dato che il netbook non ha un cdrom interno ed in linea di massima funziona tutto correttamente. Ho riscontrato però problemi nel riconoscimento della scheda wireless, bastata sul chipset Atheros AR5007EG (chipset adottato da molti altri … Leggi tutto
Se vedete questo messaggio durante l’avvio della vostra LinuxBox Debian, non fatevi prendere dal panico ed operate come segue. L’errore è relativo ad un problema nel file di initrd e quindi basta ricostruirlo per riavviare il sistema. Innanzitutto bisogna avere il CD/DVD della nostra cara Debian per avviare il sistema in rescue-mode: Accendere la LinuxBox … Leggi tutto
Apache2 visualizza in automatico un sito di default, se quello che viene richiamato non e’ stato configurato… Qual e’ il sito di default? Come lo sceglie Apache2? Semplice… E’ il primo in ordine alfabetico. A questo punto la cosa migliore da fare e creare la configurazione per il sito di default (o i siti se … Leggi tutto