From 86b8708e25ba4d258721ae6ddaf1cd9af84b5825 Mon Sep 17 00:00:00 2001 From: Vieira Date: Mon, 28 Mar 2022 15:12:08 +0200 Subject: [PATCH] Grosse session de travail --- APL1.2/SCR1.2/TP13/reponsestp13.txt | 4 +- APL1.2/SCR1.2/TP14/reponses.txt | 31 ++++++++++++++ APL1.2/SCR1.2/TP14/traceroute-trace.txt | 0 APL2.1/TP4/Date/Testdate.class | Bin 923 -> 923 bytes APL2.1/TP4/Date/Testdate.java | 2 +- APL2.1/TP4/Lendemain/Lendemain.java | 2 +- APL2.1/TP5/Grisaille/Grisaille.java | 8 ++++ APL2.1/TP5/Grisaille/TestGrisaille.java | 19 +++++++++ APL2.1/TP6/Acceuil/Accueil.class | Bin 0 -> 1648 bytes APL2.1/TP6/Acceuil/Accueil.java | 52 ++++++++++++++++++++++++ APL2.1/TP6/Acceuil/Accueil_test.java | 18 ++++++++ APL2.1/TP7/Moyenne/Main.java | 0 APL2.1/TP7/Moyenne/Moyenne.java | 13 ++++++ 13 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 APL1.2/SCR1.2/TP14/reponses.txt create mode 100644 APL1.2/SCR1.2/TP14/traceroute-trace.txt create mode 100644 APL2.1/TP5/Grisaille/Grisaille.java create mode 100644 APL2.1/TP5/Grisaille/TestGrisaille.java create mode 100644 APL2.1/TP6/Acceuil/Accueil.class create mode 100644 APL2.1/TP6/Acceuil/Accueil.java create mode 100644 APL2.1/TP6/Acceuil/Accueil_test.java create mode 100644 APL2.1/TP7/Moyenne/Main.java create mode 100644 APL2.1/TP7/Moyenne/Moyenne.java diff --git a/APL1.2/SCR1.2/TP13/reponsestp13.txt b/APL1.2/SCR1.2/TP13/reponsestp13.txt index 6d65bb2..ad70390 100644 --- a/APL1.2/SCR1.2/TP13/reponsestp13.txt +++ b/APL1.2/SCR1.2/TP13/reponsestp13.txt @@ -20,5 +20,7 @@ II) 6)tshark -i eno1 -f "host____ and host____" III) -1) +1) tcpdump -i lo | tee log.txt + ping -c 1 -s 9216 172.16.2.44 + 2) diff --git a/APL1.2/SCR1.2/TP14/reponses.txt b/APL1.2/SCR1.2/TP14/reponses.txt new file mode 100644 index 0000000..e567e24 --- /dev/null +++ b/APL1.2/SCR1.2/TP14/reponses.txt @@ -0,0 +1,31 @@ +Rappel 1 : L’utilitaire tcpdump permet de visualiser le trafic sur le r ́eseau. Il donne une description +du contenu des paquets sur une interface r ́eseau. Cet utilitaire est un standard de toutes +les installation Linux. Son utilisation est, par d ́efaut, r ́eserv ́e `a l’utilisateur root. + +Rappel 2 : L’application graphique wireshark permet aussi de d ́ecrire le trafic sur un r ́eseau ; tshark +en est la version ligne de commande. + +tar cvzf archive.targz DIR/* +désarchiver : tar xvf devoir.tar + tar xvzf devoir.tar.gz +2> /sev/null renvoie les erreurs dans un fichier "poubelle" +I - +1) Premiere commande pour servir de server, ncat -lu 50000, pour communiquer avec, ncat -u 127.0.0.1 5000. +2) dd if=/dev/zero of=qft-file.dat count=18 + +3) ncat -u 172.0.0.1 50000 < ft-file.dat +ncat -l -u 50000 +non, il n'y a pas de fragmentation --> il faut regarder les champs de l'en-tête IP relatif à la fragmentation. identification,flag mf est-il levé ou pas ? lo : MTV 65536 > 9216 +4)-t pour supprimer l'affichage des temps timestamp +b)il suffit de ne pas ajouter l'option -e +c)(-n) pour numeric +-v, -vv, -vvv plus de tails fournis +5) -F +II - +2) tcpdump -vvv eno1 host 172.16.2.45 > traceroute-trace.txt +3) +4) +a) +b) +c) +d) diff --git a/APL1.2/SCR1.2/TP14/traceroute-trace.txt b/APL1.2/SCR1.2/TP14/traceroute-trace.txt new file mode 100644 index 0000000..e69de29 diff --git a/APL2.1/TP4/Date/Testdate.class b/APL2.1/TP4/Date/Testdate.class index 578e2858f660adb03804f7468988162180bb0515..7bb447f16aa1c8f7fd88b15b8ed2ebb2800b9397 100644 GIT binary patch delta 13 UcmbQuKAU}m2{R+xWK-re02+@2WB>pF delta 13 UcmbQuKAU}m2{R+>WK-re02+z|V*mgE diff --git a/APL2.1/TP4/Date/Testdate.java b/APL2.1/TP4/Date/Testdate.java index 41ca44b..4554107 100644 --- a/APL2.1/TP4/Date/Testdate.java +++ b/APL2.1/TP4/Date/Testdate.java @@ -1,6 +1,6 @@ public class Testdate { public static void main(String[] args) { - Date date = new Date(8,2,2022); + Date date = new Date(8,3,2022); Date date2 = new Date(31, 1, 2022); System.out.println("Date du jour : " + date); diff --git a/APL2.1/TP4/Lendemain/Lendemain.java b/APL2.1/TP4/Lendemain/Lendemain.java index 4faa48b..a9dff91 100644 --- a/APL2.1/TP4/Lendemain/Lendemain.java +++ b/APL2.1/TP4/Lendemain/Lendemain.java @@ -1,6 +1,6 @@ public class Lendemain { public static void main(String[] args) { - Date date = new Date(8,2,2022); + Date date = new Date(8,3,2022); System.out.println("Date du jour : " + date); date.Lendemain(); System.out.println("Date du lendemain : " + date); diff --git a/APL2.1/TP5/Grisaille/Grisaille.java b/APL2.1/TP5/Grisaille/Grisaille.java new file mode 100644 index 0000000..6f1c0da --- /dev/null +++ b/APL2.1/TP5/Grisaille/Grisaille.java @@ -0,0 +1,8 @@ +import java.awt.Color; + +public class Grisaille extends Color{ + + public Grisaille(int greyByte){ + super(greyByte, greyByte, greyByte, 255); + } +} \ No newline at end of file diff --git a/APL2.1/TP5/Grisaille/TestGrisaille.java b/APL2.1/TP5/Grisaille/TestGrisaille.java new file mode 100644 index 0000000..eb9a7f8 --- /dev/null +++ b/APL2.1/TP5/Grisaille/TestGrisaille.java @@ -0,0 +1,19 @@ +import javax.swing.*; +import java.awt.*; + +public class testGrisaille{ + + public static void main(String[] args){ + JFrame fenetre = new JFrame(); + fenetre.setSize(800,800); + fenetre.setLocation(5,5); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JPanel button = new JPanel(); + button.setBackground(new Grisaille(100)); + fenetre.add(button,BorderLayout.CENTER); + + fenetre.setVisible(true); + } + +} \ No newline at end of file diff --git a/APL2.1/TP6/Acceuil/Accueil.class b/APL2.1/TP6/Acceuil/Accueil.class new file mode 100644 index 0000000000000000000000000000000000000000..6f1a7ac25904bfbb59b88e3ea1193e2b829f9d5c GIT binary patch literal 1648 zcmZ8hYf~Fl7=D%nHd(f5HU&~zda+g;5+H4{R!c9oLE2OTN)QCREy*Dq*zCs5rd0jr zjGz718AtzwGrBl3;}7sp_(vSa=Ok&8nwh-&UZ3;c&iU)#KmG)88+8M(;ktnvxEaH| z`o0xM8n+DO@U}tjwj%E+@m*kT2Hlnpn^< za#y-CxUV6SncmP4EqGO-;q#d0a5D=Rv|l`7{_*N`EuY(x7H3Z%3jN_h$X2`G9OkdEg_vb zm8*%Xctgjsi4sGXtyAF{?dMnQqEzz-AJ*$W5iCaS_rP*dU+sJH4J zLwW$Xw+QVm9i{8CSFrViD&DP&>Mk?J`HE z#Uvtjm2J!p`1E#UVPMLAr3QoG8?q_emou8#p5EXSl;$7MFr@ATxd?gQAJR7|-Dt~z zl|6=*{T)N8NQmff82+Ulbd5AY7a)!(3?wniZwAxdaEalzHJ=MHQp$$Vf5hYrzp)VU znMj13!T)Fob0+&MhTED`n+kjg3j7>KNKX?c36n3}7*fo0409MqmX;W_e{eNopUL+?&T*}Q3nD0a%53fq+goAv4!wNV a{4KljJ@WX05if8PKVhDIm?P#8^8W#k8+PFU literal 0 HcmV?d00001 diff --git a/APL2.1/TP6/Acceuil/Accueil.java b/APL2.1/TP6/Acceuil/Accueil.java new file mode 100644 index 0000000..771f9ce --- /dev/null +++ b/APL2.1/TP6/Acceuil/Accueil.java @@ -0,0 +1,52 @@ +import javax.swing.*; +import java.awt.*; + +public class Accueil extends JComponent{ + + private Image logScreen; + + public Accueil(){ + super(); + this.logScreen = Toolkit.getDefaultToolkit().getImage("logScreen.jpg"); + } + + @Override + protected void paintComponent(Graphics pinceau){ + Graphics secondPinceau = pinceau.create(); + if (this.isOpaque()){ + secondPinceau.setColor(this.getBackground()); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + secondPinceau.drawImage(this.logScreen,0,0, this); + } + + public static void main(String[] args){ + + + JFrame fenetre = new JFrame(); + + fenetre.setSize(295, 223); + fenetre.setMinimumSize(new Dimension(295, 223)); + fenetre.setLocation(100, 100); + fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + fenetre.setLayout(null); + + + Accueil login = new Accueil(); + login.setLocation(0,0); + login.setSize(278,183); + fenetre.add(login); + + JTextField loginArea = new JTextField(); + loginArea.setLocation(110, 90); + loginArea.setSize(150, 25); + fenetre.add(loginArea); + + JTextField passwordArea = new JTextField(); + passwordArea.setLocation(110, 130); + passwordArea.setSize(150, 25); + fenetre.add(passwordArea); + + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/APL2.1/TP6/Acceuil/Accueil_test.java b/APL2.1/TP6/Acceuil/Accueil_test.java new file mode 100644 index 0000000..d51b677 --- /dev/null +++ b/APL2.1/TP6/Acceuil/Accueil_test.java @@ -0,0 +1,18 @@ +import java.lang.*; + +public class Accueil_test extends JPanel{ + private Image menuAcc; + public Accueil_test(){ + super(); + this.menuAcc = Toolkit.getDefaultToolkit().getImage("menuAcc.jpg"); + } + @Override + protected void paintComponent(Graphics pinceau){ + Graphics secondPinceau = pinceau.create(); + if (this.isOpaque()){ + secondPinceau.setColor(this.getBackground()); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + secondPinceau.drawImage(this.menuAcc,0,0, this); + } + } \ No newline at end of file diff --git a/APL2.1/TP7/Moyenne/Main.java b/APL2.1/TP7/Moyenne/Main.java new file mode 100644 index 0000000..e69de29 diff --git a/APL2.1/TP7/Moyenne/Moyenne.java b/APL2.1/TP7/Moyenne/Moyenne.java new file mode 100644 index 0000000..d8c8bb2 --- /dev/null +++ b/APL2.1/TP7/Moyenne/Moyenne.java @@ -0,0 +1,13 @@ + public class Moyenne { + int numberOfNumber; + double total; + public Moyenne(){ + } + double public getAverage(){ + return this.numberOfNumber/this.total; + } + void public add(Number newNumber){ + this.numberOfNumber++; + this.total+= newNumber.doubleValue(); + } +}