Zakky Muhammad

Information Technology

Hi, i'm Zakky!

Information Technology Enthusiast


Working in a company based on Indonesia. Very enthusiastic about linux, system security and application project. Sometimes works as a freelancer.

email: zkymuhammad@gmail.com

Resume

  Education

Informatics Engineering

AMIKOM University (Bachelor Degree) - Graduation 2016

Learn and got many experiences in information technology. Studying for 4 years. Learning many things such as computer network, programming, graphic design & multimedia, e-commerce, business management & much more. Enthusiastic about Linux & Open Source and Hacking & Security seminar or workshop. Started actively to be an IT writer either in blog or pdf.

Computer and Network Engineering

SMK Negeri 1 Pacitan - Graduation 2012

Learn and got many knowledge and experiences in Linux Server and System Administration either Linux or Windows. Got special opportunity to participate in Vocational High School Contest in Surabaya as IT Networking Support participant. Have achievement of The Best Final Project.

  Work Experience

Shopee International (Sea Group).

Engineer, Corporate IT - Aug 2019 - Current

-

Favehotel Kusumanegara.

IT Supervisor - Jan 2017 - Aug 2019

-

Freelance.

Company Website - Nov 2014 - Current

-

AMIKOM University.

Practical Assistant - 2014

Assist the teacher to teach the students in laboratory. The course is Linux Operating System.

T&T Computer.

Computer Technician - 2010

-

  Testimonials

SKILLS

   Professional Skills

  • 73% Complete
    Comunication 73%
  • 80% Complete
    Management 80%
  • 95% Complete
    Confidence 95%
  • 88% Complete
    Presenter 88%

   IT Skills

  • 85% Complete
    Computer Network 85%
  • 75% Complete
    Mikrotik 75%
  • 80% Complete
    Cisco Meraki 80%
  • 78% Complete
    Cisco 78%
  • 70% Complete
    Hacking & Security 70%
  • 85% Complete
    Linux 85%

   Code Skills

  • 75% Complete
    Python 70%
  • 70% Complete
    MySQL 70%

Portfolio

Internet Network

Wireless Connection

Wireless LAN installation in National Land Agency Office Pacitan

Desktop App

Desktop App - Adobe Flash - Thesis Project

Social Science interactive module application as Junior High School learning media

Web Design

Website Front End

The Islamic University of Indonesia Magister Program Website Design

Web App

Front End

Black Java Coffee Jogja Website

School Website

Website

Creating Website for SMK Nurudh Dholam Pacitan

Blog

Generator adalah tipe iterasi seperti list dan tuple. Tidak seperti list, generator tidak mengizinkan indexing yang semena-mena tetapi masih dapat diiterasi menggunakan fungsi for. Generator dapat dibuat menggunakan sebuah fungsi dan statemen yield.

Berikut contohnya:

def fungsi():
     i=5
     while i > 0:
         yield i
         i -= 1

for i in fungsi():
    print(i)
=====>
5
4
3
2
1 
=====>

Yield juga bisa untuk tidak memiliki batasan list.

def lima():
     while True:
         yield 5

for i in lima():
    print(i)
=====>
5
4
3
2
1 
=====>

Generator juga dapat dikonversi ke dalam bentuk list.

def lima():
     while True:
         yield 5

for i in lima():
    print(i)
=====>
[0, 2, 4, 6, 8, 10] 
=====>



Python memiliki fungsi built-in yg sangat bermanfaat untuk operasi list, yaitu map dan filter.

Map

Fungsi map akan mengambil sebuah fungsi dan menetapkan sebuah list sebagai argumennya. Berikut contohnya:

def add_five(x):
     return x + 5

nums = [11, 22, 33, 44, 55]
result = list(map(add_five, nums))

print(result)

Bisa juga dilakukan menggunakan fungsi lambda.

nums = [11, 22, 33, 44, 55]

result = list(map(lambda x: x+5, nums))

print(result)

Filter

Fungsi filter akan mengeliminasi list yang tidak sesuai dengan kondisi fungsi. Berikut contohnya:

nums = [11, 22, 33, 44, 55]

result = list(filter(lambda x: x%2==0, nums))

print(result)



Referensi

django-rest-framework.org

Django REST API

  1. Install Django REST Framework
$ pip install djangorestframework

2. Daftarkan app di settings.py.

INSTALLED_APPS = [
 ...
 ...
 ‘rest_framework’,
]

3. Buat modul serializers.py di apps/apps01.

from apps.apps01.models import Jurusan
from rest_framework import serializers

class JurusanSerializer(serializers.ModelSerializer):
   class Meta:
      model = Jurusan
      fields = ['id','nama_jurusan','keterangan']

4. Buat viewset di apps/apps01 dengan nama viewset_api.py.

from apps.apps01.models import Jurusan
from apps.apps01.serializers import JurusanSerializer
from rest_framework import viewsets

class JurusanViewset(viewsets.ModelViewSet):
   queryset = Jurusan.objects.all()
   serializer_class = JurusanSerializer

5. Edit urls.py.

from apps.apps01.viewset_api import *
from rest_framework import routers

router = routers.DefaultRouter()
router.register('jurusan', JurusanViewset)

urlpatterns = [
    path('siswa/api/', include(router.urls)),

6. Akses API melalui localhost:8000/siswa/api/

7. Klik data yang muncul.

Melihat Data Berdasarkan ID

Tambahkan ID di URL paling belakang.

Contoh : localhost:8000/siswa/api/jurusan/1/

Menggunakan Permission

Untuk mengakses API yang menggunakan permission, maka kita perlu login terlebih dahulu. Tidak seperti mengakses API yang sebelumnya, dimana kita langsung bisa melihat, meng-edit dan menambahkan data.

  1. Edit viewset_api.py.
...
from rest_framework import viewsets, permissions

class JurusanViewset(viewsets.ModelViewSet):
   ...
   permission_classes = [permissions.IsAuthenticated]

Maka jika kita coba mengakses data di API, akan keluar keterangan dimana kita memerlukan credential untuk mengakses data di API tersebut.


Lanjutkan Membaca Materi Lengkap


Persiapan

Siklus deployment:

  1. Development
  2. Testing
  3. Production

Kebutuhan:

  1. App
  2. Terminal / Putty
  3. Server / VPS
  4. Domain

Deploy ke Server

  • Referensi:
gist.github.com/HilmiZul

django-deploy.md

Mulai Deploy ke Server

$ apt-get update
$ apt-get install python3-pip python3-dev nginx

$ sudo -H pip3 install --upgrade pip

$ sudo -H pip3 install virtualenv
$ clone https://github.com/writerlab/perpus

$ virtualenv Env
$ source Env/bin/activate 

$ pip install django==2.2.12 pillow django-import-export gunicorn
  • Konfigurasi host.
  • STATICFILES_DIRS tidak dipakai,
    diganti STATIC_ROOT.
ALLOWED_HOSTS = [‘192.168.1.1’]
...
...
STATIC_ROOT = os.path.join(BASE_DIR, ‘static’)
  • Kumpulkan semua konten static ke direktori yg telah ditentukan.
$ python3 manage.py collecstatic
  • Allow firewall.
$ sudo ufw allow 8000
  • Coba jalankan server.
$ python3 manage.py runserver 0.0.0.0:8000
  • Coba jalankan server menggunakan gunicorn.
$ gunicorn --bind 0.0.0.0:8000 perpus.wsgi
  • Keluar dari virtual environment.
$ deactivate
  • Buat service unicorn
$ nano /etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=zulx
Group=www-data
WorkingDirectory=/home/zulx/perpus
ExecStart=/home/zulx/perpus/.env/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/zulx/perpus/perpus.sock perpus.wsgi:application

[Install]
WantedBy=multi-user.target
  • Start gunicorn.
$ sudo systemctl start gunicorn
$ sudo systemctl enable gunicorn
$ sudo systemctl status gunicorn
  • Jika ada perubahan pada file gunicorn.service..
$ sudo systemctl daemon-reload
$ sudo systemctl restart-gunicorn
  • Konfigurasi Nginx.
$ nano /etc/nginx/sites-available/perpus
server {
    listen 80;
    server_name 192.168.1.1;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/zulx/perpus;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/zulx/perpus/perpus.sock;
    }
}
  • Enable Nginx
$ ln -s /etc/nginx/sites-available/perpus /etc/nginx/sites-enabled/
$ nginx -t
$ sudo systemctl restart nginx
  • Buat firewall
$ sudo ufw delete allow 8000
$ sudo ufw allow ‘Nginx Full’
  • Akses webapp.
192.168.1.1
  • Nonaktifkan mode debug pada saat mode production.
...
DEBUG = False
...
  • Pada mode production, jangan mengubah-ubah project.
  • Development hanya dapat dilakukan di local atau di github.
  • Lebih baik lagi menggunakan server khusus testing.


Lanjutkan Membaca Materi Lengkap


Virtual Environment

Membuat virtual environment.

$ python3 -m venv Env
$ source /Env/bin/activate

Memindahkan Project

  1. Buat virtual environment baru.
  2. Install package python yg dibutuhkan.
  3. Buat project.
  4. Buat apps
  5. Pindahkan file dari project lama, seperti settings.py, urls.py, views.py, templates, dll.
  6. Lakukan migrasi database.
$ python3 manage.py makemigrations
$ python3 manage.py migrate

7. Buat lagi user admin django.

$ python3 manage.py createsuperuser


Lanjutkan Membaca Materi Lengkap


1 2 3 4 5 6

Contact

  Address

Bantul, Yogyakarta - Indonesia

  Phone

ask by email or social media

  Mail

zkymuhammad@gmail.com