samedi 14 décembre 2019

API : MAC ADDRESS VENDOR

Vous avez une Mac Address inconnu et souhaitez avoir plus d'information ?
Le nom du vendeur par exemple (si la mac n'est pas Spoofé !)

Voici une petite API qui fonctionne fort bien:

https://api.macvendors.com
Exemple:
avec l'adresse Mac: FC-A1-3E-2A-1C-33
et on utilise ainsi :
 https://api.macvendors.com/FC-A1-3E-2A-1C-33
Le résultat s'affiche directement sans besoin de le parser
La Doc (https://macvendors.com/api) indique qu'on peut utiliser une MAC au format ":" ou "-" indifféremment.
Si non trouvé : 404
pas d'enregistrement, de compte ou de token.
Le top !!!!
Samsung Electronics Co.,Ltd



mardi 10 décembre 2019

WMI : Serial Number

Merci à Djahid pour cette info:
en invite de commande

wmic bios get serialnumber

Powershell : activer les scripts






Si vous avez besoin d'activer des scripts powershell sur votre ordinateur et que celui-ci vous insulte voici de quoi le calmer :

Set-ExecutionPolicy Unrestricted
s'il est méchant:
à refaire en administrateur

sinon ajouter la clef suivante à la base de registre


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Unrestricted"



mercredi 27 novembre 2019

API: URL 2 screenShot

Si vous souhaitez avoir une capture d'écran d'une page web, vous pouvez utiliser ce service:
http://www.robothumb.com/


exemple: http://snoopy.robothumb.com/thumbnails/800x600/y/yahoo.fr.png

Une URL, une taille = une image

mercredi 6 novembre 2019

Powershell: fonction global





Vous voulez créer une fonction utilisable sur votre console même après l'avoir éteind ou redémarré le PC :

1°)Dans une console Powershell faites: 

test-path $profile
S'il affiche True, passez à l'étape 3
Si False, passez à l'étape 2

2°)Dans une console Powershell faites:
new-item -path $profile -type file -force
3°)Editez le fichier
%userprofile%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Vous pouvez creer vos fonction dans ce fichier
function touch {New-Item -ItemType File -Name ($args[0])}
function sayH {write-host "Hello World";write-host "Hello Everybody"}
etc....
FERMEZ la console Powershell et relancez la.
Vous pourrez appeler directement touch toto.txt (pour creer un fichier toto.txt) ou sayH pour lire Hello World Hello Everybody

Très pratique pour arriver directement à son répertoire de travail et lancer un script
function auboulot{c:; cd\; cd temp; cd travail; .\mon_script.ps1}

mardi 29 octobre 2019

REG : Cacher les îcones du bureau




Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDesktop"=dword:00000000


0= afficher
1=cacher








Pour l'appliquer immédiatement :
C'est ICI


lundi 28 octobre 2019

Bat: Envoyer un message (le nouveau netsend)





Envoyer un message à un collègue

Si vous vous souvenez de Netsend qui était désactivé depuis windows 7.
Sachez qu'il existe un autre outil qui va encore plus loin.

Déjà sachez qui est connecté sur une machine distante:


query session /server:nom_pc

Puis envoyez le message comme suit:

msg nom_utilisateur /server:nom_pc /V /w "Hello !"

/v = verbose
/w = information sur la réponse (clic sur ok ou ferme la fenêtre)

Bat: Query Session + LogOff




Vous voulez savoir qui est connecté sur un pc et le Kicker si besoin :
En invite de commande ou Powershell
Query session /server:nom_du_pc
récupérer le numéro de l'ID

logoff /server:nom_du_pc

mercredi 23 octobre 2019

Bat: restart Explorer (Kill explorer and start it again)

Copy/paste into txt file
which will be rename into .bat extension

taskkill /f /im explorer.exe
EXPLORER

Reg: bloquer la possibilité de verrouiller sa session

Désactiver l'option Windows+L pour verrouiller sa session

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
"DisableLockWorkstation"=dword:00000001

où 1 bloque la possibilité
où 0 active la possibilité

Reg : désactiver les options de fermeture de Windows

Désactiver les options de fermeture de windows:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"HidePowerOptions"=dword:00000001

ou

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoClose"=dword:00000001


où 1 = desactiver la possibilité
où 0 = activer la possibilité

Windows 10 - associer Acrobat avec les PDF





Si d'aucun pensent que cette action est facile, il ne faut pas oublier que Windows s'amuse à changer les règles.
Ainsi ce qui pouvait être anodin auparavant devient un véritable jeu de reverse ingénieurie.

Rappel des raccourcis :
page des associations d'extension:
control.exe /name Microsoft.DefaultPrograms /page pageFileAssoc

PopUp ouvrir avec
Rundll32 Shell32.dll,OpenAs_RunDLL .pdf
on retrouve l'info dans regedit ici:
HKEY_LOCAL_MACHINE\Software\Classes
qui est recopié ici:
HKEY_CLASSES_ROOT

Les modifications au niveau utilisateur sont enregistrés ici:
HKEY_CURRENT_USER\Software\Classes

[Rappel sur les exports de regedit]
Reg export "HKCR" "C:\HKCR_HKEY_CLASSES_ROOT.reg"
Reg export "HKCU\Software\Classes" "C:\HKCU_Classes.reg"

ASSOC:
(pour une extension, le NOM d'une application)
affiche la liste des extension et leur association (en ligne de commande)
assoc
pour uniquement le PDF
assoc .pdf





pour le modifier
En ligne de commande avec privilèges :
assoc .pdf=AcroExch.Document.DC
assoc .pdf=acrobat
>>> Quelques chose se passe mais rien de visible


FTYPE:
mais que fait ftype ? la meme chose que Assoc mais pour l'ensemble des comptes locaux.
(pour une extension, le CHEMIN d'une application)


jeudi 17 octobre 2019

API: TinyURL


Voici une API pour transformer une URL en URL reduite avec le service TinyURL:

http://tinyurl.com/api-create.php?url=www.perdu.com
donne un resultat du type:
http://tinyurl.com/phy6

En PowerShell
$url = Read-Host "Enter the Url"
Invoke-RestMethod -Uri "http://tinyurl.com/api-create.php?url=$url" | clip

API: Google chart

En bref,
voici une commande que j'ai trouvé bien sympa pour créer un graphique en image avec des informations passé en URL:

http://chart.apis.google.com/chart?cht=p3&chd=t:80,20&chs=250x100&chl=Moi|Vous


http://chart.apis.google.com/chart?cht=p&chd=t:60,25,15&chs=300x100&chl=Moi|Vous|les autres


http://chart.apis.google.com/chart?cht=p3&chd=t:80,20&chs=250x100&chco=00CC00,0000CC&chl=Moi|Vous"





et pour allerplus loin :
https://developers.google.com/chart/?csw=1 

 


Source:
https://www.wakdev.com/more/wiki/divers/72-creer-des-graphiques-dynamiques-via-google.html

Le parfeu de windows : en ligne de commande


Vous devez géré le parfeu de windows en ligne de commande, voici quelques exemples :

Pour accéder au Parfeu:
firewall.cpl
ou
control /name Microsoft.WindowsFirewall
ou
control firewall.cpl 

Les commandes powershell relative au parfeu
Get-command *firewall*

Informations sur les profils du parfeu
Get-NetFirewallProfile
Get-NetFirewallProfile | ft Name,Enabled
 




Désactiver le Parfeu: (tout ou par profil)
netsh firewall set opmode disable

 Désactiver tous les profils du Pare-feu Windows :
Netsh advfirewall set allprofiles state off

 Désactiver le profil « Public » du Pare-feu Windows :
Netsh advfirewall set publicprofile state off

 Désactiver le profil « Privé » du Pare-feu Windows :
Netsh advfirewall set privateprofile state off

 Désactiver le profil « Domaine » du Pare-feu Windows :
Netsh advfirewall set domainprofile state off


ou en powershell:
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
 

Activer le Parfeu:
netsh firewall set opmode enable

 Activer tous les profils du Pare-feu Windows :
Netsh advfirewall set allprofiles state on

 Activer le profil « Public » du Pare-feu Windows :
Netsh advfirewall set publicprofile state on

 Activer  le profil « Privé » du Pare-feu Windows :
Netsh advfirewall set privateprofile state on

 Activer le profil « Domaine » du Pare-feu Windows :
Netsh advfirewall set domainprofile state on







Afficher toutes les règles du parfeu :
netsh advfirewall firewall show rule name=all
 ou en powershell

Get-NetFirewallRule
et la liste de ces règles:
$rules=Get-NetFirewallRule
$DisplayGroups=foreach ($rule in $rules){$rule.displaygroup}
$DisplayGroups | Select-Object -Unique 
ou en plus simple
Get-NetFirewallRule | Select-Object -Unique 
ou autrement
Get-NetFirewallRule | select-object name,enabled |Out-GridView  -passthru


 Réinitialisation de la configuration
netsh advfirewall reset 



Fichier Log du firewall :
(par défaut: c:\Windows\system32\LogFiles\Firewall\pfirewall.log)

Voir les logs:
netsh advfirewall show allprofiles logging

Changer le chemin:
netsh advfirewall set currentprofile logging filename “C:\temp\fw.log”



Exemple pour bloquer un protocole (ici les PING en ICMP)
netsh advfirewall firewall add rule name=”All ICMP V4″ dir=in action=block protocol=icmpv4
Exemple pour autoriser protocole (ici les PING en ICMP)
netsh advfirewall firewall add rule name=”All ICMP V4″ dir=in action=allow protocol=icmpv4


Exemple pour créer une régle qui autorise un port
 netsh advfirewall firewall add rule name=”Open SQL Server Port 1433″ dir=in action=allow protocol=TCP localport=1433

Exemple pour supprimer une rèlge
netsh advfirewall firewall delete rule name=”Open SQL Server Port 1433″ protocol=tcp localport=1433
Remove-NetFirewallRule -Name VNC01


Exemple pour Autoriser un programme:
netsh advfirewall firewall add rule name=”Allow Messenger” dir=in action=allow program=”C:\programfiles\messenger\msnmsgr.exe”

Exemple pour autoriser l'administration à distance
netsh advfirewall firewall set rule group=”remote administration” new enable=yes
Exemple pour autoriser  les bureaux à distance
netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes
New-NetFirewallRule –DisplayName "Autoriser le Bureau à distance (RDP)" -Group "Bureau à distance" -Profile Domain -Enabled True -Action Allow

Exemple poussé:
L’objectif sera d’autoriser les connexions à destination du port 5900, 
en TCP, pour permettre les connexions à distance via VNC, à destination 
de l’IP « 192.168.1.20 » du serveur, sur le profil domaine. 
New-NetFirewallRule –Name "VNC01" -DisplayName "Autoriser VNC (5900)" -Profile Domain -Enabled True -Protocol TCP -LocalPort 5900 -Action Allow -LocalAddress 192.168.1.20
 
 Désactiver une règle:
Set-NetFirewallRule -Name VNC01 -Enabled false
(Get-NetFirewallRule -Name VNC01).Enabled 



Importer /Exporter des règles de parfeu
netsh advfirewall export “C:\temp\WFconfiguration.wfw”
netsh advfirewall import “C:\temp\WFconfiguration.wfw”




Sources:
https://www.itstrategen.nl/2019/03/04/top-10-windows-firewall-netsh-commands/
https://www.it-connect.fr/chapitres/gerer-le-pare-feu-en-powershell/
https://hichamkadiri.wordpress.com/tag/netsh-advfirewall/
https://support.microsoft.com/fr-fr/help/947709/how-to-use-the-netsh-advfirewall-firewall-context-instead-of-the-netsh
https://www.it-connect.fr/chapitres/gerer-le-pare-feu-en-powershell/



lundi 7 octobre 2019

NodeMCU Episode 6 :DHT11 (humidité et temperature) Nano et NodeMcu(LoLin)


Voici un nouveau Projet.
Il fait froid chez moi et je voudrais savoir quand le chauffage va être mis en route.
J'ai besoin d'un NodeMCU branché sur mon Wifi qui enverra les informations d'humidité et de température sur via le Wifi sur une page PHP (base de donnée, jolie schéma etc...)
Déjà verifier que j'arrive à récupérer des données du DHT11 sur le NodeMCU.
Bon ca va faire 1h30 que je suis dessus.
Le satané cablage m'aura fait perdre pas mal de temps.

Branchements:
DHT11 - Nano
Plus (+) - 3,3V
OUT- D2
Moins (-) - GND

Branchements:
DHT11 - NodeMCU LoLin V0.1
Plus (+) - 3,3V
OUT- D4 (What The F....)
Moins (-) - GND

Librairie Utilisé:
DHT_Unified_Sensor

Modifié ainsi:
Comment la ligne du DHT22
decomment la ligne du DHT11
Ajout les librairies suivantes:
// REQUIRES the following Arduino libraries:
// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor

  ! Toujours bien penser à fermer ses fenêtres COM3 ou COM5 ou autre avant de téléverser. !
Mon LoLin est toujours considéré comme un NODEMCU 0.9 (ESP12 Module) dans Outils/ Type de Carte

Maintenant, il faut préparer une page PHP pour récupérer les données
mettre un client Web pour envoyer ces données.
et bien sûr espacer les délais de 1000 (1 seconde) à 900000 au minimum (15mn)

Page PHP: (le fichier "tempdht11_result.txt" doit déjà exister)
https://github.com/tumador/Sonde_DHT_Wifi_PHP
Voici le script Arduino pour l'ESP pour envoyer les données au fichier PHP
https://github.com/tumador/Sonde_DHT_Wifi_PHP

lundi 30 septembre 2019

Accéder au profil utilisateur rapidement





Win+R
"." et entrer

rapide simple !

Reg: retirer l'icone contact de la barre des tâches






Voici un petit fichier reg pour désactiver l'affichage de l’icône Contact dans la barre de tâche :
pour etre effectif, redémarrer la session ou killez le process "explorer" pour le relancer


[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People]
"PeopleBand"=dword:00000000

Lister les mots de passe Wifi



Voici un petit script pour lister les mots de passe Wifi sous windows :

$list=@()
$listSSID=(netsh wlan show profile * key=clear) | find "Nom du SSID"
$listSSID=$listSSID.Substring(30).replace('"','')

foreach ($SSID in $listSSID) {
    #write-host $SSID
    $pass=(netsh wlan show profile $SSID key=clear | find 'Contenu de la cl')

    if ($pass -match 'Contenu de la cl')
        {
        $pass=$pass.Substring(35)
        #write-host $pass
        #write-host "2--------------"
        $list+=[PSCustomObject]@{SSID = $SSID;PWD=$pass}
       
    }
}
$list | out-gridview -PassThru

mardi 16 juillet 2019

Arduino Episode 19 : Projet Reveil (tout va bien)

Arduino Episode 19 : Projet Reveil (tout va bien)

J'ajoute juste mon code où le superflu est supprimé, et les effets me conviennent.
Prochaine étape : Le tilt

// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <stdint.h>

RTC_DS3231 rtc;
char str [20];
char joursemaine[12];
char daysOfTheWeek[7][12] = {"Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"};
char jourmois[12];
char anneefull[4];
char horaire[12];

#define HARDWARE_TYPE MD_MAX72XX::ICSTATION_HW
#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10

// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
int j = 0;

void setup () {
P.begin();
P.setIntensity(0);
Serial.begin(9600);
delay(3000); // wait for console opening

if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}

if (rtc.lostPower()) {
Serial.println("RTC lost power, lets set the time!");
// following line sets the RTC to the date & time this sketch was compiled
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
// This line sets the RTC with an explicit date & time, for example to set
// January 21, 2014 at 3am you would call:
rtc.adjust(DateTime(2019, 7, 15, 10, 01, 0));
}
}

void loop () {
DateTime now = rtc.now();

int anneefull = now.year();
int annee= (now.year()-2000);
int mois = now.month();
int jour = now.day();
int heure = now.hour();
int minutes = now.minute();

if (P.displayAnimate())
{
sprintf(joursemaine,daysOfTheWeek[now.dayOfTheWeek()]);
sprintf(jourmois,"%02d/%02d",jour,mois);
sprintf(anneefull,"%02d",anneefull);
sprintf(horaire,"%02d:%02d",heure,minutes);

switch (j) {
case 0:
P.displayText(joursemaine, PA_CENTER, 25 , 2000, PA_DISSOLVE, PA_DISSOLVE);
break;
case 1:
P.displayText(jourmois, PA_CENTER, 25 , 2000, PA_DISSOLVE, PA_DISSOLVE);
break;
case 2:
P.displayText(anneefull, PA_CENTER, 25 , 2000, PA_DISSOLVE, PA_DISSOLVE);
break;
case 3:
P.displayText(horaire, PA_CENTER, 25 , 30000, PA_DISSOLVE, PA_DISSOLVE);
break;
default:
break;
}
j = j + 1;
if (j > 5) j = 0;
}

Serial.print(" (");
Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
Serial.print(") ");
Serial.print(now.day(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.year(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
Serial.print(j);
Serial.println();
}

mardi 9 juillet 2019

Modifier des PDF en ligne

Modifier des PDF en ligne

Vous voulez modifier des PDF (non sensible) mais n'avez pas le droit d'installer des logiciels sur l'ordinateur ?


Voici quelques adresses pour vous aider :

Couper un A3 en A4 en son milieu :

https://www.pdfescape.com/open/

https://www.sejda.com/fr/split-pdf-down-the-middle
Version installable :https://www.sejda.com/desktop

dimanche 7 avril 2019

Arduino Episode 18 : Projet Reveil

Voici un projet qui s'impose à moi,
après un achat sur le bon coin, je me retrouve avec quelques éléments qui ne m'interesse pas vraiment.
-arduino
-matrice 7219
-une horloge temps réel ds3231m


et l'idée à germée.
 Je vais faire un reveil,  juste ajouter un buzzer un tilt et je pourrais faire une horloge qui affiche l'heure, sonne, et s'éteint lorsqu'on lui met la tête en bas.
on pourra toujours changer l'arduino nano par un esp8266 pour le mettre sur Internet.

Voici rapidement les branchements
Max7219 - Nano
VCC - 5V
GND - GND
DIN - PIN 11
CS -  PIN 10
CLK - PIN 13

DS3231M - Nano
VCC - 3V
GND - GND
SCL - SCL or A5
SDA - SDA or A4


Pour la librairie du DS3231M, j'opte pour RTCLib, plus rapide que DS3231M  ou DS3231 ou DS3231F
Il configure l'heure tout seul, l'affiche, et fait meme un test de prévision (ici ca ne marche pas)

2019/4/8 (Monday) 18:10:47
 since midnight 1/1/1970 = 1554714647s = 17994d
 now + 7d + 30s: 2019/4/16 06:40:53

Voici la partie code pour le RTC :
// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include
#include "RTClib.h"

RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {"Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"};

void setup () {

#ifndef ESP8266
  while (!Serial); // for Leonardo/Micro/Zero
#endif

  Serial.begin(9600);

  delay(3000); // wait for console opening

  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }

  if (rtc.lostPower()) {
    Serial.println("RTC lost power, lets set the time!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  }
}

void loop () {
    DateTime now = rtc.now();

    Serial.print(" (");
    Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
    Serial.print(") ");

    Serial.print(now.day(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.year(), DEC);
    Serial.print(' ');
   
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
   
    Serial.print(" Depuis le 1/1/1970 minuit = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
   
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now + TimeSpan(7,12,30,6));
   
    Serial.print(" Maintenant + 7d + 12h + 30minutes +6s: ");
    Serial.print(future.day(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.year(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
   
    Serial.println();
    delay(5000);
}

lundi 1 avril 2019

Arduino Episode 17 : Tilt Module






Rien de bien compliqué sur ce module, le module Tilt est une bille de métal qui fait rentre en contact 2 connecteurs.

Branchements :

NANO <-> Emetteur IR
GND --- Signe -
5V --- Centre (rien de noté)
D3 -- S


Code:

int Led = 13 ;
int Shock = 3 ;
int val ;
void setup ()
{
  pinMode (Led, OUTPUT);
  pinMode (Shock, INPUT);
}
void loop ()
{
  val = digitalRead (Shock);
  if (val == HIGH)
  {
    digitalWrite (Led, LOW);
  }
  else
  {
    digitalWrite (Led, HIGH);
  }
}


lundi 25 mars 2019

Phrases à méditer

-On peut suivre un imbecile mais pas ses idées
-L'arrogance est le miroir de la médiocrité
-Les phrases toutes faites sont faites pour des personnes sans idées.
....

samedi 23 mars 2019

Arduino Episode 16 : Emetteur InfraRouge, InfraRed et TV LG





Voici ce que j'ai trouvé pour commander ma TV LG:

Source:
https://www.kzenjoy.net/2015/votre-telecommande-universelle-grace-a-arduino/


#include <irremote>

IRsend ir_send; // crée une instance

void setup()
{
}

void loop()
{
   ir_send.sendNEC(0x20DFC03F, 32);
   delay(3000);
}

Et voici quelques code pour la Tv LG
ON    20DF10EF
Input    20DFD02F
Vol+     20DF40BF
Vol-    20DFC03F
Mute    20DF906F

Pour le NAD
OFF  E13E13EC
ON   E13EA45B
VOL +   E13E11EE
VOL -    E13E31CE










vendredi 22 mars 2019

SCCM: Configuration Manager vide au niveau des Actions

Si vous aussi trouvez que votre Configuration manager est bien vide.
Voici ce que vous pouvez faire.

1°) Reinstaller le système
2°) Relancer le service
En admin, lancez Services.msc
cherchez
SMS Agent Host ou hote de l'agent SMS
et redémarrez le

En ligne de commande (en admin)
net stop CcmExec
net start CcmExec

ca devrait aller mieux

vendredi 15 mars 2019

Arduino Episode 15 : Emetteur InfraRouge, InfraRed

Pour voir si une LED infrarouge fonctionne, bah, on peut pas voir avec ses yeux, il est recommandé d'utiliser l'appareil photo de son smartphone. Ce que j'ai fait.... ca marchait pas, un code capricieux, je me suis dis je vais brancher le 5V sur la LED pour la faire fonctionner en continu...
(Pour info, à partir de l'iPhone 5, les iPhone filtrent les infrarouges, donc on ne peux pas les voir)

Bon j'ai fait une bêtise, j'ai branché la pate S de ma LED infrarouge  sur le 5V de mon arduino...
un mauvaise odeur et une LED grillé...

J'ai récupéré une vieille télécommande, récupéré la LED et ressoudé à la place de ma LED grillé: youpi ca marche !!!

Branchements :

NANO <-> Emetteur IR
GND --- Signe -
5V --- Centre (rien de noté)
D3 -- S


Code: https://github.com/z3t0/Arduino-IRremote
IRsendDemo:
#include
IRsend irsend;
void setup()
{
}

void loop() {
    for (int i = 0; i < 3; i++) {
        irsend.sendSony(0xa90, 12);
        delay(40);
    }
    delay(5000); //5 second delay between each signal burst
}

jeudi 14 mars 2019

PowerShell GUI et EXE






Vous avez un script Powershell, mais c'est compliqué à utiliser ou il est franchement moche ?

1°)
Il vous faut un interface Graphique ?
Rien de plus simple avec le site POSHGUI: https://poshgui.com/Editor

2°)
Mais j'ai pas d'îcone:
pas de panic, un petit site pour convertir une image en icone:
https://icoconvert.com/

3°)
Et pour changer l'icone en haut de l'interface par un truc plus sympa ?
$Icon = New-Object system.drawing.icon (".\favicon.ico")
$Form.Icon = $Icon 
ou

ajouter une image converti en texte grâce à 
https://websemantics.uk/tools/image-to-data-uri-converter/
Selectionnez Data-URI
Vous obtenez:
Your data-URIs:
// favicon
data:image/x-icon;base64,AAABAAQAQEA...
 Ajoutez dans votre code PowerShell

$iconBase64      = 'AAABAAQAQEAAAAEAIAAoQA....'
$iconBytes       = [Convert]::FromBase64String($iconBase64)
$stream          = New-Object IO.MemoryStream($iconBytes, 0, $iconBytes.Length)
$stream.Write($iconBytes, 0, $iconBytes.Length);
$iconImage       = [System.Drawing.Image]::FromStream($stream, $true)
$Form.Icon       = [System.Drawing.Icon]::FromHandle((New-Object System.Drawing.Bitmap -Argument $stream).GetHIcon())

4°)
Super, une interface graphique, mais c'est toujours aussi laborieux de lancer le script
Pas de problème, il suffit de le convertir EXE
https://gallery.technet.microsoft.com/PS2EXE-Convert-PowerShell-9e4e07f1
Il s'utilise ainsi depuis une console PowerShell:
powershell.exe -command .\ps2exe.ps1 script_a_convertir.ps1 exe_converti.exe -noConsole -iconfile favicon.ico 

Help:
http://vps297246.ovh.net/powershell-transformer-un-script-powershell-en-executable/

vendredi 8 mars 2019

Developpement Web

Voici 15 ans que je ne suis plus l'actualité du developpement WEB

Voici un bref recap de ce que j'ai pu retenir.


HTML (V5) affiche des informations dans le navigateur
CSS organise le côté graphisme
Javascript (VBScript aussi) permet d'interagir avec la page du côté du navigateur
JQuery, uniformise le code javascript independamment du navigateur
AngularJS (Framework) simplifie le JSQUERY et utilise les nouvelles technologies des navigateurs
ReactJS a de meilleurs performances que ANGULAR et limite les interactions avec le DOM (architecture de la page)

Apache dispense les pages côté serveur au navigateur
PHP interagit du côté serveur sur les données à envoyer dans les pages
SQL peut être contacté par PHP pour sortir des données d'une base de donnée
NODEJS, fonctionne comme PHP mais en Javascript côté serveur

jeudi 7 mars 2019

SCCM: forcer la MAJ du centre Logiciel

Votre centre logiciel ne se met pas à jour ?


Allez dans le panneau de configuration, Configuration manager (sous système)
Onglet Action puis selectionnez les actions suivantes:
 
-Récupération de stratégie Ordinateur et Cycle d'évaluation
-Cycle d'inventaire Logiciel
-Cycle d'évaluation du déploiement de l'application
-Dans le centre logiciel faites F5

Source:
https://it.byu.edu/byu/sc_help.do?sysparm_document_key=kb_knowledge,433f66cf4fcc8200aa42d49f0310c79c


  1. Click on Machine Policy Retrieval & Evaluation Cycle and click on "Run Now."
  2. Click on Software Inventory Cycle and click on the  Run Now button.
  3. Click on Application Deployment Evaluation Cycle and click on "Run Now."
  4. The software in Software Center should update shortly.  Pressing on F5 on the keyboard while in the Software Center window will refresh it.
En PowerShell pour la Machine Policy

$sms_client = New-Object -COM 'CPApplet.CPAppletMgr'
$sms_client | gm   
$actions = $sms_client.GetClientActions()
$actions | select Name
$machine_policy = $actions | ?{$_.Name -like "*Machine Policy"}
$machine_policy.PerformAction()

    Outlook, people Pane, Outlook Social Connector 2016, OSC2016, Volets Contacts

    Dans Outlook, vous cherchez en bas de chaque email et Rdv le bandeau avec la photo de vos interlocuteurs mais impossible de mettre la main dessus.

    Ce que vous cherchez c'est un complément d'Outlook, le Outlook Social Connector 2016.
    Allez dans Fichier / Option / Complement / Gérer Complement "COM" puis Atteindre
    et cochez le Outlook Social Connector 2016. (OSC2016)

    Déjà  coché ?
    Dans outlook allez sur la page des emails (pas un email en particulier) et cliquez sur Affichage
    puis Volet de Contact (ou People Pane en Anglais)

    Selectionnez Normal ou Réduit.

    et Voila !

    Acrobat Reader, menu et icone trop grosses

    Acrobat ....

    Les menus sont trop gros ainsi que les îcones ?
    le bouton imprimer n'est accessible Que en utilisant l'ascenseur ?


    Allez dans la base de registre pour modifier la taille d'agrandissement pour le mode tablette.

    FERMER ACROBAT AVANT DE FAIRE LA MANIPULATION DE LA BASE DE REGISTRE

    Pour réduire au format x1
    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\DC\AVGeneral]
    "dDPIScaling"="1.000000"

    Pour mettre en grand au format x1.7
    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\DC\AVGeneral]
    "dDPIScaling"="1.700000"

    Je crois qu'on ne peut pas aller au dela de x2

    lundi 25 février 2019

    API: MDP

    API de mot de passe :(avec la doc)

    Comment ca fonctionne ?

    On appelle l'URL suivante:
    https://www.motdepasse.xyz/api/create/?

    on ajoute les arguments suivant dans l'URL
    &include_digits (pour des chiffres)
    &include_lowercase (pour des lettres minuscules)
    &include_uppercase (pour des lettres majuscules)
    &include_special_characters (pour les caractères spéciaux)
    &add_custom_characters (pour des caractères particuliers
    &exclude_similar_characters (pour retirer les caractères similaire comme i majuscule et l minuscule)
    &password_length (pour la longueur du mdp)

    &quantity (pour la quantité de mdp demandé)


    Exemple:
    https://www.motdepasse.xyz/api/create/?include_digits&password_length=6&quantity=1
    {"passwords":["638275"],"response_date_time":"2019-02-25T17:42:34+01:00","api_version":"1.2","api_last_update_date":"2018-12-03"}

    vendredi 22 février 2019

    Arduino Episode 14 : Tiny RTC Module (Real Time Clock) Horloge temps réel

    Arduino Episode 14 : Tiny RTC Module (Real Time Clock) Horloge temps réel

    1er problème, je n'ai pas de broche et de kit de soudure pour tester le matériel.
    J'utilise alors des câbles durant glissé dans les trous sans être retenu, et calé sur le bureau sans le bouger, le résultat fonctionne directement.
    Attention aux achats car je vais devoir souder ceci pour que ce soit pérènne.

    Branchements :

    On pourra déjà remarquer que nous avons 2 serie de brochage
    A gauche, DS, SCL, SDA, VCC, GND
    A droite , SQ,DS, SCL, SDA, VCC, GND, BAT

    A gauche pour être branché directement à un arduino
    A droite pour être branché en plus qu'a gauche en arduino, sur un autre périphérique IC2 (ici pas utile)


    NANO <-> Tiny RTC
    GND --- GND
    5V --- VCC
    A4 --- SDA
    A5 --- SCL

    Code: 
    Croquis, Inclure une Bibliothèque, Gerer les bibliothèques, "RTClib" by Adafruit
    https://github.com/adafruit/RTClib
    Fichier; exemple, RTClib, DS1307

    Résultat:
    Dans la console COM à 57600bauds :
    2019/2/22 (Friday) 16:2:5
     since midnight 1/1/1970 = 1550851325s = 17949d
     now + 7d + 30s: 2019/3/2 4:32:11



    Sources:
    https://www.elecrow.com/wiki/index.php?title=Tiny_RTC
    https://www.hobbyist.co.nz/?q=real_time_clock 
    https://www.youtube.com/watch?v=OmVoR3mTP00

    mardi 19 février 2019

    Arduino Episode 13 : recepteur InfraRouge, InfraRed


    Arduino Episode 13 : recepteur InfraRouge, InfraRed  

    Branchements :

    NANO <-> Recepteur IR
    GND --- Signe -
    5V --- Centre (rien de noté)
    D11 -- S


    Code: https://github.com/z3t0/Arduino-IRremote (IRrecvDemo)

    #include < boarddefs.h >
    #include <irremote .h>
    #include <irremoteint .h>
    #include <ir_lego_pf_bitstreamencoder .h>

    int RECV_PIN = 11;
    IRrecv irrecv (RECV_PIN);
    decode_results results;
    void setup ()
    {
    Serial.begin (9600);
    irrecv.enableIRIn ();
    }
    void loop () {
    if (irrecv.decode (& results)) {
    Serial.println (results.value, HEX);
    irrecv.resume ();
    }
    }

    Arduino Episode 12 : Faisceau LASER (ky-008)

     

    Arduino Episode 12 : Faisceau LASER (KY-008)

    Branchement:
    NANO <-> <-->Laser
    GND --- au moins
    5V --- centre (sans annotation)
    D8 -- S

    Code: (rien de plus qu'allumer le LASER)

    const int Laser=8;
    void setup() {
       pinMode(Laser,OUTPUT);
      digitalWrite(Laser,HIGH);
    }

    void loop() {
    }

    Si vous ne voulez qu'un laser sans code :

    Branchement:
    NANO <-->Laser
    GND --- au moins
    3.3V --- S

    lundi 18 février 2019

    Arduino Episode 11 : Bouton Poussoir et 433






    Branchements Emetteur:

    NANO1 <-> Emetteur
    GND --- GND
    5V --- VCC
    D10 -- DATA

    NANO1 <-> Emetteur
    D2 --- une PIN du bouton d'un côté
    GND --- 'autre PIN du bouton du même côté

    Branchements Recepteur:

    NANO2 <-> 433 recepteur
    GND --- GND
    DATA --- D2 (pour l'interruption)
    5V --- VCC


    Code Emetteur:


    #include
    #include
    RCSwitch mySwitch = RCSwitch();


    void setup() {
      // Transmitter is connected to Arduino Pin #10 
      mySwitch.enableTransmit(10);
     
      pinMode(2, INPUT_PULLUP);
      pinMode(LED_BUILTIN, OUTPUT);
      attachInterrupt(0,balance,RISING);
    }

    void loop() {
    LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
      }


    void balance()
    {

      digitalWrite(LED_BUILTIN, HIGH);
      mySwitch.send(5396, 24);
      delay(1000); 
      digitalWrite(LED_BUILTIN, LOW);
      }

     

    Code Recepteur : (identique à la bibliothèque RC-SWITCH)

    /*
      Example for receiving
     
      https://github.com/sui77/rc-switch/
     
      If you want to visualize a telegram copy the raw data and
      paste it into http://test.sui.li/oszi/
    */

    #include

    RCSwitch mySwitch = RCSwitch();

    void setup() {
      Serial.begin(9600);
      mySwitch.enableReceive(0);  // Receiver on interrupt 0 => that is pin #2
    }

    void loop() {
      if (mySwitch.available()) {
        output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
        mySwitch.resetAvailable();
      }
    }

    mardi 5 février 2019

    API: API

    Voici une liste d'API si cela peut vous aider:

    Qualité alimentaire:

    https://fr.openfoodfacts.org/data

    ISS:
    http://api.open-notify.org/

    FlickR(service photo)
    https://www.flickr.com/services/api/ 

    Produites Cosmetiques:
    http://fr.openbeautyfacts.org/data

    Centrale d'API:
    https://public.opendatasoft.com/

    Enedis:
    https://data.enedis.fr/explore/?sort=modified 

    Alertes MeteoFrance
    https://public.opendatasoft.com/explore/dataset/risques-meteorologiques-copy/custom/?location=6,46.44209,2.21031&basemap=jawg.streets

     INSEE : Base SIRENE
    https://api.insee.fr

    SNCF:
    https://data.sncf.com/api

    STIF:
    https://opendata.stif.info/page/home/

    TRANSDEV
    https://data.iledefrance.fr/explore/dataset/arrets-par-lignes-de-transport-en-commun-en-ile-de-france/api/

     OpenWeatherMap:
    https://home.openweathermap.org/api_keys

    Informations Géographiques:
    http://restcountries.eu/

     Capitale:
    https://restcountries.eu/rest/v2/capital/paris

    Indicatif téléphonique:
    https://restcountries.eu/rest/v2/callingcode/372

    Langue:
    https://restcountries.eu/rest/v2/lang/fr

    Photo de chat rigolo
    https://aws.random.cat/meow

    SMS (TWILIO payant)
    https://www.twilio.com/console

    Recherche QWANT:
        https://api.qwant.com/egp/search/web?count=30&q=.php?id=&offset=10

        count = nombre de résultat
        q = le terme recherché
        offset = nombre de resultat par page
     


    API: ISS

    API et ISS,

    Voici en 3 liens des API qui peuvent être utiles:

    Pour connaître les astronautes à bord de l'ISS:
    http://api.open-notify.org/astros.json

    La localisation actuelle de l'ISS
    http://api.open-notify.org/iss-now.json

    Le temps avant le prochain passage à un emplacement donnée:
    http://api.open-notify.org/iss-pass.json?lat=45.0&lon=-122.3
    pour trouver l'emplacement:
    http://www.satsig.net/maps/lat-long-finder.htm
    exemple : chateau de Versailles :
    Latitude = 48.8103, Longitude = 2.0998
    http://api.open-notify.org/iss-pass.json?lat=48.8103&lon=2.998

    RiseTime: à convertir avec ce type d'outil pour obtenir une date
    http://www.timestamp.fr/?


    Et d'autres outils sur le sujet :

    Site directe pour voir la localisation:
    http://open-notify.org/Open-Notify-API/
    http://www.isstracker.com/
    https://www.cite-espace.com/actu-spatiale/en-direct-de-lespace/ou-est-la-station/


    Les Webcams de l'ISS:
    http://www.ustream.tv/embed/9408562?html5ui?v=3&controls=false&autoplay=true
    http://www.ustream.tv/embed/17074538?v=3&controls=false&autoplay=true
    https://iss.destination-orbite.net/live.php

    lundi 28 janvier 2019

    PowerShell et PC distant






    Il faut être Administrateur de la machine distante !


    c: 
    start powershell -credential ""
    ou 
    start powershell -credential "domain\username" 



    Avoir les process en cours sur un PC Distant
    get-process -computername NOM_PC

    Killer un Process avec son Nom sur un PC Distant
    (Get-WmiObject Win32_Process -ComputerName NOM_PC | ?{ $_.ProcessName -match "NOM_PROCESS" }).Terminate()

    Killer un Process avec son ID sur un PC DISTANT
    (Get-WmiObject Win32_Process -ComputerName NOM_PC | where{$_.ProcessId -eq "4772" }).Terminate()

    Changer le type de demarrage d'un service en Auto sur un PC DISTANT
    Set-Service -name remoteregistry -ComputerName NOM_PC -startuptype "auto"

    Démarrer un service sur un PC Distant
    (Get-Service -ComputerName NOM_PC -Name "RemoteRegistry").Start()

    jeudi 24 janvier 2019

    Arduino Episode 10 : Bouton Poussoir

    Arduino Épisode 10 : Bouton Poussoir
    Quoi de plus simple qu'un bouton poussoir.Et bah non !
    Pour des raisons de retour d’électricité et avoir un comportement cohérent avec ce que l'on veut, il faut utiliser une résistance, mais je n'en n'ai pas sous la main.
    Il y a une fonction qui utilise une résistance intégré:
    INPUT_PULL UP
    seulement le résultat est inversé
    retourne 1 si non appuyé et
    retourne 0 si appuyé.
    d'où le changement d'état par la ligne etatBouton = !etatBouton
    (Voir le résultat dans la console Série en 9600 baud)

    Branchements:

    NANO <-> Bouton
    GND --- une PIN du bouton d'un côté
    D10 --- l'autre PIN du bouton du même côté


    Code: 


    int pinBouton;

    void setup() {
      Serial.begin(9600);
      pinBouton = 10;
      pinMode(pinBouton, INPUT_PULLUP);
    }

    void loop() {
      boolean etatBouton = digitalRead(pinBouton);
      etatBouton = !etatBouton;
      Serial.println(etatBouton);
    }

    et pour allumer la LED interne :

    void setup() {
      Serial.begin(9600);
      pinMode(10, INPUT_PULLUP);
      pinMode(LED_BUILTIN, OUTPUT);
    }

    void loop() {
      boolean etatBouton = digitalRead(10);
      etatBouton = !etatBouton;
      digitalWrite(LED_BUILTIN, etatBouton);
      Serial.println(etatBouton);
    }

    mercredi 16 janvier 2019

    Météo et API





    Voici mon retour sur l'utilisation d'une API: OpenWeatherMap
    Une API qui permet d'obtenir les informations météorologiques.

    1°) Se connecter

    2°) Demander une Clef
    3°) Trouver sa localisation

    4°) Creer sa requete

    5°) Le code


    1°) Se connecter
    https://home.openweathermap.org/users/sign_up
    Créer un compte c'est rapide et gratuit (sur ce que l'on veux faire) 

    2°) Demander une Clef
     Se connecter avec son compte et demander une Clef:
    https://home.openweathermap.org/api_keys
    (32 Hexas)

    3°)Trouver sa localisation:
    On télécharge le fichier suivant: http://bulk.openweathermap.org/sample/city.list.json.gz
    On le dézippe et ouvre le fichier avec excel (Oui quand même l'ouvrir)
    Ctrl-F, on cherche PARIS, on reprend le code juste au dessus: 6455259

    4°) Creer sa requete
    Une fois la requête créer il ne restera plus qu'a la mettre dans le navigateur

    Voici le début de la requête :
    http://api.openweathermap.org/data/2.5/weather

    Ensuite on cherche la localisation  (voir paragraphe 3)
    ?id=6455259

    Ici on ajoute la clef (voir paragraphe 2)
    &APPID=1234567890abcdef1234567890abcdef

    Ici on choisi la langue
    &lang=fr

    Ici les unités (Farenheit ou Celcius)
    &units=metric


    5°) Le code
    C'est en regardant la vidéo de Anthony Welc que j'ai voulu reproduire ce qu'il avait fait et l'adapter à mon tour.

    https://www.youtube.com/watch?v=nop5geuxP3s

    Voici mon code: (sans ma clef ou ma localisation)



    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>API Meteo</title></head>
    <body>
    https://www.youtube.com/watch?v=nop5geuxP3s
    exemple Requete:<br>


    <script>
    window.fetch('http://api.openweathermap.org/data/2.5/weather?id=6444014&APPID=18dd96c0cfb2f065d69889c070e03ee4&lang=fr&units=metric')
    .then(res => res.json())

    .then(resJson => {

    document.write(resJson.name);
    document.write("<br>");
    document.write(resJson.weather[0].description);

    document.write("<br>min: "+ resJson.main.temp_min + " max: " + resJson.main.temp_max + " now: " + resJson.main.temp);
    document.write("<br>Humidite: " + resJson.main.humidity);

    heureleve=new Date(resJson.sys.sunrise*1000)
    heurecouche=new Date(resJson.sys.sunset*1000)
    document.write("<br>");
    document.write("Leve: "+ heureleve.toLocaleTimeString('fr-FR') + " Couche: " + heurecouche.toLocaleTimeString('fr-FR'));
    })

    //console.log(window.navigator);
    </script>
    </body>
    </html>

    lundi 14 janvier 2019

    Windows 10, changer le comportement de la touche CapLock

    Voici rapidement comment créer un lien vers la configuration des touches CAPLOCK et MAJ (Shift)

    Créer un raccourcis avec ceci dedans :

    C:\Windows\System32\rundll32.exe Shell32.dll,Control_RunDLL input.dll,,{C07337D3-DB2C-4D0B-9A93-B722A6C106E2}

    Et pour atteindre le bon onglet directement :

    C:\Windows\System32\rundll32.exe Shell32.dll,Control_RunDLL input.dll,,{C07337D3-DB2C-4D0B-9A93-B722A6C106E2}{HOTKEYS}

    mardi 8 janvier 2019

    Arduino Episode 9 : NFC (PN532 + LCD)





    Projet sympa et presque complétement abouti.

    Ici, un lecteur de tag NFC connecté sur un Arduino Nano + écran LCD pour afficher l'UID du tag (en Hexa, en Décimal et en mode MSB (reverse HEXA ou reverse Decimal).

    Branchements:

    NANO - LCD ou PN532
    GND -- (LCD) GND

    5V -- (LCD) VCC
    A5-- (LCD) SCL
    A4-- (LCD) SDA

    3V3-- (PN532) 5V

    GND --(PN532) GND
    D9 -- (PN532) (non connecté)
    D10 -- (PN532) SCL
    D11 -- (PN532) MOSI
    D12 -- (PN532) MISO
    D13 -- (PN532) SCK

    La boite :
    -Une boite en carton
    -une ouverture pour l'écran (tient tout seul)
    -une ouverture pour le cable d'alimentation
    -le lecteur NFC fixé à la paroi avant de la boite
    et le reste (cables, arduino, rallonge de cable USB) jeté en vrac


    Code: 
    #include <Wire.h>
    #include <SPI.h>
    #include <Adafruit_PN532.h>
    #include <LiquidCrystal_I2C.h>
    #include <RCSwitch.h>

    RCSwitch mySwitch = RCSwitch();
    LiquidCrystal_I2C lcd(0x27, 20, 4);

    // If using the breakout with SPI, define the pins for SPI communication.
    #define PN532_SCK (13)
    #define PN532_MOSI (12)
    #define PN532_SS (10)
    #define PN532_MISO (11)

    // If using the breakout or shield with I2C, define just the pins connected
    // to the IRQ and reset lines. Use the values below (2, 3) for the shield!
    #define PN532_IRQ (2)
    #define PN532_RESET (3) // Not connected by default on the NFC Shield

    // Uncomment just _one_ line below depending on how your breakout or shield
    // is connected to the Arduino:

    // Use this line for a breakout with a SPI connection:
    //Adafruit_PN532 nfc(PN532_SCK, PN532_MISO, PN532_MOSI, PN532_SS);

    // Use this line for a breakout with a hardware SPI connection. Note that
    // the PN532 SCK, MOSI, and MISO pins need to be connected to the Arduino's
    // hardware SPI SCK, MOSI, and MISO pins. On an Arduino Uno these are
    // SCK = 13, MOSI = 11, MISO = 12. The SS line can be any digital IO pin.
    Adafruit_PN532 nfc(PN532_SS);

    // Or use this line for a breakout or shield with an I2C connection:
    //Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);

    void setup(void) {
    Serial.begin(115200);
    Serial.println("Hello!");

    lcd.init();

    nfc.begin();

    uint32_t versiondata = nfc.getFirmwareVersion();
    if (! versiondata) {
    Serial.print("Didn't find PN53x board");
    while (1); // halt
    }

    // Got ok data, print it out!
    Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX);
    Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC);
    Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);

    // Set the max number of retry attempts to read from a card
    // This prevents us from waiting forever for a card, which is
    // the default behaviour of the PN532.
    nfc.setPassiveActivationRetries(0xFF);

    // configure board to read RFID tags
    nfc.SAMConfig();

    Serial.println("Waiting for an ISO14443A card");
    lcd.backlight();
    }

    void loop(void) {
    boolean success;
    uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; // Buffer to store the returned UID
    uint8_t uidLength; // Length of the UID (4 or 7 bytes depending on ISO14443A card type)

    lcd.clear();
    lcd.setCursor(5,1);
    lcd.print("DISPONIBLE");
    lcd.setCursor(5,2);
    lcd.print("==========");



    // Wait for an ISO14443A type cards (Mifare, etc.). When one is found
    // 'uid' will be populated with the UID, and uidLength will indicate
    // if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)
    success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);

    if (success) {

    Serial.println("Found a card!");
    Serial.print("UID Length: ");Serial.print(uidLength, DEC);Serial.println(" bytes");
    String cardIDH = "";
    String cardIDRH = "";
    uint32_t cardIDD;
    uint32_t cardIDRD;


    for (uint8_t i=0; i < uidLength; i++)
    {
    //Serial.print(" 0x");Serial.print(uid[i], HEX);
    cardIDH += String(uid[i], HEX);
    cardIDRH = String(uid[i], HEX) + cardIDRH;

    cardIDRD += (uint32_t) uid[i] << (i*8);
    cardIDD += (uint32_t) uid[int(uidLength)-i-1] << (i*8);

    }

    //cardIDD = (uint32_t) uid[3] << 0 | (uint32_t) uid[2] << 8 | (uint32_t) uid[1] << 16 | (uint32_t) uid[0] << 24;
    //cardIDRD = (uint32_t) uid[0] << 0 | (uint32_t) uid[1] << 8 | (uint32_t) uid[2] << 16 | (uint32_t) uid[3] << 24;

    Serial.println("");
    Serial.print("UID HexaDecimal : ");Serial.println(cardIDH);
    Serial.print("UID Reverse HexaDecimal : ");Serial.println(cardIDRH);
    Serial.print("UID Decimal : ");Serial.println(cardIDD);
    Serial.print("UID Reverse Decimal : ");Serial.println(cardIDRD);
    Serial.println("");Serial.println("");

    lcd.clear();

    lcd.setCursor(0,0);
    lcd.print("HEX :"+cardIDH);

    lcd.setCursor(0,1);
    lcd.print("DEC :");
    lcd.setCursor(5,1);
    lcd.print(cardIDD);

    lcd.setCursor(0,2);
    lcd.print("RHEX:"+cardIDRH);

    lcd.setCursor(0,3);
    lcd.print("RDEC:");
    lcd.setCursor(5,3);
    lcd.print(cardIDRD);

    // Wait 1 second before continuing
    delay(10000);
    lcd.clear();
    }
    else
    {
    // PN532 probably timed out waiting for a card
    Serial.println("Timed out waiting for a card");
    }
    }


    .