Configuring FTP and Reading Markdown Parser
836 words | 5 minutes

That day I become very less productive, because I don’t know what to do after I almost finish my blog, the last step is how I sync the written notes on my android and my PC. After I became stressed because normal ftp on my Linux machine is doesn’t support Glob. I am trying to use Python FTP instead, well that is unexpected because normally I leave python for anything. Somehow the module is work as expected, It support for glob, more importantly with great python functionality, it will be fine for larger data.

Playing with FTP

For connecting to normal ftp on Linux is pretty simple, just use ftp host port and for more option you can see on man ftp. After I can connect to my ftp that got setup on my android using Cx File Explorer, I also using mget command with glob, but somehow it doesn’t work as expected. I am confused because it showing error that I can’t use glob to get data from my ftp. After wandering around how to get list of file as txt and also using for in zsh, This method also doesn’t work as I am expected.

Giving up and reading some question on stackoverflow, finally I am using python library. How to connect to the ftp is pretty simple, can be shown in the below code :

from ftplib import FTP

host = 'your-host'
port = 1234 # This is number data type
user = 'username'
pass_usr = 'your-pass'

ftp = FTP()
ftp.connect(host, port)
ftp.login(user, pass_usr)

Pretty simple, and now you can connect to your ftp, after that this can’t be done by done by normal ftp, so that’s why I am using python library. This script is showing how get list of file in one of directory :

for file i ftp.nlst():
    with open("your-local-file-name", "wb") as f:
        ftp.retrbinary(file, f.write)
# Don't forget to disconnect ftp
ftp.quit()

Before I realize it, I am just using mget and get file name locally with just using copy paste with ls ftp command. Well, that is pretty bad experience though but I am learning a lot from it.

Regret of Opera Sync Data

After eating after fasting, I want to test opening my synced folder on opera. I can see my old data in there with my laptop. The part when I am regretting is that I am still doesn’t save it to my disk before uninstall opera on my android. Suddenly I am realize the data on the server is deleted because I uninstalled my opera. That is pretty though bad experience for me. I am stopped using opera as my android browser after knowing that soul browser is pretty good. It has many functionality and the settings is easily customized.

The data is I can’t get back again. I am right now just got regret because of that and I got my learning lesson from this :

Don’t be satisfied until your goal is achieved.

That is good quote for expressing this very bad experience. Right now the old data can’t be downloaded, I must straight forward about it and trying to forget the data on that android. Even though it is hard to be done.

Reading about Latex and Markdown Parser

I am just want to learn latex, after I am successful deploy my blog. I found many good resource to learn. First, I must configure neovim to become latex editor. I found good plugin for it, the name is vimtex and such a good latex engine named as tectonic, suprising the technology improved so much. Even though I never learn latex before, but somehow I know that this technology improved so much in recent days.

I just wanna install it someday, and I hope that I can fluency write document in latex, and knowing all of the feature that exist on latex. I also wondering if I can make pdf document by writing on markdown. My workflow is divide the markdown by adding divider that defined by class on HTML. Every single class represent a single page of the document that can be customized margin or line space by CSS. Markdown document then converted to HTML by markdown parser, then we can easily customize it by CSS. If this can be happen it wil become harmony.

So, I decide to read markdown parser project. The most possible project that can achieve this goal is kramdown that written in ruby, and goldmark that written in golang. After we can write the document, then we can convert it to pdf with wkhtmltopdf. If this can be achieved then I don’t think must learn latex, but I decide to learn latex for knowing what feature that latex has but markdown doesn’t has. Hope I can achieve it someday if I have time, because my mother always angry to me, because he doesn’t know what I am doing until now.