17 May 2020

In this tutorial I will show you how to read data from Arduino Uno using pySerial library from Python and visualize it into Live Plot graph.
I assume that you have already familiar with Matplotlib. If not, you can read my article about it.

What you need?
Arduino Uno (you can use other type).
-Temperature sensor LD35
USB connector
-3 small cable

Before we start you have to make sure that you have already installed python libraries below:

Since I have already Matplolib library, I just need to install Pyserial and Drawnow.

$ pip3 install pyserial
Collecting pyserial
https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl (193kB)
100% |████████████████████████████████| 194kB 30kB/s
Installing collected packages: pyserial
Successfully installed pyserial-3.4

Before you install ‘drawnow’ library, you have to install ‘html5lib==1.0b10’ first.

$ pip3 install html5lib==1.0b10
Collecting html5lib==1.0b10
https://files.pythonhosted.org/packages/2f/747793ca2d36f676b740efc04b7ba887c610119beb5841d1805cb3515616cb/html5lib-1.0b10-py2.py3-none-any.whl (112kB)
100% |████████████████████████████████| 112kB 11kB/s
Collecting webencodings (from html5lib==1.0b10)
Collecting six (from html5lib==1.0b10)
Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting setuptools>=18.5 (from html5lib==1.0b10)
https://files.pythonhosted.org/packages/a0/df/635cdb901ee4a8a42ec68e480c49f85f4c59e8816effbf57d9e6ee8b3588/setuptools-46.1.3-py3-none-any.whl (582kB) 100% |████████████████████████████████| 583kB 107kB/s Installing collected packages: webencodings, six, setuptools, html5lib Successfully installed html5lib-1.0b10 setuptools-46.1.3 six-1.14.0 webencodings-0.5.1 

Now, you can install drawnow library

$ pip3 install drawnow
Collecting drawnow
Using cached https://files.pythonhosted.org/packages/8b/bc/3a0238eb1e6222b4e2c74fcd171453d714e2f67c0f224fd5160d83636e10/drawnow-0.72.0-py3-none-any.whl

Collecting matplotlib>=1.5 (from drawnow)
https://files.pythonhosted.org/packages/93/4b/52da6b1523d5139d04e02d9e26ceda6146b48f2a4e5d2abfdf1c7bac8c40/matplotlib-3.2.1-cp36-cp36m-manylinux1_x86_64.whl (12.4MB) 100% |████████████████████████████████| 12.4MB 57kB/s Collecting python-dateutil>=2.1 (from matplotlib>=1.5->drawnow) Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl 

Collecting kiwisolver>=1.0.1 (from matplotlib>=1.5->drawnow)
https://files.pythonhosted.org/packages/ae/23/147de658aabbf968324551ea22c0c13a00284c4ef49a77002e91f79657b7/kiwisolver-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (88kB) 100% |████████████████████████████████| 92kB 115kB/s 

Collecting numpy>=1.11 (from matplotlib>=1.5->drawnow) 
https://files.pythonhosted.org/packages/3d/fc/4763e5f17ac6e7e7d55f377cde859ca1c5d5ac624441ab45315bc578aa9e/numpy-1.18.3-cp36-cp36m-manylinux1_x86_64.whl (20.2MB) 100% |████████████████████████████████| 20.2MB 44kB/s Collecting cycler>=0.10 (from matplotlib>=1.5->drawnow) 
Using cached https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl

Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib>=1.5->drawnow)
https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl (67kB) 100% |████████████████████████████████| 71kB 169kB/s Collecting six>=1.5 (from python-dateutil>=2.1->matplotlib>=1.5->drawnow) Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl 
Installing collected packages: six, python-dateutil, kiwisolver, numpy, cycler, pyparsing, matplotlib, drawnow Successfully installed cycler-0.10.0 drawnow-0.72.0 kiwisolver-1.2.0 matplotlib-3.2.1 numpy-1.18.3 pyparsing-2.4.7 python-dateutil-2.8.1 six-1.14.0 

There are 2 things that we will do:
-first, program your Arduino to send the temperatur data through serial port.
-second, program python to read the data and display it.

The schema of the wiring is below:
LD35 arduino
pin1 ——- pin 5V
pin2 ——- pin A0
pin3 ——- pin GND
ld35 fritzing

Before we start, make sure your Arduino board has already recognized by your computer. This is very important, otherwise you can’t upload the code to the Arduino board. My port may be different with your Arduino port connection.
My port is ttyACM0.

My ttyACM0 use ‘dialout’ module, so I check first it belong to whom.

$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Apr 30 13:08 /dev/ttyACM0

Since it belong to ‘root’, I have to change the ownership to my linux normal user, ‘darklinux’. If I don’t change it, I can’t connect to my arduino without root access. I’ve tried to register ‘darklinux’ into ‘dialout’ but it doesn’t work, so I use this way.

$ sudo chown darklinux /dev/ttyACM0
[sudo] password for darklinux:
$ ls -l /dev/ttyACM0
crw-rw---- 1 darklinux dialout 166, 0 Apr 30 13:08 /dev/ttyACM0

Now we can try.

Programming in Arduino side.
Open your Arduino IDE and type the code below then Upload the code to Arduino board.

LM35 sketch
Print temperature to the Serial Monitor */
const int inPin=0;
void setup()
   //Deafault Temperature in Celsius
   //Serial.println( (celsius*9)/5+32); //convert to fahrenheit
void loop()
   int value=analogRead(inPin);
   float millivolts=(value/1024.0)*5000;
   float celsius=millivolts/10; //sensor output

Open your Arduino ‘Serial Monitor’ screen to see the result.
If you can see the output then you continue to next step.

Before that, close the ‘Serial’ window first. Otherwise, you will this error:

OSError: [Errno 16] Device or resource busy: ‘/dev/ttyACM0’ if try to connect with python. Because, you can’t use 2 serial connection at the same time.

The next step is try read the output serial using python.
Type the code below and run it.

1 import serial
3 arduinodata=serial.Serial('/dev/ttyACM0',9600)
5 while True:
6    arduinotemp=arduinodata.readline()
7    print(arduinotemp)

Get connection with arduino serial data with 9600 baud rate speed.
It must be the same baud rate speed with arduino read the LD35 data.
Read the lines and print it.

If you can see the result like below, it mean python can read your arduino serial data.

$ python3 test.py

temp06Now, you can copy the code below and run it.

Programming in python side.
Type the code below:

import serial
import matplotlib.pyplot as plt
from drawnow import *

plt.ion      #set matplotlib to interactie mode
tempC=[]     #create array

def drawplot():
   plt.title('Streaming Temperature')
   plt.ylabel('Temperature Celcius')

while True:
   #tempdata output format: b'27.34\r\n'
   #strip() will remove \r\n
   #decode will remove b'.
   #b' is indicate byte
   #change data format from String to Float

Run it.
$ python3 temp.py

The result:

The code below will depend on your arduino output. You can modify it.
#tempdata output format: b’27.34\r\n’
#strip() will remove \r\n
#decode will remove b’.
#b’ is indicate byte

The serial data is in ‘string format’ so you have to change it ‘float’ format. Otherwise Matplot can’t read it.

Display the live graph.

I set the x-axis to 50, otherwise it will keep increase.

by Taufan Lubis on 17 May 2020 01:06 AM

08 May 2020

What is shellcode?
Shellcode is a set of instruction written in machine code which is generally used as payload in the exploitation of software vunerability. Since it starts with command shell that’s why it is named as Shellcode.

It’s the sampel of shellcode:

It stands for ‘Hello World!’.

For writing shellcode, you must familiar with Assembly Language programming and target hardware architecture. You can’t write shellcode for 32bit architecture and run in it 64bit architecture because the instruction codes that are loaded into the memory layout is also different.
If you write a program with c language, run it in 32bit architecture, the instruction codes will be loaded above stack but in 64bit it will be loaded above the heap.
It depend also on Operating System used. That’s why shellcode is designed for specific target system that take advantages its vulnerability.

Efficiency is needed when you wrote shellcode because it related with the size of buffer.

In this tutorial, I run the shellcode under Linux Ubuntu 18.04.4 LTS 32 bit in docker container. My hardware architecture is AMD ryzen 64bit. For programming I use gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 for compiling c code, NASM version 2.13.02 for compiling assembly code and GNU objdump (GNU Binutils for Ubuntu) 2.30 for display machine code.

Writing shellcode also a bit tricky.

I give you an example.
Below is the assembly code to display “hello word!”.
Assembly code 1 (hello1)

1 section .text
2 global _start
4 _start:
6  ;Display Message
7  mov eax,4 ;syswrite=4
8  mov ebx,1 ;stdout=1
9  mov ecx,msg
10 mov edx,lenmsg
11 int 0x80 ;System Call
13 ;Exit
14 mov eax,1
15 mov ebx,0
16 int 0x80
18 section .data
19 msg db 'Hello World!',0xa
20 lenmsg equ $ - msg
I compile and run this code.
root@fc9fca692021:/home/darklinux# nasm -f elf32 hello1.asm -o hello1.o
root@fc9fca692021:/home/darklinux# ld hello1.o -o hello1
root@fc9fca692021:/home/darklinux# ./hello1
Hello World!

It runs perfect.

The problem is, when you want to convert it to shellcode, you can’t see the ‘Hello World!’ characters. See the machine code below:

root@fc9fca692021:/home/darklinux# objdump -M intel -d hello1.o
hello.o: file format elf32-i386

Disassembly of section .text:
00000000 <_start>:

 0:   b8 04 00 00 00    mov eax,0x4
 5:   bb 01 00 00 00    mov ebx,0x1
 a:   b9 00 00 00 00    mov ecx,0x0
 f:   ba 0d 00 00 00    mov edx,0xd
14:   cd 80             int 0x80
16:   b8 01 00 00 00    mov eax,0x1
1b:   bb 00 00 00 00    mov ebx,0x0
20:   cd 80             int 0x80


EDX register is pointed to a memory location of ‘Hello World!’ but it’s not part of the machine code above. As you can see above, there is no ‘Hello World!’ code. The shellcode will never work.
mov edx,0xd

That’s why you have to modify the assembly code.

It works exactly the same but the machine codes that are loaded into the memory is different.

Assembly code 2 (hello2.asm)
1 section .text
2 global _start
4 _start:
5      jmp begin
7      ;Display Message
8      thecode:
9      mov eax,4    ;syswrite=4
10     mov ebx,1    ;stdout=1
11     pop ecx
12     mov edx,0xD
13     int 0x80     ;System Call
15     ;Exit
16     mov eax,1
17     mov ebx,0
18     int 0x80
20     begin:
21     call thecode
22 message: db 'Hello World!',0xa
23 section .data
root@fc9fca692021:/home/darklinux# nasm -f elf32 hello2.asm -o hello2.o
root@fc9fca692021:/home/darklinux# ld hello2.o -o hello2
root@fc9fca692021:/home/darklinux# ./hello2
Hello World!
root@fc9fca692021:/home/darklinux# objdump -M intel -d hello2.o
hello.o: file format elf32-i386

Disassembly of section .text:

00000000 <_start>:

  0:      eb 1e              jmp 20

00000002 :
  2:      b8 04 00 00 00     mov eax,0x4
  7:      bb 01 00 00 00     mov ebx,0x1
  c:      59                 pop ecx
  d:      ba 0d 00 00 00     mov edx,0xd
 12:      cd 80              int 0x80
 14:      b8 01 00 00 00     mov eax,0x1
 19:      bb 00 00 00 00     mov ebx,0x0
 1e:      cd 80              int 0x80
00000020 :
20:       e8 dd ff ff ff     call 2
25:       48                 dec eax
26:       65 6c              gs ins BYTE PTR es:[edi],dx
28:       6c                 ins BYTE PTR es:[edi],dx
29:       6f                 outs dx,DWORD PTR ds:[esi]
2a:       20 57 6f           and BYTE PTR [edi+0x6f],dl
2d:       72 6c              jb 9b <message+0x7b>
2f:       64 21 0a           and DWORD PTR fs:[edx],ecx


Let’s check.
Take the machine code below:
25: 48
26: 65 6c
28: 6c
29: 6f
2a: 20 57 6f
2d: 72 6c
2f: 64 21 0a
and add ‘\x’ on each of it.

So, it will become:
Test it using printf.

root@fc9fca692021:/home/darklinux# printf “\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21\x0a”
Hello World!


So, in order to display ‘Hello World!’ using shellcode, you have to convert all the machine code from objdump output to shellcode format.

The result will be like below:


Now, you can put the machine code into c programming syntax as shellcode.

1  #include<stdio.h>
3  unsigned char code[] = \
4    "\xeb\x1e\xb8\x04\x00\x00\x00\xbb\x01\x00\x00\x00\x59" \
5    "\xba\x0d\x00\x00\x00\xcd\x80\xb8\x01\x00\x00\x00\xbb" \
6    "\x00\x00\x00\x00\xcd\x80\xe8\xdd\xff\xff\xff\x48\x65" \
7    "\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21\x0a";
10 int main()
11 {
12    int (*ret)() = (int(*)())code;
13    ret();
14 }

root@fc9fca692021:/home/darklinux# gcc -o shellcode -fno-stack-protector -z execstack shellcode.c

root@fc9fca692021:/home/darklinux# ./shellcode
Hello World!

If you have the same result, congratulation, you did your first shellcode.

Create shellcode from Objdump using bash script.
You can edit the objdump output using text editor but it will take a bit effort. So, just use the bash script below to create shellcode from objdump output.

File: getshell.sh

sed '1,7d'       |
cut -f2 -d ":"   |
cut -f1-5 -d " " |
tr '\t' ' '      |
tr -s ' '        |
sed 's/ $//g'    |
sed 's/ /\\x/g'  |
paste -d '' -s

Change the ‘file mode’ to be ‘executable’, $chmod +x getshell.sh before you can use it.
It will automatically create the shell code.

root@fc9fca692021:/home/darklinux# objdump -d hello.o | ./getshell.sh



Explanation about pop ecx

With gdb (gnu debugger), I can show you that ‘mov ecx,msg’ in assembly code 1 same with ‘pop ecx’ in assembly code 2.

$ gdb hello2 --silent
Reading symbols from /home/darklinux/hello2...(no debugging symbols found)...done.
(gdb) set disassembly-flavor intel
(gdb) disassemble _start
Dump of assembler code for function _start:
0x08048060 <+0>: jmp 0x8048080
End of assembler dump.
(gdb) disassemble 0x8048080
Dump of assembler code for function begin:
0x08048080 <+0>: call 0x8048062
End of assembler dump.
(gdb) disassemble 0x8048062
Dump of assembler code for function thecode:
0x08048062  <+0>: mov eax,0x4
0x08048067  <+5>: mov ebx,0x1
0x0804806c <+10>: pop ecx
0x0804806d <+11>: mov edx,0xd
0x08048072 <+16>: int 0x80
0x08048074 <+18>: mov eax,0x1
0x08048079 <+23>: mov ebx,0x0
0x0804807e <+28>: int 0x80
End of assembler dump.
(gdb) break *0x08048067
Breakpoint 1 at 0x8048067
(gdb) run
Starting program: /home/darklinux/hello2
Breakpoint 1, 0x08048067 in thecode ()
(gdb) disassemble 0x8048062
Dump of assembler code for function thecode:
   0x08048062  <+0>: mov eax,0x4
=> 0x08048067  <+5>: mov ebx,0x1
   0x0804806c <+10>: pop ecx
   0x0804806d <+11>: mov edx,0xd
   0x08048072 <+16>: int 0x80
   0x08048074 <+18>: mov eax,0x1
   0x08048079 <+23>: mov ebx,0x0
   0x0804807e <+28>: int 0x80
End of assembler dump.
(gdb) info reg ecx
ecx     0x0    0
(gdb) si
0x0804806c in thecode ()
(gdb) disassemble 0x8048062
Dump of assembler code for function thecode:
   0x08048062  <+0>: mov eax,0x4
   0x08048067  <+5>: mov ebx,0x1
=> 0x0804806c <+10>: pop ecx
   0x0804806d <+11>: mov edx,0xd
   0x08048072 <+16>: int 0x80
   0x08048074 <+18>: mov eax,0x1
   0x08048079 <+23>: mov ebx,0x0
   0x0804807e <+28>: int 0x80
End of assembler dump.
(gdb) info reg ecx
ecx     0x0    0
(gdb) si
0x0804806d in thecode ()
(gdb) disassemble 0x8048062
Dump of assembler code for function thecode:
   0x08048062  <+0>: mov eax,0x4
   0x08048067  <+5>: mov ebx,0x1
   0x0804806c <+10>: pop ecx
=> 0x0804806d <+11>: mov edx,0xd
   0x08048072 <+16>: int 0x80
   0x08048074 <+18>: mov eax,0x1
   0x08048079 <+23>: mov ebx,0x0
   0x0804807e <+28>: int 0x80
End of assembler dump.
(gdb) info reg ecx
ecx 0x8048085 134512773
(gdb) x/s 0x8048085
0x8048085 : "Hello World!\n"

The content of ecx register is 0x8048085.
As you can see, the content of memory 0x8048085 is the ‘Hello World!’.
Define the ‘Hello World’,0xa is the same as push it into the a memory location.
db ‘Hello World!’,0xa
Since the concept of memory stack is First In Last Out (FILO), using pop ecx will copy the address directly to ecx register.

by Taufan Lubis on 08 May 2020 04:23 AM

07 May 2020

2 tahun yang lalu saat mainan forensik dual apps aplikasi Andriller sudah tersedia versi Linux. Tapi cuma trial saja. Tidak masalah trial karena memang hanya untuk membuktikan kemampuan Andriller dalam mendeteksi aplikasi-aplikasi yang terinstall.

Perasaan Andriller sekarang dan dulu berbeda. Dulu bisa mendeteksi basis data aplikasi yang terinstall di Android. Saat ini memang sudah terbuka kodenya dan tersedia di repositori kode Github. Untuk fitur decoder masih tersedia, lumayan bisa bantu untuk analisis. Fitur lengkap decoder cek disini.

Sehubungan Andriller sudah terbuka dengan lisensi MIT, mari kita install Andriller di Linux:
1. Siapkan keperluan perangnya, sudo apt-get install android-tools-adb python3-tk
2. Install Andriller, pip install andriller --user
3. Jalankan Andriller, andriller-gui.py

Alhamdulillah... Andriller sudah bebas diunduh dan digunakan. Salut untuk developer-nya yang berkenan melepas publik. Saatnya bekerja dan berkarya.

by Dedy Hariyadi on 07 May 2020 06:26 PM

27 Apr 2020

What is Little Endian?
It’s a way of bytes are stored in Computer Memory.

Then what is Little Endian? It’s bytes stored in computer memory where the least significant byte byte occupies the lower memory address.

It will be easier if I show you the sample below:

For Example I have data: abcdefgh or 61,62,63,64,65,66,67,68 in hexadecimal number (a=61 in Ascii table). If it’s loaded in memory, it the order will be:

 d, c, b,a      h, g, f,e
64,63,62,61    68,67,66,65

The easier way, read from right to left per 4 bytes.

There are 2 types of it:
-Little Endian
-Big Endian

Big Endian is the opposite of Little Endian. The byte order in Memory is left to right.
Little Endian is mainly used in micro processor world.

Outside micro processor world, Big Endian is the common format in data networking for protocol like TCP, UDP, IPv4 and IPv6 for transmit data.

History word ‘Endian.
In 1980, computer scientist Danny Cohen introduced the terms Big Endian and Little Endian to digital electronic. These term actually come from novel Gulliver’s Travels written by Jonathan Swift.

Which type of Processor that use Little Endian?
Motorolla use Big Endians meanwhile Intel and AMD use Little Endian.

Which type is better?
Until I write this article, I still can’t find article that really show which one is better, in term of speed, easy to code or benchmark.

Why Intel and AMD use Little Endian and Why Motorolla and ARM use Big Endian in their processor.
I believe it is based on their history processor design and to maintain the backward compatibility, each vendor continue their Endian system in their product until now.

For Intel, since the first successful micro processor, Intel 8088 which is co-created by Victor Poor, an American Engineer and Computer Pioneer it continue to use Little Endian system until now.

For your reference, you can read the article below:

After you download the PDF, search for “for example, storing numbers least significant byte first”.

Using GDB to see how it work in the system.
I this tutorial, I use 64bit AMD processor and use “nasm” for compiling and link my assembly code.
Below the code that I use for the sample.

 1 section .text
 2 global _start
 4 _start:
 6 mov rax,sample
 8 ;Exit
 9 mov eax,1
10 mov ebx,0
11 int 0x80
13 section .data
14 sample db 'abcdefgh'


I compile it with nasm.
$ nasm -f elf64 -g endian.asm -o endian.o
$ ld endian.o -o endian

$ gdb ./endian
GNU gdb (Ubuntu 8.1-0ubuntu3)
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./endian...done.
(gdb) list 1,15
 1 section .text
 2 global _start
 4 _start:
 6 mov rax,sample
 8 ;Exit
 9 mov eax,1
10 mov ebx,0
11 int 0x80
13 section .data
14 sample db 'abcdefgh'
(gdb) break _start
Breakpoint 1 at 0x4000b0
(gdb) run
Starting program: /home/darklinux/endian
Breakpoint 1, 0x00000000004000b0 in _start ()


(gdb) set disassembly-flavor intel
(gdb) disassemble _start
Dump of assembler code for function _start:
=> 0x00000000004000b0 <+0>: movabs rax,0x6000c8
   0x00000000004000ba <+10>: mov eax,0x1
   0x00000000004000bf <+15>: mov ebx,0x0
   0x00000000004000c4 <+20>: int 0x80
End of assembler dump.
(gdb) info reg rax
rax 0x0 0
(gdb) si
0x00000000004000ba in _start ()
(gdb) disassemble _start
Dump of assembler code for function _start:
   0x00000000004000b0 <+0>: movabs rax,0x6000c8
=> 0x00000000004000ba <+10>: mov eax,0x1
   0x00000000004000bf <+15>: mov ebx,0x0
   0x00000000004000c4 <+20>: int 0x80
End of assembler dump.
(gdb) info reg rax
rax 0x6000c8 6291656
(gdb) x/s 0x6000c8
0x6000c8 : "abcdefgh\001"
(gdb) x/8x 0x6000c8
0x6000c8 : 0x61  0x62  0x63  0x64  0x65  0x66  0x67  0x68
(gdb) x/2wx 0x6000c8
0x6000c8 : 0x64636261   0x68676665


As you can see, start at address 0x600c8 (location of string character ‘abcdefgh’), the byte order by 4 bytes are:
abcd        efgh
0xdcba    0xhgfe
In ASCII table, a=61, b=62, c=63, d=64, e=65, f=66, g=67 and h=68.
So, it’s correct that Intel and Intel compatible (AMD) are using Little Endian.


by Taufan Lubis on 27 Apr 2020 02:03 PM

20 Apr 2020

Tulisan ini berisi cara singkat bekerja dengan SLiMS, suatu aplikasi otomatisasi perpustakaan yang dapat diunduh dan dipelajari lewat situs https://slims.web.id.

Kali ini akan menjelaskan, apa efeknya apabila kita membuat akun pengguna laman Admin tanpa menambahkan fungsi untuk pengguna tersebut. Fungsi untuk pengguna dapat didefinisikan terlebih dahulu via modul System sub-menu User Group.

Yang terjadi, apabila kita membuat pengguna laman admin tanpa menambahkan fungsi kerjanya, seperti yang terlihat pada gambar di atas. Tidak ada modul yang dapat diakses, karena akun pengguna tersebut tidak "ditugaskan" untuk mengakses modul.

Setelah mendefinisikan fungsi kerja, jangan lupa dicentang ketika membuat akun pengguna laman Admin.

Seperti ditunjukkan pada bagian yang ter-highlight pada gambar di atas. Setelah itu, dapat dipastikan, akun pengguna tersebut dapat mengakses modul-modul yang telah ditetapkan berdasarkan fungsi kerja yang dibuat.

Semoga bermanfaat. SLiMS yang digunakan pada tutorial ini adalah SLiMS 9 Bulian.
by Arif Syamsudin on 20 Apr 2020 07:48 AM

14 Apr 2020

I try to make comparison about Memory Layout between x86-32 bit and x86-64 bit in Linux.

I run 3 different programs, code written in Assembly, C language and python to see how they are loaded into the memory. Then each program I make another 2 copy. So, each language will represent 3 programs.

I use tmux in Linux Terminal, so we can see all programs run together.

Before we start, you have to know the concept behind memory layout in Linux so you will understand what I’m going to explain in this article.

Memory Layout in Linux
For Architecture 32 bit, at the time a program is loaded into memory, all sections of the programs are loaded into each part of the memory. All codes and data which are declared all brought together, even if the source code is separated. The instruction in .text section is loaded into address 0x0804800. Followed by .data section and .bss section. The last address of linux is 0xbFFFFFF.

See the picture below:

In this tutorial, I use AMD processor (Intel compatible). Since the byte order use Little Endian which is start with LSB (lowest significant byte), we have to read the memory from bottom to up.

Virtual Memory Organized
If all programs are loaded in the same location in the memory, why it never over lap each other?
It’s because the program only access the Virtual Memory.
Physical Memory is RAM chip of your computer.
Virtual Memory is the way program think about the memory.
Before a program is loaded in a memory, Linux will search for the empty physical memory that big enough to hold the program. Then it will tell processor to pretend that this memory address is real address of 0x08048000 for the program to stay. After that each program will have it’s own sandbox to play.

Every program will believe that they are stand alone and enjoy all they memory that they have.
So, the address that program believe to use is named Virtual Address meanwhile the real address in the memory chip is named Physical Address.
Process that pointed virtual address to physical address is named Mapping.

Multi tasking in Linux
The Core of Linux is a Block Code that is name Kernel. Memory System is marked as Kernel Space and User Space. Communication in between is handled by System Call. Access to Hardware is limited in software that is run in Kernel Space and only can be done via Kernel Mode Device Drivers.

VDSO (Virtual Dynamically Linked Share Object).
VDSO is memory area allocated in user space for kernel functionalities purpose. It’s kernel mechanism that is used for program to call Kernel Space routines. VDSO use standard mechanism for linking and loading ELF format (Executable and Linkable Format).

Linux System Call
Linux system call is API (Application Program Interface) that connect User and Kernel.

How to use system call?
-Put system call number in EAX register.
-Input arguments in EBX, ECX, EDX, ESI, EDI or EBP register.
-Call interupt 80h (0x80).
-Usually the result will be returned to EAX register.

How do we know which registers are needed for each System Call?
Every architecture will define ABI (application binary interface) which basically will tell ‘first argument’ will go here, ‘second argument’ will go there, return value will go here.

How do we know that this System Call will go to which machine?
You can check the source here: http://syscalls.kernelgrok.com/

This system calls are registered here:

darklinux@darklinuxpc:/usr/include/x86_64-linux-gnu/asm$ cat unistd_64.h
#ifndef _ASM_X86_UNISTD_64_H
#define _ASM_X86_UNISTD_64_H 1
#define __NR_read 0
#define __NR_write 1
#define __NR_open 2
#define __NR_close 3
#define __NR_stat 4
#define __NR_fstat 5
#define __NR_lstat 6
#define __NR_poll 7
#define __NR_lseek 8
#define __NR_mmap 9
#define __NR_mprotect 10

The location will be different based on your computer architecture and linux version.
Now, let’s see the different between 32bit and 64bit.

Architecture 32 bit.
-all programs code are loaded into the same memory address, x08048000. No matter it was written in Assembly, C or python.
-program code location is above stack.
-supporting library is above vdso (virtual dynamic shared object).
-vdso and stack only
-no heap

Program written in Assembly Language.

$ ps aux | grep keypress
1000 4422 0.0 0.0  148   4 pts/1 S+ 10:22 0:00 ./keypressasm1
1000 4423 0.0 0.0  148   4 pts/3 S+ 10:22 0:00 ./keypressasm2
1000 4425 0.0 0.0  148   4 pts/4 S+ 10:22 0:00 ./keypressasm3
1000 4443 0.0 0.0 4156 508 pts/2 S+ 10:24 0:00 grep --color=auto keypress
$ cat /proc/4422/maps
00b3e000-00b3f000 r-xp 00000000 00:00 0          [vdso]                                                                       
08048000-08049000 r-xp 00000000 08:07 921304     /home/darklinux/keypressasm1                                                 
08049000-0804a000 rwxp 00000000 08:07 921304     /home/darklinux/keypressasm1                                                 
bff6f000-bff90000 rwxp 00000000 00:00 0          [stack]
$ cat /proc/4423/maps
00b8b000-00b8c000 r-xp 00000000 00:00 0          [vdso]                                                                       
08048000-08049000 r-xp 00000000 08:07 939943     /home/darklinux/keypressasm2                                                 
08049000-0804a000 rwxp 00000000 08:07 939943     /home/darklinux/keypressasm2                                                 
bfded000-bfe0e000 rwxp 00000000 00:00 0          [stack]
$ cat /proc/4425/maps                            
0095f000-00960000 r-xp 00000000 00:00 0          [vdso]                                                                       
08048000-08049000 r-xp 00000000 08:07 939963     /home/darklinux/keypressasm3                                                 
08049000-0804a000 rwxp 00000000 08:07 939963     /home/darklinux/keypressasm3                                                 
bfb06000-bfb27000 rwxp 00000000 00:00 0          [stack]                                                                      


Program written in C Language.

$ ps aux | grep keypress
1000      4484  0.0  0.0   1820   248 pts/1    S+   10:31   0:00 ./keypressc1             
1000      4485  0.0  0.0   1820   244 pts/3    S+   10:31   0:00 ./keypressc2             
1000      4486  0.0  0.0   1820   244 pts/4    S+   10:31   0:00 ./keypressc3             
1000      4497  0.0  0.0   4156   508 pts/2    S+   10:32   0:00 grep --color=auto keypress
$ cat /proc/4484/maps
00209000-00227000 r-xp 00000000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
00227000-00228000 r--p 0001d000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
00228000-00229000 rw-p 0001e000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
00737000-008ad000 r-xp 00000000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
008ad000-008af000 r--p 00176000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
008af000-008b0000 rw-p 00178000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
008b0000-008b3000 rw-p 00000000 00:00 0                                                   
00e6a000-00e6b000 r-xp 00000000 00:00 0          [vdso]                                   
08048000-08049000 r-xp 00000000 08:07 939981     /home/darklinux/keypressc1               
08049000-0804a000 r--p 00000000 08:07 939981     /home/darklinux/keypressc1               
0804a000-0804b000 rw-p 00001000 08:07 939981     /home/darklinux/keypressc1               
b7702000-b7703000 rw-p 00000000 00:00 0                                                   
b7713000-b7717000 rw-p 00000000 00:00 0                                                   
bfc2c000-bfc4d000 rw-p 00000000 00:00 0          [stack]
$ cat /proc/4485/maps
00165000-00166000 r-xp 00000000 00:00 0          [vdso]                                   
00b69000-00b87000 r-xp 00000000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
00b87000-00b88000 r--p 0001d000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
00b88000-00b89000 rw-p 0001e000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
00d33000-00ea9000 r-xp 00000000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
00ea9000-00eab000 r--p 00176000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
00eab000-00eac000 rw-p 00178000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
00eac000-00eaf000 rw-p 00000000 00:00 0                                                   
08048000-08049000 r-xp 00000000 08:07 939982     /home/darklinux/keypressc2               
08049000-0804a000 r--p 00000000 08:07 939982     /home/darklinux/keypressc2               
0804a000-0804b000 rw-p 00001000 08:07 939982     /home/darklinux/keypressc2               
b7787000-b7788000 rw-p 00000000 00:00 0                                                   
b7798000-b779c000 rw-p 00000000 00:00 0                                                   
bfc63000-bfc84000 rw-p 00000000 00:00 0          [stack]
$ cat /proc/4486/maps
00241000-0025f000 r-xp 00000000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
0025f000-00260000 r--p 0001d000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
00260000-00261000 rw-p 0001e000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so           
0088e000-0088f000 r-xp 00000000 00:00 0          [vdso]                                   
00d97000-00f0d000 r-xp 00000000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
00f0d000-00f0f000 r--p 00176000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
00f0f000-00f10000 rw-p 00178000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so         
00f10000-00f13000 rw-p 00000000 00:00 0                                                   
08048000-08049000 r-xp 00000000 08:07 939983     /home/darklinux/keypressc3       
b7877000-b7878000 rw-p 00000000 00:00 0                                                   
b7888000-b788c000 rw-p 00000000 00:00 0                                                   
bfd66000-bfd87000 rw-p 00000000 00:00 0          [stack]                                  


Program written in Python Language.

$ ps aux | grep keypress               
1000      4650  0.0  0.1  10304  3640 pts/1    S+   10:56   0:00 python keypresspy1.py                                    
1000      4664  0.0  0.1  10304  3632 pts/3    S+   10:56   0:00 python keypresspy2.py                                    
1000      4675  0.0  0.1  10304  3636 pts/4    S+   10:57   0:00 python keypresspy3.py                                    
1000      4693  0.0  0.0   4156   512 pts/2    S+   10:58   0:00 grep --color=auto keypress                               
$ cat /proc/4650/maps
00120000-002ad000 r-xp 00000000 08:07 6292399    /lib/i386-linux-gnu/libcrypto.so.1.0.0                                   
002ad000-002bb000 r--p 0018c000 08:07 6292399    /lib/i386-linux-gnu/libcrypto.so.1.0.0                                   
002bb000-002c1000 rw-p 0019a000 08:07 6292399    /lib/i386-linux-gnu/libcrypto.so.1.0.0                                   
002c1000-002c4000 rw-p 00000000 00:00 0                                                                      
00591000-00707000 r-xp 00000000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so                                         
00707000-00709000 r--p 00176000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so                                         
00709000-0070a000 rw-p 00178000 08:07 6292391    /lib/i386-linux-gnu/libc-2.13.so                                         
0070a000-0070d000 rw-p 00000000 00:00 0                                                                      
00a58000-00a5a000 r-xp 00000000 08:07 6292467    /lib/i386-linux-gnu/libutil-2.13.so                                      
00a5a000-00a5b000 r--p 00001000 08:07 6292467    /lib/i386-linux-gnu/libutil-2.13.so                                      
00a5b000-00a5c000 rw-p 00002000 08:07 6292467    /lib/i386-linux-gnu/libutil-2.13.so                                      
00b7e000-00bc6000 r-xp 00000000 08:07 6292460    /lib/i386-linux-gnu/libssl.so.1.0.0                                      
00bc6000-00bc8000 r--p 00047000 08:07 6292460    /lib/i386-linux-gnu/libssl.so.1.0.0                                      
00bc8000-00bcb000 rw-p 00049000 08:07 6292460    /lib/i386-linux-gnu/libssl.so.1.0.0                                      
00bf6000-00c1e000 r-xp 00000000 08:07 6292421    /lib/i386-linux-gnu/libm-2.13.so                                         
00c1e000-00c1f000 r--p 00028000 08:07 6292421    /lib/i386-linux-gnu/libm-2.13.so                                         
00c1f000-00c20000 rw-p 00029000 08:07 6292421    /lib/i386-linux-gnu/libm-2.13.so                                         
00c26000-00c27000 r-xp 00000000 00:00 0          [vdso]                                                                   
00d8e000-00da1000 r-xp 00000000 08:07 6292474    /lib/i386-linux-gnu/libz.so.                                      
00da1000-00da2000 r--p 00012000 08:07 6292474    /lib/i386-linux-gnu/libz.so.                                      
00da2000-00da3000 rw-p 00013000 08:07 6292474    /lib/i386-linux-gnu/libz.so.                                      
00ebc000-00eda000 r-xp 00000000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so                                           
00eda000-00edb000 r--p 0001d000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so                                           
00edb000-00edc000 rw-p 0001e000 08:07 6292378    /lib/i386-linux-gnu/ld-2.13.so                                           
00f89000-00fa0000 r-xp 00000000 08:07 6292451    /lib/i386-linux-gnu/libpthread-2.13.so                                   
00fa0000-00fa1000 r--p 00016000 08:07 6292451    /lib/i386-linux-gnu/libpthread-2.13.so                                   
00fa1000-00fa2000 rw-p 00017000 08:07 6292451    /lib/i386-linux-gnu/libpthread-2.13.so                                   
00fa2000-00fa4000 rw-p 00000000 00:00 0                                                                      
00fa8000-00fab000 r-xp 00000000 08:07 6292402    /lib/i386-linux-gnu/libdl-2.13.so                                        
00fab000-00fac000 r--p 00002000 08:07 6292402    /lib/i386-linux-gnu/libdl-2.13.so                                        
00fac000-00fad000 rw-p 00003000 08:07 6292402    /lib/i386-linux-gnu/libdl-2.13.so                                        
08048000-0826b000 r-xp 00000000 08:07 4064093    /usr/bin/python2.7                                                       
0826b000-0826c000 r--p 00222000 08:07 4064093    /usr/bin/python2.7                                                       
0826c000-082c0000 rw-p 00223000 08:07 4064093    /usr/bin/python2.7                                                       
082c0000-082cd000 rw-p 00000000 00:00 0                                                                      
089bf000-08a6d000 rw-p 00000000 00:00 0          [heap]                                                                   
b7544000-b7545000 rw-p 00000000 00:00 0                                                                      
b7545000-b7546000 r--p 002c5000 08:07 4069448    /usr/lib/locale/locale-archive                                           
b7546000-b7746000 r--p 00000000 08:07 4069448    /usr/lib/locale/locale-archive                                           
b7746000-b780c000 rw-p 00000000 00:00 0                                                                      
b781e000-b7820000 rw-p 00000000 00:00 0                                                                      
bfae8000-bfb09000 rw-p 00000000 00:00 0          [stack]                                                                  


64 bit.
-Program code are loaded in different memory lay out.
-For program that is written in Assembly, the address start at x00400000, same for All programs and all program placed above Stack.
-For program that is written in C and Phyton, the address start above Heap, and all at different location.
-There are vvar and vsyscall in the memory layout.

Program written in Assembly Language.

$ ps aux | grep keypress
darklin+  1625  0.0  0.0    160     4 pts/1    S+   19:34   0:00 ./keypressasm1              
darklin+  1626  0.0  0.0    160     4 pts/3    S+   19:34   0:00 ./keypressasm2              
darklin+  1640  0.0  0.0    160     4 pts/4    S+   19:35   0:00 ./keypressasm3              
darklin+  1647  0.0  0.0  22004  1000 pts/2    S+   19:35   0:00 grep --color=auto keypress
$ cat /proc/1625/maps
00400000-00401000 r-xp 00000000 08:03 9437516              /home/darklinux/keypressasm1
00600000-00601000 rwxp 00000000 08:03 9437516              /home/darklinux/keypressasm1
7ffcd4371000-7ffcd4392000 rwxp 00000000 00:00 0            [stack]             
7ffcd43a7000-7ffcd43aa000 r--p 00000000 00:00 0            [vvar]              
7ffcd43aa000-7ffcd43ac000 r-xp 00000000 00:00 0            [vdso]              
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0    [vsyscall]
$ cat /proc/1626/maps
00400000-00401000 r-xp 00000000 08:03 9437518               /home/darklinux/keypressasm2
00600000-00601000 rwxp 00000000 08:03 9437518               /home/darklinux/keypressasm2
7fff2cbf7000-7fff2cc18000 rwxp 00000000 00:00 0             [stack]             
7fff2cd27000-7fff2cd2a000 r--p 00000000 00:00 0             [vvar]              
7fff2cd2a000-7fff2cd2c000 r-xp 00000000 00:00 0             [vdso]              
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0     [vsyscall]
$ cat /proc/1640/maps
00400000-00401000 r-xp 00000000 08:03 9437695               /home/darklinux/keypressasm3
00600000-00601000 rwxp 00000000 08:03 9437695               /home/darklinux/keypressasm3
7ffcabc76000-7ffcabc97000 rwxp 00000000 00:00 0             [stack]             
7ffcabd7f000-7ffcabd82000 r--p 00000000 00:00 0             [vvar]              
7ffcabd82000-7ffcabd84000 r-xp 00000000 00:00 0             [vdso]              
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0     [vsyscall]          


Program written in C Language.

$ ps aux | grep keypress
darklin+  2028  0.0  0.0   4508   736 pts/5    S+   19:58   0:00 ./keypressc1                
darklin+  2029  0.0  0.0   4508   708 pts/7    S+   19:59   0:00 ./keypressc2                
darklin+  2030  0.0  0.0   4508   736 pts/8    S+   19:59   0:00 ./keypressc3                
darklin+  2034  0.0  0.0  22004  1000 pts/6    S+   19:59   0:00 grep --color=auto keypress
$ cat /proc/2028/maps
559a17d6e000-559a17d6f000 r-xp 00000000 08:03 9437453     /home/darklinux/keypressc1
559a17f6e000-559a17f6f000 r--p 00000000 08:03 9437453     /home/darklinux/keypressc1
559a17f6f000-559a17f70000 rw-p 00001000 08:03 9437453     /home/darklinux/keypressc1
559a192e1000-559a19302000 rw-p 00000000 00:00 0           [heap]              
7f26b492f000-7f26b4b16000 r-xp 00000000 08:03 9704064     /lib/x86_64-linux-gnu/libc-2.27.so
7f26b4b16000-7f26b4d16000 ---p 001e7000 08:03 9704064     /lib/x86_64-linux-gnu/libc-2.27.so
7f26b4d16000-7f26b4d1a000 r--p 001e7000 08:03 9704064     /lib/x86_64-linux-gnu/libc-2.27.so
7f26b4d1a000-7f26b4d1c000 rw-p 001eb000 08:03 9704064     /lib/x86_64-linux-gnu/libc-2.27.so
7f26b4d1c000-7f26b4d20000 rw-p 00000000 00:00 0                                              
7f26b4d27000-7f26b4d4e000 r-xp 00000000 08:03 9704036     /lib/x86_64-linux-gnu/ld-2.27.so
7f26b4f4e000-7f26b4f4f000 r--p 00027000 08:03 9704036     /lib/x86_64-linux-gnu/ld-2.27.so
7f26b4f4f000-7f26b4f50000 rw-p 00028000 08:03 9704036     /lib/x86_64-linux-gnu/ld-2.27.so
7f26b4f50000-7f26b4f51000 rw-p 00000000 00:00 0                                              
7f26b4f55000-7f26b4f57000 rw-p 00000000 00:00 0                                              
7ffc225fb000-7ffc2261c000 rw-p 00000000 00:00 0           [stack]             
7ffc227ff000-7ffc22802000 r--p 00000000 00:00 0           [vvar]              
7ffc22802000-7ffc22804000 r-xp 00000000 00:00 0           [vdso]              
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0   [vsyscall]
$ cat /proc/2029/maps
563c7dbdc000-563c7dbdd000 r-xp 00000000 08:03 9437995      /home/darklinux/keypressc2
563c7dddc000-563c7dddd000 r--p 00000000 08:03 9437995      /home/darklinux/keypressc2
563c7dddd000-563c7ddde000 rw-p 00001000 08:03 9437995      /home/darklinux/keypressc2
563c7e6ce000-563c7e6ef000 rw-p 00000000 00:00 0            [heap]              
7fc7583f7000-7fc7585de000 r-xp 00000000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7fc7585de000-7fc7587de000 ---p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7fc7587de000-7fc7587e2000 r--p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7fc7587e2000-7fc7587e4000 rw-p 001eb000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7fc7587e4000-7fc7587e8000 rw-p 00000000 00:00 0                                              
7fc7587ef000-7fc758816000 r-xp 00000000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7fc758a16000-7fc758a17000 r--p 00027000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7fc758a17000-7fc758a18000 rw-p 00028000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7fc758a18000-7fc758a19000 rw-p 00000000 00:00 0                                              
7fc758a1d000-7fc758a1f000 rw-p 00000000 00:00 0                                              
7fffbc268000-7fffbc289000 rw-p 00000000 00:00 0            [stack]             
7fffbc37f000-7fffbc382000 r--p 00000000 00:00 0            [vvar]              
7fffbc382000-7fffbc384000 r-xp 00000000 00:00 0            [vdso]              
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0    [vsyscall]
$ cat /proc/2030/maps  
55ba9b86a000-55ba9b86b000 r-xp 00000000 08:03 9437761      /home/darklinux/keypressc3 
55ba9ba6a000-55ba9ba6b000 r--p 00000000 08:03 9437761      /home/darklinux/keypressc3 
55ba9ba6b000-55ba9ba6c000 rw-p 00001000 08:03 9437761      /home/darklinux/keypressc3 
55ba9d417000-55ba9d438000 rw-p 00000000 00:00 0            [heap]            
7f965beff000-7f965c0e6000 r-xp 00000000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f965c0e6000-7f965c2e6000 ---p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f965c2e6000-7f965c2ea000 r--p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f965c2ea000-7f965c2ec000 rw-p 001eb000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f965c2ec000-7f965c2f0000 rw-p 00000000 00:00 0                                            
7f965c2f7000-7f965c31e000 r-xp 00000000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so 
7f965c51e000-7f965c51f000 r--p 00027000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so 
7f965c51f000-7f965c520000 rw-p 00028000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so 
7f965c520000-7f965c523000 rw-p 00000000 00:00 0                                            
7ffe0c3d4000-7ffe0c3f5000 rw-p 00000000 00:00 0            [stack]           
7ffe0c407000-7ffe0c40a000 r--p 00000000 00:00 0            [vvar]            
7ffe0c40a000-7ffe0c40c000 r-xp 00000000 00:00 0            [vdso]            
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0    [vsyscall]       

Program written in Python Language.

$ ps aux | grep keypress
darklin+  1839  0.0  0.1  33068  6792 pts/1    S+   19:47   0:00 python keypresspy1.py    
darklin+  1845  0.0  0.1  33080  6804 pts/3    S+   19:47   0:00 python keypresspy2.py    
darklin+  1850  0.0  0.1  33080  6800 pts/4    S+   19:48   0:00 python keypresspy3.py    
darklin+  1852  0.0  0.0  22004  1032 pts/2    S+   19:48   0:00 grep --color=auto keypress
$ cat /proc/1839/maps                                                                   
557360ba3000-557360ea4000 r-xp 00000000 08:03 6819458      /usr/bin/python2.7
5573610a4000-5573610a6000 r--p 00301000 08:03 6819458      /usr/bin/python2.7
5573610a6000-55736111c000 rw-p 00303000 08:03 6819458      /usr/bin/python2.7
55736111c000-557361140000 rw-p 00000000 00:00 0                                            
5573630ed000-5573631c0000 rw-p 00000000 00:00 0            [heap]          
7f496da37000-7f496e47b000 r--p 00000000 08:03 6822387      /usr/lib/locale/locale-archive
7f496e47f000-7f496e61c000 r-xp 00000000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f496e61c000-7f496e81b000 ---p 0019d000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f496e81b000-7f496e81c000 r--p 0019c000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f496e81c000-7f496e81d000 rw-p 0019d000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f496e81f000-7f496e83b000 r-xp 00000000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f496e83b000-7f496ea3a000 ---p 0001c000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f496ea3a000-7f496ea3b000 r--p 0001b000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f496ea3b000-7f496ea3c000 rw-p 0001c000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f496ea3f000-7f496ea41000 r-xp 00000000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f496ea41000-7f496ec40000 ---p 00002000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f496ec40000-7f496ec41000 r--p 00001000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f496ec41000-7f496ec42000 rw-p 00002000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f496ec47000-7f496ec4a000 r-xp 00000000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f496ec4a000-7f496ee49000 ---p 00003000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f496ee49000-7f496ee4a000 r--p 00002000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f496ee4a000-7f496ee4b000 rw-p 00003000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f496ee4f000-7f496ee69000 r-xp 00000000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f496ee69000-7f496f068000 ---p 0001a000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f496f068000-7f496f069000 r--p 00019000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f496f069000-7f496f06a000 rw-p 0001a000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f496f06a000-7f496f06e000 rw-p 00000000 00:00 0                                            
7f496f06f000-7f496f256000 r-xp 00000000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f496f256000-7f496f456000 ---p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f496f456000-7f496f45a000 r--p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f496f45a000-7f496f45c000 rw-p 001eb000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f496f45c000-7f496f460000 rw-p 00000000 00:00 0                                            
7f496f467000-7f496f48e000 r-xp 00000000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f496f51b000-7f496f68e000 rw-p 00000000 00:00 0                                            
7f496f68e000-7f496f68f000 r--p 00027000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f496f68f000-7f496f690000 rw-p 00028000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f496f690000-7f496f693000 rw-p 00000000 00:00 0                                            
7ffd4d5fa000-7ffd4d61b000 rw-p 00000000 00:00 0            [stack]           
7ffd4d627000-7ffd4d62a000 r--p 00000000 00:00 0            [vvar]            
7ffd4d62a000-7ffd4d62c000 r-xp 00000000 00:00 0            [vdso]            
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0    [vsyscall]       
$ cat /proc/1845/maps                                                                     
55d2111af000-55d2114b0000 r-xp 00000000 08:03 6819458      /usr/bin/python2.7
55d2116b0000-55d2116b2000 r--p 00301000 08:03 6819458      /usr/bin/python2.7
55d2116b2000-55d211728000 rw-p 00303000 08:03 6819458      /usr/bin/python2.7
55d211728000-55d21174c000 rw-p 00000000 00:00 0                                            
55d2120ac000-55d21217f000 rw-p 00000000 00:00 0            [heap]
7f547b0c7000-7f547bb0b000 r--p 00000000 08:03 6822387      /usr/lib/locale/locale-archive
7f547bb0f000-7f547bcac000 r-xp 00000000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f547bcac000-7f547beab000 ---p 0019d000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f547beab000-7f547beac000 r--p 0019c000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f547beac000-7f547bead000 rw-p 0019d000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f547beaf000-7f547becb000 r-xp 00000000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f547becb000-7f547c0ca000 ---p 0001c000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f547c0ca000-7f547c0cb000 r--p 0001b000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f547c0cb000-7f547c0cc000 rw-p 0001c000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f547c0cf000-7f547c0d1000 r-xp 00000000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f547c0d1000-7f547c2d0000 ---p 00002000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f547c2d0000-7f547c2d1000 r--p 00001000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f547c2d1000-7f547c2d2000 rw-p 00002000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f547c2d7000-7f547c2da000 r-xp 00000000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f547c2da000-7f547c4d9000 ---p 00003000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f547c4d9000-7f547c4da000 r--p 00002000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f547c4da000-7f547c4db000 rw-p 00003000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f547c4df000-7f547c4f9000 r-xp 00000000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f547c4f9000-7f547c6f8000 ---p 0001a000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f547c6f8000-7f547c6f9000 r--p 00019000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f547c6f9000-7f547c6fa000 rw-p 0001a000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f547c6fa000-7f547c6fe000 rw-p 00000000 00:00 0                                            
7f547c6ff000-7f547c8e6000 r-xp 00000000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f547c8e6000-7f547cae6000 ---p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f547cae6000-7f547caea000 r--p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f547caea000-7f547caec000 rw-p 001eb000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f547caec000-7f547caf0000 rw-p 00000000 00:00 0                                            
7f547caf7000-7f547cb1e000 r-xp 00000000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f547cb8b000-7f547ccff000 rw-p 00000000 00:00 0                                            
7f547cd1a000-7f547cd1e000 rw-p 00000000 00:00 0                                            
7f547cd1e000-7f547cd1f000 r--p 00027000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f547cd1f000-7f547cd20000 rw-p 00028000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f547cd20000-7f547cd21000 rw-p 00000000 00:00 0                                            
7ffc30da8000-7ffc30dc9000 rw-p 00000000 00:00 0            [stack]           
7ffc30de7000-7ffc30dea000 r--p 00000000 00:00 0            [vvar]            
7ffc30dea000-7ffc30dec000 r-xp 00000000 00:00 0            [vdso]            
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0    [vsyscall]       
$ cat /proc/1850/maps                                                  
55c645f6f000-55c646270000 r-xp 00000000 08:03 6819458      /usr/bin/python2.7
55c646470000-55c646472000 r--p 00301000 08:03 6819458      /usr/bin/python2.7
55c646472000-55c6464e8000 rw-p 00303000 08:03 6819458      /usr/bin/python2.7
55c6464e8000-55c64650c000 rw-p 00000000 00:00 0                                            
55c6474e7000-55c6475ba000 rw-p 00000000 00:00 0            [heap]            
7f718ff57000-7f719099b000 r--p 00000000 08:03 6822387      /usr/lib/locale/locale-archive
7f719099f000-7f7190b3c000 r-xp 00000000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f7190b3c000-7f7190d3b000 ---p 0019d000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f7190d3b000-7f7190d3c000 r--p 0019c000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f7190d3c000-7f7190d3d000 rw-p 0019d000 08:03 9704127      /lib/x86_64-linux-gnu/libm-2.27.so
7f7190d3f000-7f7190d5b000 r-xp 00000000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f7190d5b000-7f7190f5a000 ---p 0001c000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f7190f5a000-7f7190f5b000 r--p 0001b000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f7190f5b000-7f7190f5c000 rw-p 0001c000 08:03 9704235      /lib/x86_64-linux-gnu/libz.so.1.2.11
7f7190f5f000-7f7190f61000 r-xp 00000000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f7190f61000-7f7191160000 ---p 00002000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f7191160000-7f7191161000 r--p 00001000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f7191161000-7f7191162000 rw-p 00002000 08:03 9704228      /lib/x86_64-linux-gnu/libutil-2.27.so 
7f7191167000-7f719116a000 r-xp 00000000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f719116a000-7f7191369000 ---p 00003000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f7191369000-7f719136a000 r--p 00002000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f719136a000-7f719136b000 rw-p 00003000 08:03 9704087      /lib/x86_64-linux-gnu/libdl-2.27.so
7f719136f000-7f7191389000 r-xp 00000000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f7191389000-7f7191588000 ---p 0001a000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f7191588000-7f7191589000 r--p 00019000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f7191589000-7f719158a000 rw-p 0001a000 08:03 9704196      /lib/x86_64-linux-gnu/libpthread-2.27.so
7f719158a000-7f719158e000 rw-p 00000000 00:00 0                                            
7f719158f000-7f7191776000 r-xp 00000000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f7191776000-7f7191976000 ---p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f7191976000-7f719197a000 r--p 001e7000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f719197a000-7f719197c000 rw-p 001eb000 08:03 9704064      /lib/x86_64-linux-gnu/libc-2.27.so
7f719197c000-7f7191980000 rw-p 00000000 00:00 0                                            
7f7191987000-7f71919ae000 r-xp 00000000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f7191a1b000-7f7191b8f000 rw-p 00000000 00:00 0                                            
7f7191baa000-7f7191bae000 rw-p 00000000 00:00 0                                            
7f7191bae000-7f7191baf000 r--p 00027000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f7191baf000-7f7191bb0000 rw-p 00028000 08:03 9704036      /lib/x86_64-linux-gnu/ld-2.27.so
7f7191bb0000-7f7191bb1000 rw-p 00000000 00:00 0                                            
7ffd70694000-7ffd706b5000 rw-p 00000000 00:00 0            [stack]           
7ffd70747000-7ffd7074a000 r--p 00000000 00:00 0            [vvar]            
7ffd7074a000-7ffd7074c000 r-xp 00000000 00:00 0            [vdso]            
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0    [vsyscall]       

If you want to try, below are the code that I use for this tutorial and how to compile.

Assembly Code
$ nasm -f elf64 keypress.asm -o keypressasm1.o
$ ld keypressasm1.o -o keypressasm1

section .text
 global _start

	;Display Message
	mov eax,4		;syswrite=4
	mov ebx,1		;stdout=1
	mov ecx,msg
	mov edx,lenmsg
	int 0x80		;System Call
	;Wait for keypress
	mov eax,3		;sysread=3
	mov ebx,0		;stdin=0
	mov ecx,key
	mov edx,1		;key length
	int 0x80		;system call
	mov eax,1
	mov ebx,0
	int 0x80
section .data
	msg db 'Press Enter to continue!',0xa
	lenmsg equ $ - msg

section .bss
	key resb 1

C code
$ gcc keypress.c -o keypressc1

int main()
	printf("Press Enter to continue!\n");
	return 0;

Python code

a=input("Press Enter to continue!")


by Taufan Lubis on 14 Apr 2020 12:40 PM

Pandas in Python Library that is used for Data Manipulation and Analysis. It came from terms “Panel Data”. It’s open source under three-clause BSD License. Original developer was Wes McKinney in 2008 while he worked at AQR Capital Management to process Quantitative Analysis on financial data. It was written in Python, Cython and C.

Pandas in mainly used for Machine Learning.

There a lot of features available that you can used for:
-reading and writing various data format, csv, MS excel, json, html, SAS, SPSS, SQL, Google Big Query, Stata, Msgpack etc.
-Group, Join, Merge, Filter, Pivot, Reshaping data set.
-Time series function and so many more.

In this tutorial I use Python 3.6.9 (default, Nov 7 2019, 10:44:02), so the installation command will be: pip3 install pandas.
From Linux terminal type:

$ pip3 install pandas
Collecting pandas
  Downloading https://files.pythonhosted.org/packages/bb/71/8f53bdbcbc67c912b888b40def255767e475402e9df64050019149b1a943/pandas-1.0.3-cp36-cp36m-manylinux1_x86_64.whl (10.0MB)
    100% |████████████████████████████████| 10.0MB 48kB/s 
Collecting python-dateutil>=2.6.1 (from pandas)
  Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting numpy>=1.13.3 (from pandas)
  Downloading https://files.pythonhosted.org/packages/07/08/a549ba8b061005bb629b76adc000f3caaaf881028b963c2e18f811c6edc1/numpy-1.18.2-cp36-cp36m-manylinux1_x86_64.whl (20.2MB)
    100% |████████████████████████████████| 20.2MB 45kB/s 
Collecting pytz>=2017.2 (from pandas)
  Using cached https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil>=2.6.1->pandas)
  Using cached https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, numpy, pytz, pandas
Successfully installed numpy-1.18.2 pandas-1.0.3 python-dateutil-2.8.1 pytz-2019.3 six-1.14.0


Check the Pandas version.
Run python in your Linux Terminal and type the code below:

$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> print(pd.__version__)

The best way to learn Pandas is through command line.
Let’s try.

For example:
we have 2 shapes, 12 circles and 12 triangles.
Circle has 3 blue color, 4 red color and 5 green color.
Triangle has 5 blue, 4 red and 3 green.

Open your Linux Terminal, run python and type the codes below:
$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> data={
... 'circle':[3,4,5],
... 'triangle':[5,4,3]
... }
>>> shape=pd.DataFrame(data)
>>> shape
   circle  triangle
0       3         5
1       4         4
2       5         3


As you can see, Pandas will automatically put the data into column and row and provide the index (0,1,2) for the data set.

To make it easier to read, you can change the index.

>>> shape=pd.DataFrame(data, index=['blue','red','green'])
>>> shape
       circle  triangle
blue        3         5
red         4         4
green       5         3


by Taufan Lubis on 14 Apr 2020 03:28 AM

07 Mar 2020

Sejujurnya saya udah lama banget gak ngikutin perkembangan WordPress. Saya gak paham apa saja fitur-fitur barunya. Hanya sesekali (mungkin 1 atau 2 kali dalam 1 semester) saya login ke blog ini, ataupun ke Labana.ID.

Ketika login, saya melihat notifikasi di sekitar pojok kiri atas, ada beberapa update. Karena kebiasaan di Android “Update All”, di WordPress saya juga melakukan hal yang sama. Saya centang saja semua update Plugins, Themes dan WordPress nya sendiri.

Tapi saya jadi kaget sendiri ketika mau mengedit salah satu tulisan lama saya. Sekarang WordPress ternyata punya fitur semacam Medium. Anda bisa menulis langsung dalam mode “preview” dan disusun dalam mode blok-blok gitu, ala lego.

Agak janggal sih bagi saya. Karena saya termasuk rewel urusan ini. Saya harus tau persis kode HTML yang bisa dipakai kaya apa. Jadi bukan mode WYSIWYG gitu. Atau mungkin karena belum terbiasa aja kali ya.

Ya itu juga kenapa ada tulisan ini sekarang, biar nyobain nulis pake fitur baru blog ini. Pluas biar ada posting perdana di 2020 juga sih. Mudah-mudahan gak kaya kartu SIM Card ya, habis perdana terus buang.

by Okto Silaban on 07 Mar 2020 07:19 PM

19 Feb 2020

by Mahyuddin Susanto on 19 Feb 2020 09:49 AM

Hello world!

Mahyuddin Susanto

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

by Mahyuddin Susanto on 19 Feb 2020 08:42 AM

29 Jan 2020

Mau dibilang update, ya ... memang update sich. kwkwkw. Jadi, sebetulnya saya tidak ingin mencoba memasang pustaka YAZ di mesin yang saya gunakan saat ini. Malas. Namun, karena ada permintaan untuk recreate errors, jadinya, muncullah tulisan ini.

Ok, jadi kita mulai dengan mencari paket yang dibutuhkan untuk pustaka YAZ, di mesin GnU/Linux Fedora. Panduan saya, tetap dari tulisan saya sebelumnya :grin: Tulisan lama, tapi masih relevan. Adapun paket-paket aplikasi yang perlu kita pasang adalah:
  • php-pear;
  • yaz;
  • libyaz;
  • libyaz-devel;
  • libnet;
  • libnet-devel; terakhir
  • php-devel.
Untuk yang terakhir, dibutuhkan untuk mengkompilasi paket YAZ lewat perintah yang akan kita eksekusi, berikutnya, yang setelah kita pasang paket-paket tersebut di atas, pada terminal, masukkan perintah:
# pecl install yaz
Semoga tidak ada kesalahan dalam proses pemasangan, karena kalau sukses, nanti, pada akhir baris proses, muncul kalimat sebagai berikut:
Build process completed successfully
Installing '/usr/lib64/php/modules/yaz.so'
install ok: channel://pecl.php.net/yaz-1.2.3
configuration option "php_ini" is not set to php.ini location
You should add "extension=yaz.so" to php.ini
Lalu, masih sama seperti yang disebutkan dalam tulisan saya sebelumnya, tambahkan baris:
dalam berkas php.ini. Lokasi berkas ini, kalau pada mesin saya, ada di dalam direktori /etc.

Gambar 1. Begini tampilannya kalau di mesin saya

Kalau sudah ditambahkan seperti ini, simpan hasil perubahannya, kemudian mula ulang dua layanan ini:
  1. httpd.service; dan
  2. php-fpm.service.
Setelah memula ulang, silahkan cek via php info, apakah pustaka YAZ sudah termuat oleh sistem.

Gambar 2. Pustaka YAZ yang sudah aktif
Setelah itu, layanan z3950 pada SLiMS bisa digunakan. Demikian, semoga membantu.
by Arif Syamsudin on 29 Jan 2020 08:13 AM

22 Nov 2019

Ternyata, tidak selamanya, barang baru, memberikan kepuasan yang sama, dengan barang yang lama.

Ceritanya, kantor menugaskan sebuah laptop (baru) untuk saya gunakan. Padahal, laptop yang saya gunakan sebelumnya pun tidak ada masalah dan saya senang menggunakannya. Baiklah, mari kita gunakan laptop tersebut.

Kemudian, untuk menghemat penggunaan resource (baca: RAM) pada laptop yang saya gunakan, saya mencoba menghemat segalanya. Termasuk, salah satu hal yang masuk dalam daftar, penggunaan player untuk memutar musik.

Sejak menggunakan Spotify, praktis saya sudah tidak mengunduh (secara fisik berkas) lagu-lagu yang hendak saya dengarkan. Pemutar Spotify yang saya pasang pada sistem operasi yang saya gunakan, rasa-rasanya semakin memberatkan kinerja laptop yang saya gunakan, ketika saya ingin bekerja multitasking. Membuka banyak tab pada peramban serta mendengarkan lagu. Membuka beberapa tab data pada aplikasi penyunting berkas, dan lain-lain.

Beberapa kali saya membaca tentang bagaimana pengguna sisop berbasis GnU/Linux mendengarkan musik melalui cli (command line interface). Kemudian saya mencoba mencari tahu, untuk mencari apa yang bisa saya temukan, terutama bagi saya, penikmat lagu via Spotify. Lalu saya menemukan project ini, tizonia.

Dijalankan via cli, pemasangan aplikasi ini pun cukup mudah. Dengan metode instalasi melalui Snap, Anda sudah tidak direpotkan dengan penambahan repositori. Cukup aktifkan instalasi melalui Snap pada sistem operasi yang Anda gunakan, kemudian Anda tinggal memilih aplikasi apa yang akan Anda pasang melalui repositori Snap.

Pada sistem operasi yang saya gunakan, GnU/Linux Fedora, setelah saya mengkonfigurasikan sistem operasi tersebut untuk terkoneksi ke repositori Snap, untuk memasang tizonia, jalankan perintah:

$ sudo snap install tizonia #Anda akan mendapatkan versi stabil

Setelah terpasang, Anda bisa memulai dengan membaca --help pada aplikasi tersebut.

$ tizonia --help

Apabila Anda pengguna Spotify seperti saya, masukkan perintah:

$ tizonia --help spotify

Anda akan diarahkan pada cara-cara bagaimana mengakses lagu-lagu pada akun Spotify Anda.

Anda harus terdaftar sebagai pengguna Spotify Premium untuk bisa memutar lagu-lagu pada akun Spotify Anda. Setidaknya informasi tersebut yang saya dapatkan pada situs tizonia.

Sebelum mengakses lagu-lagu pada akun Spotify Anda, sebelumnya Anda harus mendefinisikan username dan password yang Anda gunakan untuk mengakses akun Spotify. Konfigurasi tersebut berada dalam berkas tizonia.conf di dalam direktori ~/snap/tizonia/current/.config/tizonia.

Cari baris konfigurasi akun Spotify, kemudian masukan kredensial akun Spotify Anda.

# Spotify configuration
# -------------------------------------------------------------------------
# To avoid passing this information on the command line, uncomment
# and configure accordingly
spotify.user     = username
spotify.password = password

Setelah itu, simpan perubahan yang sudah dilakukan.

Mari kita mulai mengeksplorasi Spotify. Masukkan perintah:

$ tizonia --help spotify

untuk mendapatkan bantuan tentang akses Spotify pada tizonia. Sebagai contoh, saya menjalankan perintah ini untuk mendapatkan track lagu dari Selena Gomez:

$ tizonia --spotify-artist "Selena Gomez"

tizonia akan memberikan daftar lagu-lagu terkait artis Selena Gomez dan memainkannya.

Untuk mengatur posisi lagu yang diputar, informasinya dapat diakses lewat perintah:

$ tizonia --help keyboard

Sayangnya, masih belum ada opsi untuk memutar secara acak. Semoga pada pengembangan berikutnya, fitur ini bisa diadakan.

Demikian. Selamat bernyanyi dan bergoyang!
by Arif Syamsudin on 22 Nov 2019 12:58 PM

18 Nov 2019


Okto Silaban

Waktu berubah. Cuaca berubah. Tantangan berubah. Kehidupan berubah.
Frekuensi menulis di blog ini juga berubah. Dari ratusan tulisan setahun, ke 3 tulisan setahun. Mudah-mudahan hanya berubah, tidak mati. Sudah 15 tahun usia blog ini. Jangan layu sebelum berkembang. Menualah bersama.

by Okto Silaban on 18 Nov 2019 08:24 AM

04 Nov 2019

Lately my contribution to open source projects seems lacking. No more time to rekindle my passion on coding. Even my translation efforts suffers. Fortunately for GNOME translation into Indonesian, Kukuh Syafaat has been taking great effort to keep translation percentage 100%. Very big kudos to him! So when we have a big GNOME event in Gresik, GNOME Asia Summit 2019 on October 11th-13th, I tried
by Andika Triwidada on 04 Nov 2019 01:09 PM

29 Aug 2019

Hi. It's been a long time.

Dimulai dengan keinginan untuk men-downgrade versi MySQL. Ceritanya, saya mau gaya-gaya-an dengan selalu menggunakan versi perangkat lunak terbaru. Termasuk, MySQL ini. Namun ternyata, keterkinian tersebut menghambat saya dalam membantu pengembangan SLiMS.

Proses downgrade pun tidak selalu mulus. Mungkin karena saya memulainya dengan langkah yang tidak tepat. Jadi, semestinya langkah-langkahnya seperti ini:

  1. Non-aktifkan repo MySQL Community Server;
  2. Uninstall versi MySQL versi terkini yang terpasang.
  3. Dan seterusnya.
Oia, saya menggunakan Fedora 30. Ketika saya sudah menon-aktifkan repo, kemudian saya pasang ulang kembali MySQL-nya, via repo default Fedora, pesan galat masih saja muncul. Saya masih tetap tidak bisa menjalankan layanan MySQL.

Kemudian, hasil bacaan "journalctl -xe" begini:

Bolak balik lepas, pasang, lepas, pasang paket, hasilnya begitu aja. Sampai akhirnya saya menemukan, kurang lebih solusinya, di sini, https://tinyurl.com/yyqv28wy. Thread lama. 2014. Tapi masih relevan. Masuk akal. Karena saya sempat berfikir, mesti harus ada yang dibersihin dari pemasangan sebelumnya. Tapi saya nggak bisa menerka-nerka, apa yang harus dibersihkan. Hahaha.

Solusinya? Bersihkan pangkalan data dari pemasangan sebelumnya. Kalau memang ada, pangkalan data yang berada di dalam direktori /var/lib/mysql. Peringatan dalam thread tersebut sederhana, kalau memang pangkalan data yang ada di dalam direktori tersebut tidak dianggap penting, silahkan hapus. Jadi catatannya, backup sebelum dihapus.

Memang tokcer sich, cara yang disarankan pranala tersebut. Jadi:
  1. systemctl stop mariadb.service;
  2. dnf remove mariadb-server;
  3. cd /var/lib && rm -rfv mysql;
  4. dnf install mariadb-server.
Perintah nomor 3 sich yang petjah. Setelah semua pangkalan data dari pemasangan berikutnya dibersihkan, akhirnya layanan mariadb bisa berjalan dengan lancar lagi. Oia, perintah-perintah tersebut di atas dieksekusi dengan user root ya.

Gitu deh. Senang rasanya. Semoga bermanfaat. Kalau ada saran atau perbaikan atau metode yang lebih baik, silahkan tuliskan dalam komentar ya. Terima kasih.
by Arif Syamsudin on 29 Aug 2019 03:43 PM

28 Mar 2019

PowerPoint is the most appealing programming for introduction. In spite of the fact that there is some other programming that is likewise intended for execution, PowerPoint is as yet the most open programming to utilize. A few people are searching for web video player PowerPoint Mac. There are a few things you can think about […]
by Andrecht on 28 Mar 2019 05:53 AM

14 Mar 2019

Sebetulnya yang saya lakukan ini hanya untuk mesin percobaan/eksperimen. Beberapa bahan bacaan yang saya pernah ikuti menyarankan untuk tidak menggunakan XAMPP sebagai bagian dari mesin produksi. Cmiiw. Tapi bisa jadi, mungkin saja, ada yang tidak ingin repot-repot melakukan konfigurasi pada mesinnya dengan menggunakan XAMPP sebagai perangkat lunak peladen web.

Sebagai catatan, phpMyAdmin yang sudah diamankan dalam tulisan ini tetap tidak akan bisa diakses melalui jaringan, karena secara baku, phpMyAdmin dalam XAMPP tidak diizinkan, lewat konfigurasinya, untuk diakses dalam jaringan. Apa yang dipaparkan dalam tulisan ini hanya cara bagaimana cara menyetel password pengguna root pada akses MySQL dalam XAMPP serta korelasinya dengan phpMyAdmin.

Sebetulnya, cara untuk memasang password pada pengguna root MySQL sudah disediakan dalam HOW-TO guides yang diberikan pada laman dashboard (localhost/dashboard). Dalam tautan HOW-TO guides tadi, silahkan klik tautan dengan judul, "http://localhost/dashboard/docs/reset-mysql-password.html."

Ketika kita sudah mendefinisikan password untuk pengguna root MySQL pada XAMPP, biasanya, kejadiannya, phpMyAdmin kemudian tidak bisa diakses dan muncul pesan galat pada peramban, seperti ini:

Gambar 1. Pesan galat setelah pengguna root diberikan password

Kemudian, bagaimana caranya supaya phpMyAdmin bisa diakses kembali dalam localhost dengan kondisi pengguna root sudah diberikan password? Pernah dengar adminer? Adminer memiliki fungsi seperti phpMyAdmin. Bisa mengakses data MySQL lewat peramban. Tinggal pasang adminer, selesai. Tetapi, ada saja yang tidak nyaman menggunakan adminer. Lebih familiar menggunakan phpMyAdmin, katanya.

Kembali ke pertanyaan awal, bagaimana? Caranya, silahkan buka berkas config.inc.php yang berada di dalam direktori phpMyAdmin pada XAMPP. Cari baris ini:
$cfg['Servers'][$i]['auth_type'] = 'config';
kemudian ubah menjadi seperti ini:

$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
Simpan perubahan yang dilakukan, kemudian segarkan tautan phpMyAdmin yang memberikan pesan galat tadi. Hasilnya nanti seperti ini:

Gambar 2. phpMyAdmin bisa diakses kembali dengan memasukkan password

phpMyAdmin telah dapat diakses dalam localhost menggunakan password yang telah kita setel sebelumnya.

Demikian, semoga membantu. Silakan tulis pada komentar apabila ada yang perlu ditambahkan atau diperbaiki pada tulisan ini. Terima kasih.
by Arif Syamsudin on 14 Mar 2019 11:18 AM

22 Feb 2019

Currently I used OpenSUSE as my operating system, so to fix the issue as the title of this post is I'll modified the MySQL config at /etc/my.cnf. Open up the my.cnf config and go find the [client] section and uncomment these 2 lines below:
# port       = 3306
# socket = /run/mysql/mysql.sock
Don't forget to change mode the my.cnf config file to 600, so just only you can edit it.
# chmod 600 my.cnf
To take effect, please restart mysql service.
# service mysql start
Now you can connect to mysql client by this command
# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.2.15-MariaDB openSUSE package

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Let say you haven't set the root password yet, you could reset/set a new root password with this following step below.
MariaDB [(none)]> show databases;
| Database |
| information_schema |
| mysql |
| performance_schema |
| test |
4 rows in set (0.00 sec)

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [mysql]> show tables;
| Tables_in_mysql |
| user |
30 rows in set (0.00 sec)
Now set a new root password
MariaDB [mysql]> update user set password=PASSWORD("YOUR_NEW_PASSWORD") where User='root';

Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
And then tells MySQL to put the new changes.
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
After all steps above done, you can now test it to connect to MySQL client with password that you've created.
# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.2.15-MariaDB openSUSE package

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
That's all.
by Darmanex on 22 Feb 2019 05:48 AM

21 Feb 2019

Dulu saya pernah mengalami bekerja belum/tidak mendapat jatah komputer bertampilan grafis. Namun, saya dapat hak akses komputer yang dijadikan server kecil yang hanya punya tampilan teks saja. Mau tidak mau mengakses apapun berbasis teks, termasuk membuka situs web.

Untuk membuka situs web diantaranya menggunakan links, lynx dan curl. Naahh.... Curl ini juga bermanfaat saat untuk mengakses sebuah Captive Portal. Supaya tidak lupa saya catat cara mengakses internet yang menggunakan Captive Portal menggunakan Curl, curl -d "username=UserKamu&Password=PassKamu&submit=Login" --dump-header headers -k https://internet.gratis/login. Perintah ini juga bermanfaat kemarin saat pelatihan di hotel yang menggunakan Captive Portal dan mainan VirtualBox dengan jaringan mesin virtual yang ter-bridge.
by Dedy Hariyadi on 21 Feb 2019 03:26 AM

28 Dec 2018

Liburan Bakal Mengular?

Dedy Hariyadi

Yup, mengular... Sebenarnya ini hanya sekadar judul tentang keresahan setelah sekian lama tidak membuka dan/atau menulis blog. Diawali dengan permasalah pada Python. Tentu bukan ular Python, sekadar logo saja. Mungkin karena kecerobahan saya install sana-sini gak jelas maka saya menjumpai galat semacam ini.
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'
Buka sana-sini tidak ada solusi. Namun, akhirnya menemukan solusinya. Jika menemukan permasalahan seperti diatas maka cukup jalankan perintah sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall.

Selamat berlibur....
by Dedy Hariyadi on 28 Dec 2018 08:26 AM