Feeds:
Posts
Comments

Dart is a programming language developed by Google. It is designed for building web, mobile, and server applications. Dart is known for its focus on simplicity, productivity, and performance. Dart can connect to various types of databases through different libraries and packages. The choice of database depends on the specific requirements of your project.

The problem is, mostly guidelines that available in Youtube or websites explain about connecting database inside frameworks like Flutter or Aqueduct. It’s common to use the database solutions that are well-supported and integrated with those frameworks but you need also a high hardware resource. I still can’t find a website explain about how to connect Dart outside the framework.

So, I will explain in this article about it. I assume that you’ve already familiar with MySQL dan Dart. I use Dart SDK version: 3.1.5 (stable) (Tue Oct 24 04:57:17 2023 +0000) on “windows_x64” and mysql Ver 15.1 Distrib 10.4.28-MariaDB, for Win64 (AMD64), source revision c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7.

I’m sure you are questioning why I wrote the code in Windows instead of Linux. Actually, dart and Xampp can run both in Windows and Linux. And the moment, I’m in the middle of working with Visual Code in Windows, so why not.

Step 1. Create a new user, make a database and table in MySQL.
When I use ‘root’ user that has no password, it didn’t work. So I create a new user because I don’t want to change the default configuration in MySQL. You can create your own database.

Step 2.Download the MySQL library in Dart.
Open file pubspec.yaml, add

dependencies:
   mysql1: ^0.19.0


On the terminal, type:

c:\> dart pub get
Resolving dependencies... (1.1s)
  js 0.6.7 (0.7.0 available)
  lints 2.1.1 (3.0.0 available)
  mysql1 0.19.2 (0.20.0 available)
  web_socket_channel 2.4.0 (2.4.1 available)
Got dependencies!
c:\>

Step 3. Write the dart code.

import 'package:mysql1/mysql1.dart';

Future createConnection() async {
  final MySqlConnection connection = await MySqlConnection.connect(ConnectionSettings(
    host: 'localhost',
    port: 3306,
    user: 'testing',
    db: 'contact',
    password:'testing'
  ));
  return connection;
}

Future fetchData() async {
  final MySqlConnection connection = await createConnection();
  Results results = await connection.query('SELECT * FROM person');
  
  for (var row in results) {
    print('${row['id']}'
    '${row['name']}'    
    '${row['mobile']}'
    '${row['category']}'
    '${row['city']}');  
  }
}

void main() {
    fetchData();
}
Continue Reading »


Visualizing trigonometric graphs using Python can be done with the help of various libraries, such as Matplotlib and NumPy. These libraries provide powerful tools for numerical operations and creating high-quality plots. In this introduction, I’ll walk you through the basic steps to visualize trigonometric functions using Matplotlib.

import matplotlib.pyplot as plt
import numpy as np
from math import radians
x=np.arange(0,360,1)
y1=np.sin(np.radians(x))
y2=np.cos(np.radians(x))
plt.title('Trigonometric Graphics')
plt.grid()
plt.xlabel('x')
plt.ylabel('y')
plt.plot(x,y1,label='y=sin(x)')
plt.plot(x,y2,label='y=cos(x)')
plt.legend()
plt.show()

Builing an IT infrastructure is an important process for supporting company efficiency. It has to be a well-planned system. If it works optimally the company can reduce costs and even help increase the productivity of the business.

However, the standard procedure may vary depending on the specific requirements, size of the building, and the complexity of the network.
Below are the general outline of the steps.

1.Need Assessment
This is the most important step. You have to know the client’s need. You have to determine the networks requirements and objectives for the building. How many users that will use the system, types of devices, bandwidth requirements, coverage areas dan future scalability because the company may have plans for expansion.

There are few criteria must be fulfilled when you setup an IT Infrastructure.

2.Network design
The next step is network design. You have to plan the placement of networking equipment, such as routers, switches, and wireless access points. There are few consider factors:
-limited space on the corner, you may have to use a mounted rack that provide access to devices both from the front and rear, cabling requirements, network segmentation
and location of the server rooms.

1.Zero Latency
Latency can be interpreted as the time needed to move data from one place to another. Each device can have different latency depending on the level of network quality it has. Inappropriate router or switches can cause latency.
2.Zero Downtime
Any downtime will interfere with the company’s operational activities.That’s why proper installation and infrastructure are very important.
3.Capacity storage
Storage system that can deliver superior performance.
4.Virtualization
Virtualization has benefits as follows:
-energy saving (no hardware)
-faster server provision (deployment is faster)
-improved disaster recovery (replication can be done easily)
5.Security
Security is one of the most important in having the ideal IT infrastructure. The main role of security system is to remove any vulnerable and put the system into optimized status.

3.Cabling Infrastructure
You have to make sure that you follow the industry standards for cable instalation and labeling. Well organized cabling will make your life easier for future troubleshooting. UTP cable maximum range is 100m, if the server location is far, Fiber-optic cable is a good solution.

4.Network Equipment Installation
Installation and configure the network equipments. Using Mikrotik or Cisco will make easier to remote the device. I give example for these 2 brands because I only familiar with it.

5.Network Configuration
Setting IP address, subnet masks, routing protocols, VLAN’s, security, DHCP (Dynami Host Configuration Protocol) servers, Firewall rules and network monitoring tools.

6.Wireless Network Configuration
Optimize the location to ensure reliable coverage and minimize interference. Use appropriate SSIDs (SErvice Set Identifiers) and latest security setting (WPA2/WPA3 Encryption).

7.Testing and Troubleshooting
In this step, you have to verify cable integrity, measure signal strength, and test network throughput. You have to ensure proper connectivity, data transmission, and performance.

8.Security Implementation
Configure access controls, user authentication, and network segmentation as needed. Implement security measures such as firewalls, intrusion detection systems, and encryption protocols to protect the network from unauthorized access and potential threats.

9.Documentation and Labeling
Network cabling infrastructure is the backbone of any network, connecting devices, servers, switches, routers, etc. Without proper documentation and lebeling, network cabling can become a mess. Proper documentation and labeling will save your time and help you maintain consistency and standards across your network, ensuring compatibility and performance.

10.Network monitoring and maintenance
Set up network monitoring tools to monitor the network performance, security incidents, and potential faults. Regular update firmware or security patches for network devices. Regular inspection for all equipments. Periodic cable testing.

Jupyter Notebook is part of Project Jupyter which is announced by Fernando Pérez in 2014. It’s a spin-off project from IPython and become the kernel for Jupyter.
Jupyter is a language agnostic and support other programming language like Python, Julia, R, Haskel and Ruby. It’s 100% open-source.
The file format for Jupyter is ‘.ipynb’.
The Jupyter kernel is responsible for handling various type of request (code execution, code completion, inspection) and providing a reply. Since it can connect to many kernels,
it can provide programming in different languages.

In this tutorial, I use:
-Xubuntu 18.04
-Docker 20.10.14

STEP1.FIND THE IMAGES
First, we have to get the docker image. Make sure you are connected to the Internet.

darklinux@darklinuxpc:~$ docker search jupyter
NAME                                   DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
jupyter/datascience-notebook           Jupyter Notebook Data Science Stack from htt…   917                  
jupyter/all-spark-notebook             Jupyter Notebook Python, Scala, R, Spark, Me…   375                  
jupyter/scipy-notebook                 Jupyter Notebook Scientific Python Stack fro…   340                  
jupyterhub/jupyterhub                  JupyterHub: multi-user Jupyter notebook serv…   310                  [OK]
jupyter/tensorflow-notebook            Jupyter Notebook Scientific Python Stack w/ …   301                  
jupyter/pyspark-notebook               Jupyter Notebook Python, Spark, Mesos Stack …   224                  
jupyter/base-notebook                  Small base image for Jupyter Notebook stacks…   169                  
jupyter/minimal-notebook               Minimal Jupyter Notebook Stack from https://…   154                  
jupyter/r-notebook                     Jupyter Notebook R Stack from https://github…   44                   
jupyterhub/singleuser                  single-user docker images for use with Jupyt…   43                   [OK]
jupyter/nbviewer                       Jupyter Notebook Viewer                         27                   [OK]
bitnami/jupyter-base-notebook                                                          24                   
jupyterhub/k8s-hub                                                                     18                   
bitnami/jupyterhub                                                                     11                   
jupyterhub/k8s-singleuser-sample                                                       9                    
jupyterhub/configurable-http-proxy     node-http-proxy + REST API                      6                    [OK]
jupyterhub/k8s-network-tools                                                           2                    
graphcore/pytorch-jupyter              The Poplar® SDK plus PyTorch for IPUs includ…   1                    
ibmcom/jupyter-base-notebook-ppc64le   Small base image for Jupyter Notebook stacks…   1                    
pachyderm/jupyterhub-pachyderm-user                                                    0                    
ibmcom/jupyter-nb-nb2kg                                                                0                    
pachyderm/jupyterhub-pachyderm-hub                                                     0                    
graphcore/tensorflow-jupyter           The Poplar® SDK plus TensorFlow 1 & 2 for IP…   0                    
ibmcom/jupyter-ppc64le                                                                 0                    
ibmcom/jupyter                                                                         0                    
darklinux@darklinuxpc:~$

Continue Reading »

Getting Market Stock Data from Yahoo Finance is not difficult with Python Module – Pandas.
To follow this tutorial at least you know how to run python code.
In this tutorial, I use:
-Python 3.6.9 (default, Dec 8 2021, 21:08:43)
-Matplotlib-3.3.4
-Pandas 1.1.5
-Xubuntu 18.04
and Vim for text editor

Before you start, make sure you are connected to the Internet.

If you don’t have Python, Matplotlib and Pandas, you can install it from Linux Terminal with commands below:

$ sudo apt-get install python3
$ pip3 install matplotlib
$ pip3 install pandas

The source codes:

Continue Reading »

When I imported matplotlib.plyplot module, I got these errors.

In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: 
The text.latex.preview rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: 
The mathtext.fallback_to_cm rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: Support for setting the 'mathtext.fallback_to_cm' rcParam is deprecated since 3.3 and will be removed two minor releases later; use 'mathtext.fallback : 'cm' instead.
In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: 
The validate_bool_maybe_none function was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: 
The savefig.jpeg_quality rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: 
The keymap.all_axes rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: 
The animation.avconv_path rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: 
The animation.avconv_args rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
>>>

When I had this problem I was using Python 3.6.9 (default, Dec 8 2021, 21:08:43) , matplotlib-3.3.4 and Xubuntu 18.04.

To fix this problem, I did 3 steps.
1.Uninstall the Matplotlib module
2.Remove ~/.local/lib/python3.6/site-packages/matplotlib*
3.Reinstall the Matplotlib module

Continue Reading »

What is Reverse Engineering?

It’s a decompilation of an application so we learn how it work, find the bug or modify it.
Software developer use it for exploit their software weaknesses and strengthen its defenses.
Hackers use it to expose security holes and take advantages of it.

Breaking something down and putting it back together is a process that helps people understand how things were made. Reverse engineering is a way for us to understand how things were designed, how it works, and what its purpose is. In effect, the information is used to redesign and improve for better performance and cost. It can even help fix defects.

In order to understand how it work, at least you have to know a basic knowledge in Assembly Language and Debugging Tools. Regardless what programming language that was used to make the application, at the end it has to be compiled into a machine code before it can run on the computer. Because computer only know machine code.

And to understand the machine code, once again you need to know Assembly Language.

If you want to learn more about reverse engineering, I suggest you to start with small program in c, debug it and observe how it work. Why c? Because c is close to Assembly. If you are not familiar with Assembly and Gdb, I wrote some articles about it also, so you can read it as reference.

One more thing, since in this tutorial I use Vim as hexadecimal editor, you have to know basic knowledge about Vim also. Vim is a text editor but it has a capability to convert a program to hexadecimal and edit the content.

Let’s start.

In this tutorial, I use:
-Xubuntu 18.04
-GNU gdb 8.1.1
-gcc version 7.5.0
-vim version 8.0.1453

Below, is the simple code that we will use for the practice. It’s written in c language. We will use gcc as the compiler.
The program is very simple, the process are:
-Display message ‘Enter your password’
-Check the input password.
-If it is equal, display ‘Access Granted’.

-If it is not equal, display ‘Wrong passwod’.
-then exit

#include<stdio.h>
#include<string.h>

void granted();

int main()
{
  char password[16];
  printf("Enter your password: ");
  gets(password);
  
  if (strcmp(password,"passwordkey"))
  {
  	printf("\nWrong password!\n");
  }
  else
  {
  	granted();
  }
}

void granted()
{
	printf("\nAccess granted!\n");
	return;
}

What we will do to the program is we change the sequence.
Any input for password that is not equal, display ‘Access Granted’.

Pages: 1 2

You can set breakpoint with a condition. This is very useful if want to observe a certain location and stop it if the condition is reach.

In this tutorial I use:
-Xubuntu 18.04
-GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
-NASM version 2.13.02
-GNU ld (GNU Binutils for Ubuntu) 2.30

Use the simple assembly code below:

1  section .text
2  global _start
3
4  _start:
5
6      mov rax,3
7      mov rbx,2
8      add rax,rbx
9      sub rbx,1
10
11     ;Exit
12     mov eax,1
13     mov ebx,0
14     int 0x80

Continue Reading »