The adventures of Ademhttps://adem.ayt.acMaceralarım ve düşüncelerimDisplayLink kernel update on Manjarohttps://adem.ayt.ac/p/2024-10-09_displaylinkhttps://adem.ayt.ac/p/2024-10-09_displaylinkWed, 09 Oct 2024 11:00:00 GMT

It's been a while that I use Manjaro, my laptop has two usb-c ports, one usb-a and one jack port. When I'm on my desk I'm connecting to a docking station, to handle all the display, usb stuff. (Message to myself: In a separate post, I write down my hardware, software and desktop setup, if I find the courage and don't forget to don't)

Recently I updated my system, during the update linux kernel also got updated, but the problem is that the linux-header packages aren't included in this update.

Normally this wouldn't be an issue, but since my docking station is DisplayLink device, so I need to install 2 packages from aur "evdi" and "display-link". (In the past I had some issues, so I installed "evdi-git")

systemctl status displaylink.service showed that there was an error, so the service couldn't start.

journalctl -xeu displaylink.service showed this specific issue modprobe: FATAL: Module evdi not found in directory /lib/modules/6.10.11-2-MANJARO

I tried to search on internet for a solution, some people using Arch were also having this issue, so they downgraded evdi to version 1.14.6 and it got fixed.

I removed evdi-git and displaylink(because evdi is a breaking dependency of displaylink package)

pamac remove evdi-git displaylink
pamac install evdi displaylink

During the installation of the packages, I noticed that the install process is calling

dkms install --no-depmod evdi/1.14.6 -k 5.15.167-1-MANJARO
dkms install --no-depmod evdi/1.14.6 -k 6.6.52-1-MANJARO

As you can see the evdi module didn't get installed for the last kernel.

I run the code myself using my latest kernel, I received this error message

dkms install --no-depmod evdi/1.14.6 -k 6.6.52-1-MANJARO

But got another error instead.

Error! Your kernel headers for kernel 6.10.11-2-MANJARO cannot be found at /usr/lib/modules/6.10.11-2-MANJARO/build or /usr/lib/modules/6.10.11-2-MANJARO/source

And the error also suggested that I install the linux-headers for that kernel version if I want to use it.

To get the installed versions package name I did pacman -Q | grep -e "linux6", this command returned all the packages installed that contained linux6

linux610 6.10.11-2
linux66 6.6.52-1
linux66-headers 6.6.52-1

So I run pacman -S linux610-headers, which executed dkms command with latest kernel version as well.

Then I run xrandr --listproviders, which didn't showed the monitors connected to docking station

Then I tried systemctl start displaylink.service, which started the service and I just saw that my laptop monitor flashed for a moment and my main monitor opened(but didn't showed anything yet).

Then I re-run xrandr --listproviders, now it showed my main monitor. So I finally got it working again.

This issue solved my displaylink problem on my Manjaro system. (Another message to myself: "write another blogpost about what I feel using displaylink")

Most of the commands are run with sudo.

Kind regards

Social stuffhttps://adem.ayt.ac/p/2021-03-15_2_social_stuffhttps://adem.ayt.ac/p/2021-03-15_2_social_stuffMon, 15 Mar 2021 22:30:00 GMT

There are times, I stop writing for a very long time, a lot happens, but I don't know what to write, where to start, so I don't write anything at all. Then there are some times, nothing special happens and I start writing multiple blogposts, which is mostly incomplete, or contains typo's. And one more thing, not all my posts are in English, so I write in the language I feel at that moment.

It's the same for my accounts on other (social) platforms. On some I didn't posted or answered for about a year or more. I added my social profiles on the bottom of my blog, also to keep me remind that I have those. PM send from those platforms will be forwarded to my email, which I try to answer in 24h.

I try to plan, (which is a big word, even for me), to restructure all my projects, files, life and profiles on platforms.

My company website(which is just a contact card of my company) and my blog are done for the moment. I also re-added rss support for my blog, which is a static xml page without extension, generated at build-time. This is a simple solution to publish rss, and I like that it is so simple.

Next thing to develop are Twitter and maybe LinkedIn integrations, so whenever I publish a blogpost, it will also be published on those platforms. One thing I dont like about developer accounts on those platforms are, the mandatory phonenumber check, to verify that I'm a human and not robot. And maybe add the ability to use icons or emoji's in my blogposts.

I also need to create a portfolio(or projects) page, but how to style it or which one should I add. Those are the FAQ in my head I ask myself, when trying to do something like that.

Kind regards

Making my blog source code publically availablehttps://adem.ayt.ac/p/2021-03-15_1_making_blog_repo_publichttps://adem.ayt.ac/p/2021-03-15_1_making_blog_repo_publicMon, 15 Mar 2021 20:00:00 GMT

Yesterday, I passed time with my daughter(dancing, playing, making music, singing, watching animated movies), then decided to recreate my blog, because it was offline and as I mentioned in my previous post, a building of the hosting company, hosting my web server burned down. About couple of hours was needed to recreate my blog in new tech I just learned(Next.js, TailwindCSS) and host it easily(Netlify.com).

But I decided to create a private repo at first, which is mainly my start point for every project. First private, test thing out, if it fails, it stays hidden in the dark, if it's shareable, make it available to public :).

Today, I told a friend about my blog I recreated, but didn't showed the source yet. So after a while, I decided to make the repo publicly available, as it is a "shareable" project now.

This is the link https://github.com/aytacworld/adem.ayt.ac.

If you have any suggestions or improvement, feel free to contact me.

Kind regards

Blog updates 4https://adem.ayt.ac/p/2021-03-14_blog_updates_4https://adem.ayt.ac/p/2021-03-14_blog_updates_4Sun, 14 Mar 2021 22:00:00 GMT

Again a startover of my blog. I don't know if I will ever have a final version.

This time, I rebuild it using Next.js and hosted it on Netlify.com. Next.js is a framework build on top of React. As a long time Angular developer, I wanted to learn a second tool in Javascript, and decided to use React. But my main problem is, that I don't have a project to test it on. So I decided to create a dummy restaurant app with it.

While trying to find time to start the project. A building of the hosting company where my blog, git, cloud servers are hosted, burned down and I lost all of them. Without backup I lost most of my projects, files, content. Luckely my cloud files are also backed up on my drive, and most of my projects are also hosted on github. But some of them aren't... So I changed my goal to (re)build my blog using React, and host it on a provider. My options were Heroku, Netlify, Vercel. I already knew Heroku, so wanted to try something new, and Netlify is chosen.

But I'm still new to React, so I wanted to have a working routing system, and a friend suggested Next.js, so I followed this tutorial. And did the same blog, but start changing code to create the same layout as before. But this time, no plain css or bootstrap, and again, I wanted to use something I didn't used before. And for styling I used TailwindCSS. It's easy and nice, but need to spend more time with it.

The overal view is the same, and without javascript enabled, just little style changes. The sourcecode is hosted on Github, but currently as a private repository.

Kind regards

New Beginninghttps://adem.ayt.ac/p/2020-11-26_new_beginninghttps://adem.ayt.ac/p/2020-11-26_new_beginningThu, 26 Nov 2020 21:25:00 GMT

It's been 6 months since my last post. Lot have happened since then.

I started working in a chocolate factory at night, I had to wear clean uniform, and change my shoe, wear facemask, hearnet, gloves, put my clothes and phone in a locker. So I only had the locker key and a badge in my pocket.

It's mostly repetitive work, but I like to work there, after working for a whole month, I found another job to work during day. But didn't stop working at night on Fridays at the factory.

While working at the factory, I had a lot of time to think and create idea's. At the same time I was lucky to see how the system was automated, and was thinking on how to further improve this automation. Then suddenly, I started to compare the automation in the factory with writing code. I've been Frontend/Angular developer for about ~3 years now and I'm using rxjs(Observables, Streams, ...). I started to think about the automation in factory if it was rxjs operator.

Then I was thinking further, and decided to create a "virtual" factory, but I had so many different projects and idea's, so where do I begin. Why not one of my existing projects and mix it up with the new idea's I have? So I started to brainstorm about it.

In my next post I'll write about a project more in detail.

Stay well and have a nice evening.

Kind regards

Closing libreshophttps://adem.ayt.ac/p/2020-05-18_closing_libreshophttps://adem.ayt.ac/p/2020-05-18_closing_libreshopMon, 18 May 2020 14:00:00 GMT

Yes, it is true, Libreshop is closing.

8 months ago, I started this project with enthousiasm and with the purpose of helping as much people as possible by providing cheap privacy respecting hardware.

At beginning, it was difficult, but it was okay, after a while, it got easier to maintain this.

I had lot's of idea's to improve this webshop, but also the core business of Libreshop, but I didn't manage to find the time to improve. Other projects got higher in the priotity list, which made it extra hard to find time for this project.

Then the sales stopped, and the little time I used to maintain become also some time I could spare to do other projects.

At the end, I didn't had orders or time, and a little supply. It didn't made sense to keep the whole setting up and running, with no one interested.

I decided to keep the remaining products for spare parts or try to build them with what I got and donate to charity.

From today, I'm not taking any orders.

This website is going to be closed after a while. If there are people interested in this domain as well, you can contact me.

Stay well and have a nice weekend.

Kind regards

Sax festivalihttps://adem.ayt.ac/p/2020-02-09_sax_festivali_parca2https://adem.ayt.ac/p/2020-02-09_sax_festivali_parca2Sun, 09 Feb 2020 21:50:00 GMT

Bu sene Los Turcos derneǧinin 100üncü yıldönümü, festival her sene olduǧu gibi 1 şubattan 5 şubata kadar sürdü. Ben ilk defa katıldım, ve beklentimin üstünde bir sevinçle geri döndüm.

Önceki yazımda belirtiǧim bazı durumlardan dolayı, gezi kötü geçti zannetmeyin, tam aksine çok iyi geçti. Önceki yazım, elçilikte çalışan, terbiyesizler'in yaptıklarıydı. Bu yazımda, o gün yapılan terbiyesizlikleri bir kenara bırakıp, festivalde neler olduǧunu, hangi duygular yaşadıǧımı yazıyorum.

Herşey çok güzel geçti. Dilde biraz sıkıntı yaşasakta, herkez bizi dostu veyahut kardeşi gibi görüyor, 10 adımlık yolda, 10 defa yemek ve içmek için davet ediliyorduk.

Türkçe konuşmasalar bile, Türklük içlerine işlemiş bir toplum ile karşılaştım. Her konuştuǧum kişinin bana ilk olarak söylediǧi "Sizin burda bizim festivalimize katılmanızdan şeref duyuyorum". Bu öyle kolay söylenecek bir söz deǧildir. Bu cümleyi söylerken dahi, bize bu duyguyu hissettirmeleri, benim için çok büyük bir şereftir.

Din, dil, ırk ayırmadan, festivallerini kutluyor, ve bizleri memnun etmek için, tüm halk, seferber oluyor. Bende ilk başta ön yargılıydım, "Avrupa kim, Türk sevgisi kim" derdim. Lakin Sax'ta gördüklerim bu görüşümü tamamen deǧiştirdi.

Her gün yürüyüşler gerçekleştirildi, Sax kasabasının her sokaǧı dolaşıldı. Ve hatta Los Turcos derneǧinin davetlisi olarak bizi en ön sıraya aldılar, ve üzerimizde taşıdıǧımız Ay Yıldız bayrak ve Atatürklü bayraklar çok ilgi gördü. Yanımızda yürüyen 94 yaşında bir önceki Los Turcos derneǧi başkanı vardı, ve bize gururla "ben 94 yaşındayım, ve 94 yıldır bir Türküm" diyordu.

Ertesi gün Mehter takımı geldi, ve biz bayraklarımızı takıp mehterin önünde onlara destek amaçlı yürüdük, lakin elçi çalışanları, bizi engellemeye çalışsalar bile(insanları "bunlar politika yapıyor" diye kışkırtarak), genede Sax'lı halk bu oyunlara gelmedi, ve bizi motive etmeye devam ettiler.

Yürüyüşlerin yanında, kasabayı dolaştık, ve her dolaştıǧımızda, gördüǧüm sokaklarda masalar var, ve her masa başında insanlar eyleniyorlardı, ve her evin kapısından girdiǧinde, sanki restoran'a girdiǧini zannedersin, fakat bunlar, normal evlerdi. Ve herkez ikramlarda bulunuyor, bizede gel, bizdede birşey ye ve iç diye yarışıyorlardı.

Umarım bu dostluk, bu kardeşlik bozulmaz, ve bozmaya çalışanlarda asla başarılı olamaz. Bozulmaması için elimden geleni yapmaya hazırım.

Bizi davet eden Los Turcos derneǧi başkanı Francisco Sánchez Chico, "el Tito"ya, ve tüm Sax halkına, Avrupa Atatürkçü Düşünce Dernekleri Birliği genel başkanı Mustafa Tosun ve eşine, Avrupa Türk onursal başkanı babam Ahmet Aytaç'a, Avrupa Türk yönetim kurulu üyesi abim Ismail Aytaç'a ve yanımızda bulunan herkeze sevgi ve saygılarımı iletiyorum.

Türklüǧünden şeref duyan ve ırkçılık yapmadan Türk milliyetciliǧi yapabilen herkezin, Sax'ı ziyaret etmesini ve orda yaşayanlar ile gönül baǧı kurmasını, diliyorum.

Saygı ve sevgi ile kalın

Blog Updates part 3https://adem.ayt.ac/p/2020-02-09_blog_updates_part3https://adem.ayt.ac/p/2020-02-09_blog_updates_part3Sun, 09 Feb 2020 18:45:00 GMT

Once again, I have changed my blog. I created a new repo https://git.aytacworld.com/aytacworld/adem.ayt.ac All my posts(md-files) are on a different private repo. That way, draft versions stays offline.

The setup is simple, I'm using a Debian instance, and installed git, curl, nginx, certbot, nvm(node+npm+yarn+pm2), ufw, and added my user. And created 2 script files, 1) update.sh, which will update the system, 2) publish.sh, which will pull the blog repo and the posts repo and restart the blog.

The structure of the md-files stays the same

[//]: # (title: Blog Updates part 3)
[//]: # (tags: blog, git, refactoring)
[//]: # (publishdate: 2020-02-09 18:45:00)
[//]: # (published: true)

text...
...

The only difference is that I don't use the published meta data, I change the extension of the file instead (eg. 2020-02-09_blog_updates_part3.md.unpublished). Once the app starts, the initial function will look for all files with .md extension in my other repo. So adding it, will exclude it from the files list.

No commenting system is used. And tags are only displayed, not used, maybe in future I re-enable them as a feature.

As I create the files starting with date, I didn't apply a sorting method. Listing all files will do it automatically, and iterating backwards will put the latest post as first item.

Navigation is also easy to setup:

  • previous: files[current - 1]
  • current: files[current]
  • next: files[current + 1]

So this is the latest version of my blog

Thanks and take care

Sax festivalihttps://adem.ayt.ac/p/2020-02-04_sax_festivalihttps://adem.ayt.ac/p/2020-02-04_sax_festivaliTue, 04 Feb 2020 00:00:00 GMT

Sax kentindeki Ispanyollar, Ay Yıldız ve Atatürk ile gurur duyuyor ve herkez kendini Türk hissediyor, ve bizim burda olmamızdan çok seviniyorlar. Fakat bazı kanı bozuklar, benim Vatanımın ekmeğini yiyip, bizi mehter takımı'nın yanına dahi yaklaştırmıyor. Atatürk ve Türk bayrağını herkeze politik diye dayamaya çalışıyorlar.

Ben siyaset yapmam ve hiçbir partiye bağlı değilim. Ben Türk milliyetcisiyim, kurt işareti, Türklük sembolüdür, bu işarete olitik veya mhp işareti diyenler, bilgisiz, kültürsüz, geri zekalılardır.

Atatürk, Türkiye Cumhuriyetini kuran kişidir. Onu kabullenemiyenler, ilk olarak, Türklüğünü sorgulasınlar, ve tarihini, tek taraflı değil, her yerden, tarafsız araştırıp, öğrensinler.

"Tarihini bilmeyen kavimler, yok olmaya mahkumdur" Mustafa Kemal Atatürk

Blog Updates p2https://adem.ayt.ac/p/2018-09-30_blog_updateshttps://adem.ayt.ac/p/2018-09-30_blog_updatesSun, 30 Sep 2018 17:32:00 GMT

This is the part 2 of my refactoring journey of my blogging system. You can read here how it all started, and here, how the refactoring is started.

I'm posting today, because a new version is available(I forget to increase the version, but that's okay).

In my previious post I mentioned this todo list:

  • Create a docker image, so I can easily redeploy the app on another server.
  • Use git to store the posts, so it's backed up and versioned.
  • So, if we are using git, why not add the settings/configurations also in git.
  • I can also create some pages like this.

So here I will tell more about, what I did and how it ended, until today.

I skipped the first, third and last, no docker, no settings or other pages for now..., But my posts are now on another git repo, and my application is cloning that repo. And it works, yey :).

To start, I removed the "login" and "edit" pages, and mongo database. So I had an empty webpage. Then I tried git clone operations, with success, expect for pullinga repo... I don't know why it is failing on my server machine...So I fixed it by removing the posts folder and recloning it, this is just a quick fix, and I need to fix the git.pull. And because of that, I even created my own git server with Gogs, I'll write a tutorial on how I did it.

The format of the post is:

[//]: # (title: Blog Updates p2)
[//]: # (tags: blog, git, refactoring)
[//]: # (publishdate: 2018-09-30 17:32:00)
[//]: # (published: true)

text...
...

Once the post repo is cloned, it will loop over every file, and extract those 4 meta information, and spill it in an object:

{
  id: string, // fileName
  title: string, // title or fileName
  tags: [string], // split by ,
  pubDate: Date,
  published: boolean,
  body: string,
}

This object is saved in a database object(currently in-memory), so every time someone requests the posts, it will be delivered from the database object instead of going through all the files again.

So, what if the server crashes or I upload a new post or update an existing post or delete a post? With current setup, it's easy, but not really performant. If the server reboots, the database object is empty, and is going through every file again and extract the data. If the repository is modified(add/edit/delete), again, the process of going through every file and extracting data is performed and de database object is overwritten.

In the future, I'll update this to be more performant and use a real database.

But this is my current setup.

Thanks and take care

Git Backuphttps://adem.ayt.ac/p/2018-08-27_git_backuphttps://adem.ayt.ac/p/2018-08-27_git_backupMon, 27 Aug 2018 00:00:00 GMT

Some days ago, I updated my kernel. Then I worked on it, and shut it down. After a while, I restarted the laptop, but it freezed and I didn't know why...

I was able to use tty screens, so I plugged an usb flashdrive to copy all my documents. But then suddenly the usb drive was corrupt. So I needed to fix that first, which I did, by formatting it then I copied a lot of documents, projects, ... to a tiny usb flashdrive.

Then after searching the internet, I found a solution, which was to recompile some kde stuff.

So my files are backed up temporarily. But how am I going to know which files are updated and which aren't for the next time, so I will overwrite each time my backed up files. This will consume lot of time... I know that I need a good backup system.

So why not use git for that. It is incremental, and all files are versioned.

So first open a directory where you want to store your backup, then init git with bare options.

git init --bare

Then go to your folder you want to back up. Clone the folder, and add ".gitignore" file to ignore some files if you want.

At last run the following and your files will be backed up.

git add . && git commit -m "updates" && git push

If need to reverse a file, just use git command to achieve this.

But wait, there is sparkeshare who just do that, and as a plus, it also offers encrypted projects. I didn't use it, but I came it acros when I was looking for an alternative for dropbox or googledrive.

You can also achieve the encrypted part, by running some command from a githook ;)

Thanks and take care

Blog Updateshttps://adem.ayt.ac/p/2018-08-27_blog_updateshttps://adem.ayt.ac/p/2018-08-27_blog_updatesMon, 27 Aug 2018 00:00:00 GMT

On my first post, I mentioned that I wanted to add extra features to my blog. Well, guess what, I'm totally changing it.

One day I wanted to write a post, so I searched a markdown editor, and tried some nice ones. But then, I needed to login, then press "add"-button and fill in the form, copy-paste the markdown. Press save and hope that everything works fine. But it didn't, so I wasn't able to post my own post on my own blogging system...

Ofcourse, you'll say that I have to add some testing to avoid this kind of things. Well, I ignored that part for my blog. And now, I need to debug over and over and fix the app on every fail...

The second thing, that annoyed me, was that I need to fill in the form and refill it if anything goes bad... And copy-pasting from a markdown editor, is not always easy... So I wanted to bypass that step as well.

I want some changes for my blogging system.

If anything goes bad on the server(mongo crashes or the server dies for whatever reason), I will lose my posts. Ok, I can solve this with backup, but I need to configure the server again, and this will take time and motivation...

So couple of things came into my head. Those are:

  • Create a docker image, so I can easily redeploy the app on another server.
  • Use git to store the posts, so it's backed up and versioned.
  • So, if we are using git, why not add the settings/configurations also in git.
  • I can also create some pages like this.

How this will work:

  1. I will spin up a vps
  2. Download docker
  3. Run image with my data-git-repo Yep only this 3 steps (4.) when I add/update/delete a post, a githook will be fired, and the website will be up-to-date. (5.) same goes for the settings

What kind of settings can I add?

  • Blog title,
  • color theme,
  • how to create the slug,
  • add signature
  • set up language
  • ...

How does a post look like?

[//]: # (keyword: value)
...

hello world
Blablabla...
...

The pages can also be created like this.

I also need a folder structure.

./settings.js
./posts/some-post-file.md
./pages/about.md

This way, I don't need to login to the website, but only commit my changes.

You can follow my updates on my github account about this :). Or just here, when I post it ;)

Thanks and take care

Siyasi Macerahttps://adem.ayt.ac/p/2018-08-06_siyasi_macerahttps://adem.ayt.ac/p/2018-08-06_siyasi_maceraMon, 06 Aug 2018 00:00:00 GMT

Türkiye siyasetini, çocuk yaşta öǧrenmeye başlıyoruz çoǧumuz. Ama bunu ne kadar doǧru yapıyoruz. Araştırmadan, babamız, dedemiz, amcalarımız, çevremiz, ... ne derse doǧruydu, isterlerse en yanlış şeyi söylesinler. Biz hata yapmazdık, yapanlar her zaman bizim gibi düşünmeyenlerdi. Ne yazıkki, bu durum, fazla deǧişmiyor çoǧumuz için.

Çocukken, Osmanlıyı anlatan kitaplar okurdum, kahraman padişah ve kahramanları. Hepsinin yanındaki büyük kişileri, vezirleri, şeyhleri, ozanları, aşıkları. Kötü her zaman, bize savaşandı. Koskoca milyonları çatısı altında bulunduran imparatorluk, hep bir aǧızdan konuşuyordu. Yani, dıştan kimse birşey yapamaz, içtende kimse bölemezdi. Ve bu 1299'dan 1922'e kadar böyleydi, ve bu imparatorluk hep Şeriat ile, Din ile, Adalet ile yönetildi. Fakat Balkanlarda, Orta Doǧuda, Afrikada arkadan vurulduk ve imparatoluk bitti dediǧimiz anda, Türk mehmetciǧi büyük general Atatürk ile beraber Türkiyeyi kurtardı, fakat bizim dinle bütünleşmiş imparatorluǧumuzu 1923'te, dinsiz cumhuriyet devletine çevirmişti...

Sonra mahalledeki camide Türk okuluna gitmeye başladım, abim ve mahalledeki çocuklar ile beraber. Kitapların ilk sayfasında, Atatürk'ün resmi vardı. Arkadaşlardan duyduǧum, Atatürk rakı içerdi, imamları asıp keserdi, sarık yerine şapka giydirirdi, ... Bu adam benim önderim olamazdı.

Bu arada Belçikanın kendi okulunada gidiyordum, Katolik okuldu. Ve orda bir gün, hz. Isa'nın doǧum günü olduǧu için, sınıfta kendi katolik şarkılarını söyleyecektik. Tenefüste, Türk Müslüman olarak, bizim grup, söylememek için karar aldık. Sınıfa geri girdik, ve benim Türk Müslüman, ve söylememek için kararlı arkadaşlarım dahi olmak üzere herkez, hz Isa için yazılmış çocuk şarkılarını söylemeye başladı, ben hariç. Öǧretmen bana geldi, ve neden söylemediǧimi sordu, bende "benim peygamberim deǧil" dedim. Bunun üzerine öǧretmenim bana "Ben siz Müslümansınız diye, benden deǧilsiniz, size ders vermem diyormuyum" dediǧinde, yerin dibine girdim, ve baktım ki, söylememekte kararlı olan, fakat genede şarkıları söyleyen arkadaşlar, o gün benle alay ettiler.

Eve gittim, olayı annem'e anlattım. Ve annem bana "hz Isa, bizimde peygamberimiz, saygısızlık etmişsin, onlarda öyle düşünüyor, ama hepimiz bak beraber yaşıyoruz" dedi, ve ben gene yerin dibine battım. Babama anlattım, üçüncü defa yerin dibine battım. Ama iyikide yerin dibine batmışım, çünkü düşünmeye başladım. Evet hz Isa benimde peygamberimdi, fakat neden onlar, bizden deǧildi, babam bana Müslümanlıǧın, Türklere sonradan geldiǧini anlattı. Yani, ilk Türkler Müslüman deǧilmiydi.

Ve böylece araştırmaya başladım. Türklerin, 16 imparatorluk kurduǧunu, yüzlerce beyliklerin olduǧunu. Moǧol, Hun, Çin, Japon ve Korelilerle yaşayıp, o yörelerden geldiǧini, Türklerin tek Türkiye olmadıǧını öǧrendim.

Yıllar geçti, orta okula gitmeye başladım, ve orda başka din, dil ve ırklarla konuşmaya, tartışmaya başladım. Ve bu tartışmalar hep yeni şeyler öǧrenmeye, araştırmaya başlamamı saǧladı.

Seneler geçti, ve insanların düşüncelerine saygı duymayı öǧrendim, ve kendi düşüncemi karşıdakini kırmadan anlatmayı öǧrendim, bu yolda kırdıklarım olduysa, beni affetsinler ve haklarını helal etsinler.

Osmanlıyı detayli öǧrenmeye başladım, Atatürkü araştırdım. Bana anlatılandan deǧişik bir Osmanlı ile karşılaştım, Atatürkün neden Cumhuriyet'i kurduǧunu, ve bunun dahamı iyi veya kötü olduǧunu anladım. Bunu başka zaman anlatırım

Ilk olarak, Türkiye siyasetinde, MHP'yi bilirdim, en milliyetci partiydi, ben öyle biliyordum, ama uyguladıǧı politikaya baktım, bazı ortamlara baktım, gördüǧüm: ırkcılık, saǧ-sol mantıǧını, dinlemeden hain ilan etmek ve düşünmeden parti liderinin peşinden gitmek. Bana ters olan noktalar bunlardı.

  • Irkcılık: Milliyetcilik deǧildir, Türke düşman olmayana karşı, ben düşman olman. Buna güzel bir örnek, Malcolm X in hayatıdır.
  • Saǧ-sol mantıǧı: şucu-bucu düşüncesi, kardeşi kardeşe düşman eder. Üzerinden bu kadar yıl geçmiş, geçmişi hortlatmaya gerek yok, geçmişe bakıp geleceǧi inşaa etmek laǧzım.
  • Dinlemeden hain ilan etmek: partiden ayrılmayı, aynı düşünmemeyi, hainlikle suçlayanlar, kendi samimiliǧine ilk olarak baksınlar.
  • Düşünmeden parti liderinin peşinden gitmek: Birinin peşinden gitmekte sorun yoktur, fakat, peşinden gittiǧin kişiyi eleştirmemek, dahada kötüsü eleştirememek, yanlışlarını görüpte anlatmamak, veya anlatamamaktır bununla kast ettiǧim.

Siyasetin yanında dincileri gördüm, bir arkadaşım bana, gel sohbete gidelim dedi, ne güzel, genciz, din ile ilgileniyoruz, beraber sobhete gidiyoruz. Bir araya geldik, arkadaşlar lezzetli yemek yaptı, sonra cay ile sohbet başladı. Normal bir sohbetti, okul, öǧrenci örgütleri, ders, kültür, ... gibi konular konuşuldu. Sonra bir imam abileri geldi, sohbet dine döndü, ve "hoca efendi", aǧlamalar, ... Dedikleri hoca efendi kim diye düşündüm, sonra aklıma feto geldi, ve herkez onun ile ilgili, şöyle iyi, böyle eziyet çekti, hep hizmet verdi, ... şeklinde konuşmaya başladı. Ben konuşmadım, dinledim. Ordan ayrıldım, düşündüm, babam feto'yu zaten sevmezdi, ama onun hakkında bu kadar iyi konuşanlar vardı, ve içlerinden biride iyi tanıdıǧım bir arkadaşımdı. Araştırdım, ve din'i başta iyi anlatan bir hoca, fakat, detaylara girmeye başlayınca, beyin yıkayan bir örgüt olduǧunu gördüm ve bunu böyle anlattım, yaptıǧım tartışmalarda.

Sonra Cübbeli hoca, Kedicikli Adnan hoca, Tv hocaları derken, bir gün Cat Stevens, yani Yusuf Islam'ın Islama dönme hikayesini okudum. Ve yabancı birinin, hiçbir hacı-hocaya takılmadan asıl dini öǧrenmesi, beni duygulandırdı. Başka örneklerde var, lakin anlatmak istediǧim o deǧil

Bizim cemaate katıl diyelere, hep bu cevabı verdim. Ve hiçbir cemaate baǧlanmadım. Ve bu yüzden, sen bizim hocamıza, baǧımlı deǧilsin, sen kafirmisin, diyenlerle bile karşılaştım.

Sonra bir ara, iktidar parti olan AKP'nin, yaptıklarını duydum, ve sevindim, lakin AKP'yi okadar iyi bilmiyordum, ve siyaset ile dahada ilgilenmeye başladım, ve ne yazıkki, gene duyduǧum/gördüǧüm ve araştırmalarım arasında kocaman daǧlar olduǧunu gördüm.

  • Kürt-Türk kardeştir, PKK'yı bitireceǧiz, dediler, açılım dediler, sonunda Habur sınırından terör başları, kahraman gibi ülkeye girdiler.
  • Hoca efendi böyle iyi, şöyle eziyet çekti, ve sayre... ona selamlar gönderiyoruz, Inşallah ülkemize geri getirteceǧiz, ... Duyduǧuma ilk ininamadım.
  • Türk üniversiteleri, en iyi üniversiteler sıralamasından liste dışına düştü.
  • Türk havayolları, Telekom, ... yabancılara satıldı.

Konu Türkiye siyaseti olduǧunda,

  • ne Hoca efendisi, ona inanmayın dediǧimde, sen dinsizmisin, sen ne bilirsin denildi.
  • Devlet terör'ü bitireceǧi yere, masaya oturdu dedim, senin gibiler yüzünden bu kadar şehit verdik, artık şehit, gazi vermiyeceǧiz dediler.
  • BOP başkanıyım diye baǧırıyordu, yok, mualefet Amerika uşaǧı, o deǧil.
  • ... Daha çok örnek var, yazmaya kalksam bitmez, malesef.

Ama sonra, ilk terör örgütü, sonra hoca efendileri, sonra emperyalistler devleti kandırdı. Ve 15 temmuz, hain darbe gerçekleşti. Darbe'nin üzerinden bir hafta geçmedi, 15bin kişi tutuklandı, işten çıkarıldı, düşmanı yendik çıǧlıkları atıldı. Bir video gördüm, videoda teslim olan askerleri kemer ile dayak atıp, öldürdüler. Ve bu konuyla ilgili "Teslim olanı, canavarca öldürmenin hangi dinde yeri var, onu yapan şerefsizdir yazdım", bana "sen fetocumusun, siz zaten heb erdoǧana saldırıyorsunuz", "hainler", ... cevabları geldi, ve asker üniformasıyla halka ateş eden şerefsizleri gösterdiler.

Herkez bilsin ki, savunmasız veya teslim olmuş kişiye eziyet edip, öldürüp, ölüsüne bile tekme atan, şerefsizdir.

Iki sene sonra 2017'de. AvrupaTürk derneǧini yeniden faaliyete geçirdik. Türkiyeden ilk misafirleri aǧırladık, Sadi Somuncuoǧlu ve Yusuf Halaçoǧlu, konu ise Türk tarihi ve kültürüydü. Ama Yusuf Halaçoǧlu, Iyi parti kurucularından olduǧu için, sorulan sorular, siyaset ile ilgiliydi.

Konferanstan sonra, sohbet ettik, ve IYI partinin kuruluş nedeni ve amacını, bizzat kendisinden dinledim. Sonra ikinci konferansımızı yaptık, bu sefer misafirimiz Özcan Pehlivanoǧlu idi, bu seferki konu Balkan Türkleri. Fazla gelen olmadı, fakat konu çok önemli bir konudur. Bu konuyu başka zaman yazacaǧım. Özcan Pehlivanoǧlu'da IYI parti kurucularındandı.

Bundan bir-iki hafta sonra, erken seçim kararı geldi, ve apar topar, bunun ile ilgilenmeye başladım.

Kuruluş nedeni ve uyguladıkları politika'dan dolayı, burda IYI parti için müşahitlik görevini üstlendim. Sonra bir de baktım CHP ve Saadet partisi ile ittifak kuruldu. Ilk başta üzerinde fazla durmadım, onlarında amacı aynıydı. Parlementer devlet ile devam etmek, tek adam rejimi olmamak.

Bu süreç içinde, tv'lerde Millet ittifakı, hainler diye damgalandı, Cumhuriyet ittifakı ise tek vatansever, öncü ve dünyadaki tek adaletliler diye duyuruldu.

Belçikada seçim 5 gün sürdü. 3 gün müşahitlik yaptım. Çok şey oǧrendim, ve kişiler tanıdım. Beni tehdit edende oldu, işimi yapmamı engellemeye çalışan terbiyesizlerde oldu. Ben IYI parti adına ordaydım, CHP-Saadet'lilerle konuştum, ittifak olduǧumuz için beraberdik, güzel sohbetlerimiz oldu. HDP'lilerle konuştum, onlar ilede güzel konuşmalar gerçekleştirdim. MHP'den beni tehdit edip terbiyesizlik yapanlar dışında, sohbetler ettim. Aynı şekilde AKP'lilerle ilede konuştum. Siyaseti bir tarafa bıraktıǧımda, herkez ile iyi konuşmalar yapabildim, terbiyesizler ve cahiller dışında tabikide.

24 Haziran, adilce veya kalleşce bir seçim geçirdik, seçim sonucu belli olmadan Erdoǧan kutlamaya başladı, Ince ilk umut verici mesaj attı, ve 10 dakika gecmeden, malubiyetini açıkladı, Akşener kayboldu. Ince bir gün sonra, iki gün sonrada Akşener açıklama yaptı.

Bu açıklamadan sonra, IYI partide bir amaç için kurulup, kitle toplayıp, amacını unutan bir parti gibi davrandıǧı için, desteǧimi çektim.

Üzerinden vakit geçti, Nevzat Bor, Özcan Yeniçeri ve Yusuf Halaçoǧlu, benim üste yazdıǧım nedenler yüzünden istifa ettiler...

Bundan sonra, hiç bir siyasi partiye destek vermeyeceǧim.

Türkcülük ve Turancılık davamda ise deǧişen birşey yoktur.

Saygılar ve sevgiler ile

Projects progress in terminalhttps://adem.ayt.ac/p/2018-08-04_projects_progress_in_terminalhttps://adem.ayt.ac/p/2018-08-04_projects_progress_in_terminalSat, 04 Aug 2018 00:00:00 GMT

For a couple of days, I was searching the web for an app to track my projects, but ALL of my projects, personal, work, family, friends, adventures, ...

At work, we are using Jira, so I can use that too, but it's a massive application to use, and to set up. So, I searched a little further, and most of the applications I found, are the same, bloathed with features, I don't need, and the setup procedure that takes lots of time.

Then, I decided to use my own programming skill to create one myself, it is very basic, I just need to sum my projects, and the application will show a progressbar next to that project.

The main purpose of the project is, that I will only create a projects lists(nested lists also). And the program will show me the list, I don't need to configure anything(maybe in the future), but the main goal is: you add your lists file, you pass it to the application, and you will get an output. This is the only requirement for my application. Configuring the layout, symbols, blablabla, ... is maybe for the next version.

  • I created a new project in github and added a default MIT LICENSE and README.md file.

  • Then I cloned this repo

git clone git@github.com:aytacworld/projects-progress.git

  • Create my index.js file.

touch index.js

  • I added this in my index.js file
const projects = require('./my-projects');
const app = require('./app');

app.print(projects);

This is basically it for index.js file.

  • Now, I need to declare how I will write down my projects. I like to keep it simple, so I came up with this structure, to declare my projects.

touch my-projects.js

module.exports = {
  'first project': {
    'add todo': 54,
    'do some stuff': 43
    'do some crazy stuff': {
      'some craziness': 100,
      'another craziness': 0
    }
  },
  'second project': {
    ...
  }
};

Like I mentioned, just focus on the project and nothing to configure.

  • Then I created the application file itself.

touch app.js

The application will take the projects list, go through every project, and the subprojects. A recursive function will do the job for us.

class Project {
  constructor(name, level, value) {
    this.name = name;
    this.level = level;
    this.projects = [];
    this.percentage = typeof (value) === 'number' ? value : this.getValueFromSubProjects(value);
  }

  getValueFromSubProjects(projects) {
    let all = 0;
    const keys = Object.keys(projects);
    for (let i = 0; i < keys.length; i += 1) {
      const name = keys[i];
      const value = projects[name];
      const subProject = new Project(name, this.level + 1, value);
      all += subProject.percentage;
      this.projects.push(subProject);
    }
    return (all / (this.projects.length || 1));
  }

  print() {
    let countBars = Math.round(this.percentage / 10);
    countBars = countBars > 0 ? countBars : 1;
    const dash = '--'.repeat(this.level) + '>';
    const bars = '='.repeat(countBars - 1) + '>' + ' '.repeat(10 - countBars);
    const perc = '(' + this.percentage.toFixed(0) + ')'
    console.log(`[${bars}] ${dash} ${this.name} ${perc}`)
    this.projects.forEach(p => p.print());
  }
}

module.exports = {
  print: (projects) => {
    const root = new Project('All Projects', 0, projects);
    root.print();
  }
};

Basically, this is all the code needed.

  • now run our app.

node .

The output will be like this.

[====>     ] > All Projects (50%)
[===>      ] --> project 1 (43%)
...

So this is all we need, we don't configure anything, but our projects and it will be displayed in terminal.

I already updated the project, and committed it. I changed the code, so I don't have an app.js, but project.js which will export the Project class.

After reading this post, I also added colors to my application, if a projects percentage is below 35, it will be displayed in red, if it's more than 80, then it will be in green. And if you don't add your own my-projects.js file, you will get a red banner.

You can find the latest version here.

I was thinking to add some extra functionalities, I'll some them up:

  • add/delete/edit a project
    • add: `node -a "first project/do some crazy stuff/third craziness=45"
    • delete: node -d "first project/do some crazy stuff/third craziness"
    • edit: node -e "first project/do some crazy stuff/third craziness=78"
    • add autocompletion for the project navigations
  • show only the sub projects of a selected project
    • show: node -s "first project/do some crazy stuff"
  • customizations:
    • toggle colors
    • select the colors and the percentages to show them
    • update the bar characters
    • show/hide percentage or bar
    • ...

Ofcourse, I will add them in the future, when I wanted to invest some time in it. And those customizations don't have to change the main goal of this project. "you clone it, write down your projects file and start using it", those have to be nice to have features only. If you want, you can create a PR, and I will review it.

Thank and take care.

The problem with third party tools/integrationhttps://adem.ayt.ac/p/2018-07-24_the_problem_with_socialhttps://adem.ayt.ac/p/2018-07-24_the_problem_with_socialTue, 24 Jul 2018 00:00:00 GMT

Building an app is great, not only for work, but also as a hobby. Recently, I build my blog using ExpressJs... All went well, I just scrapped one of my todo, Twitter integration.

This feature was going to save me some time. When I'm publishing a new post, it was going to automatically tweet about it. Instead of browsing to twitter.com, then copy pasting the title and the link to my post manually.

So I went to apps.twitter.com, clicked on create an account, fill in the form, checked the "Accept conditions" checkbox, then pressed the "create application"-button. But I was blocked, Twitter asked me to enter my phone number to create an application on twitter. In the past I gave my number to various sites, but recently I removed it, and don't want to give it anymore.

For my current project, I'm developing some cool things, like chatbots, voice control, service workers, ... So you need to create an account on those systems to be able to integrate their services. In this post I'll try to explain the difference third parties and what I have encountered and what I found really annoying about it.

Twitter

This is a bit of a repetition of the intro of this post, but I'll explain more in detail.

It's easy to create a Twitter account, you just give in your "username" and "email". It's up to you to enter your real or pseudo name. And your ready to follow others, post tweets, pm, do whatever Twitter stuff you want to do. You don't need to enter anything about your privacy, so it is great.

Another great thing about Twitter is that you don't need to install the application to use it on your smartphone. The site is a PWA, so you can go to the website using a browser(Chrome on Android and Firefox Beta supports it, I didn't test it using regular Firefox), then create a shortcut of that page, and voila, you "installed" Twitter Lite on your smartphone.

But when you want to develop something for twitter, then you go to dev.twitter.com but this is the Enterprise development website, you need to register and add your creditcard, ... So this is not really what you want if you just want to test or make some little integrations.

So there is another site, apps.twitter.com, here you can also just login with your twitter account. And you can create an application, this will give you your tokens, endpoints, ... which is needed for the integration part.

But the thing is, if you have created a new account on Twitter and you just entered your username, email and password. You can't create an application. Twitter will ask(demand) you to enter your mobile phone number, and validate it by sending a text message to that number. If you don't want to add your phone number, you can't go further.

So this is the big drawback from Twitter. If there is another way to do it, just let me know.

I found this really annoying, because currently I'm writing a blogpost and publishing it on my blog, once published I'll have to go to Twitter, then copy and paste the title and the url of the blogpost, then tweet. With the integration, it was going to send a tweet automatically, once I publish a blogpost...

Facebook

In the past I created couple of times a Facebook account, then deleted again, forgot that I had one, then reactivated, ... But after the last time I deleted my Facebook account, I didn't create one and I don't have any intentions of doing it for my own. The previous creations was because of family, friends, ... who at the end convinced me to rejoin, but now I decided not to create an account at all. I will only create one if I need to do my job(integrate some features), but those accounts will only be for that project, and when I finish it, I will delete or never use that account, and while creating, I'll not enter any personal information. But last week I even decided not to do that, Let me explain why...

I created an account because I wanted to create a chatbot and use Messenger for that. I did, then I change from project, so I didn't login on facebook for a couple of days. Meanwhile, I was receiving to many emails from Facebook("Suggestions", "Long time no see, come and log back in", ...), so it was filling in my inbox with that kind of spam. I wanted to disable all notifications. After I logged in, Facebook was forcing me to enter my mobile phone number "for security purposes", and there wasn't any skip button, and there wasn't any "go to settings" link neighter... So I was stuck, I didn't enter my phonenumber, so I couldn't do anything at all.

Luckely I used an email account I created for that project only.

And so I decided to not use it at all.

Even if most of the people I know is using it, I won't go back to use it...

Amazon

For another project, colleagues build an Alexa skill, my part was to build the backend that Alexa is using, so I can just mock the requests Alexa is sending my backend and respond it with the npm package that Alexa provides. So I don't need to create an account for that. It was just the first part...

So I builded the features and tested it using the mock data I created. But when I was asked to test it on the system itself, they asked me if I had an Amazon account.

Amazon has still the most populated website in my view, but you can easily create an account as well, and don't provide your real info. Of course, if you are going to buy something from them, at least your delivery address needs to be correct, but that's not the point of this post.

Then I wanted to change it to a developer account and browse to this site developer.amazon.com/. It asked me to enter a whole form, asking for my real name, address, phone, credit card, ..., I asked my colleague, if there is another way.

Luckely there is, he sends me an invitation for the skill, so I don't need to fill the form, so I can just go to the admin page of that skill. I was happy, but not for long...

When I went to the page, Amazon asked to connect to a device or companion app. When I wanted to install the companion app, it asked me lot of permissions. I was like "Hell no", I'm not giving you those permissions.

Again, Luckely, my colleague logged out and logged in with my Amazon account on his smartphone and I have connected an Echo device with my account, then he logged of from his smartphone, but now I was able to skip the "connect device page", and proceed on the admin page of the skill. I was able to change the endpoints, and pointed to my dev machine and developed for a while and tested directly on Amazon Echo.

Then they have resetted the Echo device for a demo with their account, the day after I wanted to change the endpoints back to my dev machine, but again I was blocked by the "connect a device" page... Then I also found a test device in the material room at my work, and this is how I connected back the Echo device.

I wanted to create another skill, but without success. To create a new application, first you need to finish the form, filling all information...

Google

The client also wanted to add Google Assistant as a channel next to Alexa, so I created a gmail account. One thing I like with Google is, if you create an account, you can use it on every service, and you don't need to update or upgrade your account for some services.

I just went to console.actions.google.com and I was able to create a skill/application. I created a skill, modified my backend so it also accepts Google Assistant calls, refactored it, so both skills use the same logic.

And it never asked me for credit card or phone number or any other privacy information. So why are the other not be able to do it...

Google has a nice feature on the console too, you can directly use the simulator to test your skill, and it also replies like it should on a real device.

Other services

Those were the only third parties I tried to integrate. When I try some new things I'll try to make a post on that as well.

Most of those services ask you for your personal data, so they can create a profile on your behave and advertise based on your data and even sell it. That's the reason why I stopped using most of the services and try to create my own.

The only social media I'm using next to my blog is Twitter. My point of view is, I only post or tweet something that I wanted to be public. If I want to share something personal with my family or friends, I don't use any of those services at all, I send it through encrypted channels.

Thanks and take care

Compressing scanned pdf'shttps://adem.ayt.ac/p/2018-07-18_compressing_scanned_pdfshttps://adem.ayt.ac/p/2018-07-18_compressing_scanned_pdfsWed, 18 Jul 2018 00:00:00 GMT

In my previous post, I told that I switched to Parabola GNU/Linux, it is one of the few libre os that exists. But using a libre os comes with a price, you have lesser options when it comes to nice tools, programs, devices. Of course, you have alternatives, but if you're not use to it, or don't find the one feature you want, there is just one option left, assemble some tools yourself and write things yourself. If you're not a developer or interested in writing stuff yourself, then it can give you headache, a lot.

On my previous used os's I was able to scan easily some documents, and save it as pdf, and the scan application, was doing the compression of it by default, but in Parabola GNU/Linux, you need to do it yourself.

Parabola is a stripped version of Arch linux(with stripped, I mean, all non-free stuff is removed), and you can't use AUR(next to the default repository, it contains most of the cool stuff). So I tried some scanning applications from the default repository. The one I use is xsane, you just install it with sudo pacman -S xsane, then the installation starts and you can start using it, the default GUI is easy to use, but old fashion design, but that's not a problem, as long as it works.

But when I scan 1 paper, the saved pdf is about 1.2MB, even if the file is just text without any color, or picture on it. And I scan a lot of documents.

So I start searching some compression tool for pdf, I found some online tools, but I don't want to upload my document. So I searched further for application, who runs locally, and if it's on terminal, I'm the happiest :)

I found gs. It was beautiful. You can just compress a pdf file using this command

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="<new file name>" "<file to compress>"

I just compressed a file of 1.2MB to 78.9KB, which is awesome. But I need to write the whole command each time, so I first wanted to create an alias, but I created a script file instead.

#!/bin/bash

if [ -z "${1}" ]; then
  echo "please use it as 'compress-pdf <filename>'"
else
  FILE=$1
  NEW_FILE=${FILE}.new.pdf
  echo compressing $FILE
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="${NEW_FILE}" "${FILE}"
fi

You can run this script: compress-pdf file.pdf Then it will create file.pdf.new.pdf, then you can compare the size of both, keep the small file, remove the original and rename the new or just remove the new created file. But doing this for a bunch of files... the script can also handle this part for us.

You can get the size of the file by executing ls "<file name>" -s | cut -d " " -f 1, this will get the size of the file.

so I added this also inside the script to compare the size of both files.

#!/bin/bash

if [ -z "${1}" ]; then
  echo "please use it as 'compress-pdf <filename>'"
else
  FILE=$1
  NEW_FILE=${FILE}.new.pdf
  echo compressing $FILE
  gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="${NEW_FILE}" "${FILE}"
  ORIG_SIZE=$(ls "$FILE" -s | cut -d " " -f 1)
  NEW_SIZE=$(ls "${NEW_FILE}" -s | cut -d " " -f 1)
  if [ $ORIG_SIZE -lt $NEW_SIZE ]; then
    rm "${NEW_FILE}"
  else
    mv "${FILE}" "${FILE}.original"
    mv "${NEW_FILE}" "${FILE}"
  fi
fi

Now it will try to compress file, if the new file is bigger than the original, it will remove it, if not it will rename the original file(add ".orignal" at the end of the name), so you can control if the new file is readable enough, before deleting the old one.

As a bonus, you can move this file to /usr/local/bin, so it will be accessible from any where :). You can move your script with this command sudo mv <relative path to your file> /usr/local/bin/compress-pdf.

You can find the latest version of the file here.

Thanks and take care

Start overhttps://adem.ayt.ac/p/2018-07-16_start_overhttps://adem.ayt.ac/p/2018-07-16_start_overMon, 16 Jul 2018 00:00:00 GMT

Finally, I finished my blog, again...

Developing it was the easiest part. So why did it take so long to finish it? There was some obstacles during the way, like most of the development. I will write down my journey on this post :).

Previously, I used Wordpress, Blogger, Scriptogr.am, ... to post, but every tool I used, has it's own ups and downs. And I needed to create an account on this tool, to use that tool and configure it like that to do have this behavior, use this theme, ... you know where it's going.

Some people are using them too, and they put some time and energy in setting the tool on how they want it. And they create a great blog.

Because of that I decided to create my own blogging system, I don't have to configure some settings, I just program it and voila. So my adventure has started.

First I backed up my posts, in markdown format, then I start thinking on how I would create it, in the past I developed in C#, Js, little PHP and Java, and currently I'm only developing in Js, so technology was not a problem. I used NodeJS. Then I had to decide the framework/library to build the front and back-end.

Back-end was kind of simple, I used ExpressJs, but there was couple of questions, like should I render the page or just create an API server which will be consumed? Should I store md files or save it in a database? Should I integrate with anything(Twitter, Facebook, Google+, ...)? Should I store user info for commenting or not? ... The questions can go on, but you get the point.

Some of the back-end questions depend on the front-end, so I need to finish that part as well, I wanted to use Angular, for the front-end part, then decided to use React, to build a full application with it. So the back-end was going to be an API server, which will be consumed by my React front-end, but then suddenly I was doing lots of other things, so I put my blog development on the shelf for some time...

Changing my current job, moving to another city, baby is coming, thinking of other projects. It was nearly impossible to find some free time.

During that time I also get more interests in Free Software way of thinking, not that I'm a fully supporter of it, but I bought a Lenovo x200, upgraded it with 8gb RAM, SSD drive, flashed the bios to libreboot(with raspberry instead of a beaglebone), changed the wifi card, installed Trisquel, then changed to Parabola Gnu/Linux(with KDE). And I also use terminal a lot more, my mail client is mutt, calendar app is khal and rss reader is newsboat. I also like to browse using lynx. So this was a major point on deciding how to build my website, when I was reading some articles using newsboat(rss reader on terminal) and reading a medium article using lynx, I decided to create my blog lynx compatible and I also wanted rss feeds.

Lynx browser is just html, without js or css, so back-end can render those too, I will use pug for that, that's also decided. I created the first pages, but when I open the website on a regular Browser, I decided to add css, as less as possible, but still, it would be minimalist. But without js in the front-end at all.

Next, where to store the data, the options are file storage or database storage, I just decided to use MongoDB, don't know why, but I also like the idea to store/upload files, and the server will render it, like scriptogr.am does(but it's taken off).

I found a old tutorial about rss page in Jade(old Pug), and changed little bits of the page to fully support Pug. You can find the article here. I also used that article for designing my MongoDB Schema, maybe that was the reason I used Mongo.

To create/edit (and delete, not implemented yet) posts, I need a secure section, for that I used passportjs, which is the easiest way to create a login mechanism in NodeJs, I just used passport-local. Then I created my secure edit page, the password is plain text, so I need to make it production friendly, but because the server is my own server, and connecting to server is over ssh, for the moment it's not a big deal. But later, I will hash the password and use the hashed version for comparing. Or add OAuth for not managing the login at all, but that's not really what I want, I want to keep that kind of information for my self. So I will create a SSO in the future, and hopefully post the progress of it here on my blog.

I used marked to render the markdown to html and serve it in pug.

So far I had a working blog. Here is a small summary:

  • render blog-list, blog-detail, login, add/edit-post
  • login using passportjs
  • use mongoosejs for MongoDB connection
  • model Schema's are done

My todo list contains those things:

  • filter posts by tags
  • search by keywords
  • allow users to comment(simple comment implementation)
  • tweet when publishing a post(twitter integration)

Filtering posts was a handy feature, so I added tags to my posts and made it clickable. Searching was also great to learn how I can use mongoose to do some querying. For comments feature, I could have used Disqus, but it also requires javascript and third party integration and configuration. So I created simple as possible commenting system, the user only have to fill 3 fields name, email and message, only message is mandatory, I will still have to fine-tune it, because it's not bug free, and also add localStorage for remembering the name and email, so you don't have to enter that each time, and of course add a "legal" not that I use cookies for only that purpose... The last one was more of a integration with twitter, so each time I publish a post, it would automatically tweet from my twitter account the url of that post, for that I went to apps.twitter.com, when I entered the application info and agreed on the terms & conditions, Twitter obliged me to enter my phone number, at that point I didn't go further, and stop the integration process, so that's the reason I don't have a twitter integration.

Now I have some other todo's in my head, that I want to add to my blogging system, those are:

  • hash the password.
  • thinking a way to vote a comment, how to vote anonymously or not?
  • replies to comments? maybe? or not necessary?
  • search by date?
  • create api, so people can get the posts as json, and I can create Angular/React version of my blog, and consume the api.
  • create a terminal app to write down my posts, and publish it from it.

So things will get interesting, at least for me :).

Btw, if you are interested in the source code of my blog you can find it here. When I started my blog, I already build some expressjs and passportjs applications, so to make it easy for myself, I created npm packages to handle the boilerplate code, I also used those package in my blog, those are @aytacworld/express and @aytacworld/express-login, I will write down an article about those too, in the future.

Thanks and take care