Clicky

TL;DRs

Posts

Extract https://www.kotobee.com/

[2024-11-24 Sun 18:48]

Nermeen’s university sent her today a PDF file that was bundled inside an MS windows executable (exe), she needed to run it outside of the Windows machine. Upon extracting it, I found it was bundled as a Kotobee ebook, which turned to be a DRM service to create “interactive books”. After doing a quick binary analysis to ensure that we are indeed dealing with a DRM’d exe file (and not embarrassingly fdoc file renamed to be .exe), I managed to build a document out of it. Here’s the steps:

First of all, simply, extract the exe content:

unzip file.exe -d extracted_directory

The extracted directory should have a similar tree to this:

larrasket [~/tmp/rq/e]$ ls -l
total 152
-rw-r--r-- 1 l l   2227 Aug 21 14:42 config.js
drwxr-xr-x 1 l l     44 Aug 21 14:42 css
drwxr-xr-x 1 l l     52 Aug 21 14:42 epub
drwxr-xr-x 1 l l     90 Aug 21 14:42 fonts
-rw-r--r-- 1 l l  10709 Aug 21 14:42 icon.png
drwxr-xr-x 1 l l      4 Aug 21 14:42 img
drwxr-xr-x 1 l l      0 Aug 21 14:42 imgUser
-rw-r--r-- 1 l l  14844 Aug 21 14:42 index.html
drwxr-xr-x 1 l l     98 Aug 21 14:42 js
drwxr-xr-x 1 l l     74 Aug 21 14:42 lib
drwxr-xr-x 1 l l    232 Aug 21 14:42 locales
-rw-r--r-- 1 l l 116350 Aug 21 14:42 npmModules.min.js
-rw-r--r-- 1 l l    294 Aug 21 14:42 package.json

From here it’s very obvious that we can run this node app in a web server. You can run a simple http server here:

python3 -m http.server 9000

And the app will be available at port 9000. Alternatively you can build an epub from the provided epub directory:

Inside the epub directory append the mimetype

zip -0X "../book.epub" mimetype
zip -rDX9 "../book.epub" * -x "*.DS_Store" -x mimetype

This will get you the epub. Right after, you can convert it to pdf with epub-tools:

ebook-convert ../book.epub ../book.pdf

As a single command:

(zip -0X "../book.epub" mimetype && \\
     zip -rDX9 "../book.epub" * -x "*.DS_Store" -x mimetype) \\
        && ebook-convert ../book.epub ../book.pdf

Buying Votes

[2024-11-12 Tue 04:49]

It’s been said we are in the age of pricing. The Age of Commodity. I had a lot of thoughts about that when I was reading this paragraph from Harper’s review:

In the United States, it was reported that the Microsoft founder Bill Gates, the world’s twelfth-richest person, secretly gave $50 million to an organization supporting the campaign of the Democratic presidential candidate; and that the Tesla and SpaceX co-founder Elon Musk, the world’s richest person, had been warned by federal prosecutors of the potential illegality of his practice of giving $1 million each day to a randomly selected swing-state voter who signed a petition for his super PAC that backs the Republican presidential candidate. ^{1} ^{2} ^{3} ^{4} In Moldova, where last month it was reported that the Russian government had paid at least 130,000 people more than $15 million to vote against joining the European Union, authorities announced that they had identified an additional $24 million also directed toward purchasing the votes of 20 percent of the entire electorate; violence erupted at polling stations across the country of Georgia, where international observers warned of Russian “vote-buying” in its parliamentary elections and whose president said that the elections’ results “cannot be accepted” and should be opposed with protests in the streets; and police in Mozambique shot and killed at least ten of the thousands of demonstrators marching against the ruling party’s claim that it had just won more than 70 percent of votes nationally. ^{5} ^{6} ^{7} ^{8} ^{9} Days before Uzbekistan’s parliamentary elections, a would-be assassin fired five bullets at the car of the country’s former head of communications, who was lobbying for reforms to protect press freedoms; and in Bulgaria, hackers published a list of more than 200 businessmen and government officials who are alleged to have bought votes under the direction of the former owner of 6 of the country’s 12 largest-circulating newspapers. ^{10} ^{11} ^{12} It was reported that an internal battle in the Iranian government over the 85-year-old ayatollah’s successor would likely be won by his second son, a former de facto commanding officer in the Basij who was accused of rigging the 2009 election in favor of the incumbent, who later accused him of embezzling money from the treasury; the Vietnamese parliament elected a military general to replace its president, who, while being investigated for bribery, resigned from the presidential office he’d taken over from his predecessor, who himself had resigned after 539 of his subordinates were implicated in multiple corruption rackets; and Tunisia’s incumbent president, who last month arrested dozens of members of the nation’s largest opposition party, was inaugurated for a second term. ^{13} ^{14} ^{15} ^{16} ^{17} ^{18} “Vipers,” he said at his swearing in, are “circulating.” ^{19}

Abdel Wahab al-Messiri, Paul Fussell and Kagi

[2024-10-17 Thu 18:27]

I was reading Messiri’s “Rehlati al-fikriah”, and he mentioned something very interesting there about Paul Fussell, the renowned literary historian, apparently he was one of his PhD external examiners. But that’s not the interesting thing, it is what he mentions about him: being a homosexual pervert. I was shocked from the information that Messiri mentioned about him, that I quickly jumped to Wikipedia searching for anything with the keyword “gay”, “homosexual”, etc.. Nothing (surprisingly) was there, I started to think that Messiri might have linked to some other Paul Fussel. I then tried to search Google with keywords like “homosexual” “Paul Fussel”, still, nothing there. I was finally certain that either Messiri is talking about someone else, or this information were discrete. Then I read a post on HN that was talking about Kagi, a less screwed (suckless) search engine, it quickly linked me to the information Messiri mentioned about Fussel (his wife article about their relationship and how he would like to enter a room full of guests naked)

https://www.youtube.com/watch?v=wnacdOIoTBQ

I don’t frequently post here, or anywhere, unlike past times. Lately I explored one of my friend’s music library, he told me how it’s extremely diverse, he was correct about it. I later wondered if that has anything to do with a disorder that he suffers from, which relates to his ear. I wonder if how his music changes has anything to do with how that acoustic disorder affect his music taste. I also wondered if there’s anything about me that affects my frequency of writing here. Sometimes it’s fascinating —even if you believe in free will— how unfree we might be. How we might have the wrong ideas because the search engine chooses not to be helpful enough, or have different views due to a biological state. Related.

Fix: (org-ql-view.el) Adjust priority for agenda elements by anpandey

[2024-08-22 Thu 12:50]

FOOS restrictions are really harmful to the progress of software development. I advocate for the freedom of software, but I really dislike the way that other adherents use that freedom which usually conclude making the progress/development much slower. An average GNU fanatic user would require people to use some free git hosting, would refuse to make support for non-free systems, might discourage usage of non “fully free” licensed software packages. All of this result in making the progress really slow (and I’m not here talking even about the FSF signture stuff in the PR I linked above). Take for example the usage of a fully-free Git hosting, like codeforage and the whatnot, this is totally fine as in concept, but practically many people are just used to Microsoft’s github, many people (in fact the majority of people) don’t know how to use emails for patchs and issues (in the case of other forges like sourcehut), and many people just won’t be encouraged enough to do any of this (or even register at a new forge other than github).

SEP Friendship

[2024-08-03 Sat 03:14]

I really like Stanford Encyclopedia of Philosophy’s PDFs (preview here), however, they do not allow you to download it without a subscription. It’s actually good enough for a subscription if you compare it to the HTML. For someone like me, my HTML appetite can not hold more than few long articles, SEP average entry is about ~50 pages or so, that’s not a long article even. Here’s how I get their entries as nice PDFs without subscription, simply save the article part of the HTML page into a file, and using pandoc run:

pandoc concept_of_religion.html --pdf-engine=xelatex -o concept_of_religion.pdf --variable=documentclass:book -V geometry:b5paper -V margin=3cm -V mainfont="Times New Roman"

Another killer feature for Go

[2024-02-16 Fri 14:07]

I’d always prefer a Lisp. But ideally, Go wins (more at The Prefect Programming Language) by its unauthoritarian package manager and not using exception handling. As aforementioned @ A thought about Clojure, I think Clojure is the modern day Lisp that works very good for interactive programming and rapid development. But here’s another killer feature of Go that roughly does not exist elsewhere: the great STD. With Go, I can feel very comfortable writing a Go application without the need of checking the internet for questions or 3rd-party libraries, eventually I might need to, but if compared to any other tool I’ve ever used, it’s amazing (back in the day when I used C# I’d need a web browser always running alongside to my IDE). I do not have internet connection those days and while playing tracks I thought of building a simple CLI to handle my audio tracks synchronization, I know how to do it without reinventing the wheel in Go, with only using the STD, with Clojure, it’s going to be unrapid developement.

Consolation

[2024-02-15 Thu 19:50]

الخبث خبثان: خُبث الداهية وخَبث الأحمق. الأخير هو، إلى حدِّ الآن، الأسوأ.

— عباس ابراهام.

Here’s my consolation for a very big part of my life of which I remind myself very frequently especially if I’m suspecting the existence of stupidity around. A solace that often comes to the forefront. Let me establish something that is misconstrued usually, people think that smart people tend to be evil much more than stupid people. Which is correct, intelligent people would be indeed much more capable of doing harm (i.e. evil). However, here’s the thing about stupidity; evilness is highly subjective that a stupid person does not have to be aware that he/she is seeking something achieved, that he/she is harming or even doing anything at all to be ’evil’ to an intelligent individual. I want to give you some example but لولا النفوس الضعيفة سريعة المرض، سيئة الغرض I’d skip on that. Anyway, let’s get back to my point about where I find my consolation about this kind of nefarious and base evilness: it bounces back. Stupids, imbeciles and retards 99% of the times hurt themselves back, making shitty life decisions or just of being irritating to others. Their decisions, marred by imprudence, or merely their presence, vexatious to others, invariably rebound upon them. “Errare humanum est, sed in errare perseverare diabolicum”.

Clojure has Go-like channels

[2024-02-08 Thu 06:45]

Found out that Clojure has Go-like channels. https://clojure.org/guides/async_walkthrough, very promising to use it (as mentioned at a thought about Clojure)

Archive

How does this page work

[2022-09-23 Fri 20:15]: If you are an old reader (if such a thing exists) of this blog, you should know about my old attempts of creating a stack-like posting that works within my editing environment (Emacs) which has always failed. I’m very good at Elisp, suck at writing Elisp packages \*Sigh\* life doesn’t give everything. Anyway I thought that everything I need to implement such a workflow, is only a program that appends an entity top of a string, and I started to implement it as a separated program. However, while doing it I recognized that (org-caputre) already does it, just needed a simple custom configuration:

(setq +org-capture-journal-file "~/blog/content/stack.org")
(setq org-capture-templates
      '(("j" "Journal" entry
           (file+headline +org-capture-journal-file "Posts")
           "* %<%A, %d %B %Y>\n%?"  :prepend t)))

I also found a predefined way of doing it that build a full hierarchy date for the entity, but I decided to go simple this time.

Cons;

  • I’ve to archive it myself, no pagination.
  • [2022-10-05 Wed 20:18]: I figured out a workaround to archive, and I don’t think I really need tags. Everything works great.
  • [2024-02-15 Thu 20:19]: I do not find this workflow very good as of now, I do not think that archiving is necessary either. I wil try to think of something else soon.

I seek refuge in God, from Satan the rejected. Generated by: Emacs 29.4 (Org mode 9.8). Written by: Salih Muhammed, by the date of: . Last build date: 2024-11-24 Sun 19:08.