Skip to main content

Posts

Showing posts with the label WSC

how to use redis as flask session storage

  Im this tutorial we simply configured redis locally through docker. We can easily configure it with the command below.   $ docker pull redis:latest $ docker run -d -p 6379:6379 --name session_storage redis:latest We can check the status of the redis container by entering the command below. $ docker ps CONTAINER ID     Below is a simple web application that uses Python flask to store and retrieve information in sessions.    import redis from flask import * from flask_session import Session app = Flask(__name__) app.secret_key = 'Skills39Test' app.config['SESSION_TYPE'] = 'redis' app.config['SESSION_PERMANENT'] = False app.config['SESSION_USE_SIGNER'] = True app.config['SESSION_REDIS'] = redis.from_url('redis://localhost:6379') server_session = Session(app) @app.route('/info', methods=['GET','POST']) def set():     if request.method == 'GET':         username = session['username']        

Soal dan Pembahasan LKS ITNSA SMK

Berikut adalah ringkasan pembahasan dari soal-soal LKS SMK bidang IT Network Systems Administration, soal-soal untuk LKS SMK biasanya turunan dari soal-soal internasional atau WorldSkills Competition. Untuk pembahasan kali ini tidak spesifik mengenai case tertentu, melainkan memberikan pandangan secara umum jenis-jenis soalnya. Sehingga ketika ada soal tersebut keluar bisa menyesuaikan seperti penamaan, IP, domain, dan variabel-variabel lainnya. Pada kesempatan kali ini akan membahas tentang PPPoE di Cisco Untuk teori PPPoE ( https://en.wikipedia.org/wiki/Point-to-Point_Protocol_over_Ethernet ) soal seperti dibawah ini pernah muncul di WSC2017, LKS 2019, dan muncul kembali di WorldSkills SE 2022 dengan metode auth CHAP dan Radius. Untuk kali ini akan membahas soal seperti berikut: Configure ISP router as PPPoE server and BR3 router as PPPoE Client. Use PAP for authentication with cisco/cisco for the credentials. Ringkasan Jawaban: PPPoE Server (ISP) !ISP 1. ip local pool BR3 20.17.5.1

Belajar Dasar FastAPI

  FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.7+ based on standard Python type hints. Install framework pip install fastapi You will also need an ASGI server, for production such as  Uvicorn  or  Hypercorn . pip install "uvicorn[standard]" Create a file  main.py  with: from typing import Union from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} Run the server with: uvicorn main:app --reload

Pembahasan LKS WSC ITNSA How to Create a User

Pembahasan ini bersifat secara umum tidak specific menyelesaikan suatu case, silakan disesuaikan seperti nama domain, user, group, koneksi, dll. sebelum untuk cara install ldap https://sa-bagus.blogspot.com/2022/10/lks-wsc-itnsa-how-to-install-openldap.html membuat Organization Unit dan Group untuk menampung user, dalam hal ini misalnya Organization Unit nya: ITNSA Group: ITNSA-LINUX dn: ou=ITNSA,dc=bagussa,dc=local objectClass: organizationalUnit ou: People dn: ou=ITNSA-LINUX,dc=bagussa,dc=local objectClass: organizationalUnit ou: Groups Simpan file diatas dengan nama misal add-ou-and-group.ldif kemudian masukkan ke ldap server dengan perintah berikut: ldapadd -x -D cn=admin,dc=bagussa,dc=local -W -f add-ou-and-group.ldif untuk membuat user bisa menggunakan perintah ldapscripts apt-get install ldapscripts sesuikan konfigurasi di /etc/ldapscripts/ldapscripts.conf bagian-bagian berikut: SERVER=ldap://ldap.bagussa.local BINDDN='cn=admin,dc=bagussa,dc=local' BINDPWDFILE="/et

Pembahasan LKS WSC ITNSA How to Install Openldap

 Di tutorial kali ini: OS: Debian 11 Nama paket: Slapd, ldap-utils, sudo cara install: apt-get install slapd ldap-utils sudo Masukkan password untuk Ldap server nya di Debian 11, sudo diperlukan untuk menjalankan command slapcat, dpkg-reconfigure slapd Setelah terinstall dengan cara diatas maka selanjutnya kita perlu melakukan konfigurasi 1. Konfigurasi nama domain local /etc/hosts 192.168.1.1  ldap.bagussa.local dengan konfigurasi diatas maka ldap server bisa mengerti nama domain nya ke IP address server ldap. 2. Konfigurasi dengan dpkg-reconfigure slapd sudo dpkg-reconfigure slapd Pilih Tidak ketika diminta untuk menghapus/menghilangkan konfigurasi OpenLDAP lama. Ini akan membuat konfigurasi lama tetap tersedia. Sekarang masukkan nama domain lokal DNS untuk server OpenLDAP Anda dan pilih OK. Masukkan nama organisas i dan pilih OK. Secara opsional, Anda dapat membiarkannya sebagai default dengan nama yang sama dengan nama domain. Sekarang masukkan kata sandi administrator OpenLDAP d

WorldSkills Competition Skill53 Cloud Computing Preparation

Install AWS-CLI  https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html 1. Create a VPC aws ec2 create-vpc --cidr-block 172.16.0.0/16 2. Create three subnets Subnet LB 172.16.0.0/24 Subnet A 172.16.1.0/24 Subnet B 172.16.2.0/24 nasohi@DESKTOP-EQC1K12 : ~ $ aws ec2 create-subnet --vpc-id vpc-007283a0796292c04 --cidr-block 172.16.0.0/24 nasohi@DESKTOP-EQC1K12 : ~ $ aws ec2 create-subnet --vpc-id vpc-007283a0796292c04 --cidr-block 172.16.1.0/24 nasohi@DESKTOP-EQC1K12 : ~ $ aws ec2 create-subnet --vpc-id vpc-007283a0796292c04 --cidr-block 172.16.2.0/24                 3. Create an internet gateway nasohi@DESKTOP-EQC1K12 : ~ $ aws ec2 create-internet-gateway 4. Attach the Internet gateway to your VPC 5. Create a custom route table for your VPC 6. Create a route in the routing table that points all traffic (0.0.0.0/0) to the Internet gateway 7. Associate the routing table with a subnet in the VPC. Follow a complete guide from AWS   https