This commit is contained in:
Miloslav Ciz 2025-03-04 21:04:02 +01:00
parent 638265b6fe
commit 07603f7b64
14 changed files with 1975 additions and 1933 deletions

View file

@ -49,7 +49,7 @@ For a quick overview let us average some data over time -- the table that follow
| 2021 | 2173 | 4096, 1000, 64000 | 780, 920 |8192, 3100, 60000, 4G GPU (FC6) | 221865 | 161706 |
| 2022 | 2280 | 4096, 1000, 64000 | 780, 920 |8192, 3300, 125000, 2G GPU (CODMWF2)| 248477 | 191785 |
One of a very frequent questions you may hear a noob ask is **"How can bloat limit software freedom if such software has a [free](free_software.md) (or "[FOSS](foss.md)") [license](license.md)?"** Bloat [de-facto](de_facto.md) limits some of the four essential freedoms (to use, study, modify and share) required for a software to be free. A free license grants these freedoms legally, but if some of those freedoms are subsequently limited by other circumstances, the software becomes effectively less free. It is important to realize that **complexity itself goes against [freedom](freedom.md)** because a more complex system will inevitably reduce the number of people being able to execute freedoms such as modifying the software (the number of programmers being able to understand and modify a trivial program is much greater than the number of programmers being able to understand and modify a highly complex million [LOC](loc.md) program -- see [freedom distance](freedom_distance.md)). A more bloated program won't run on simpler (older, cheaper, homemade, ...) computers, effectively limiting the freedom to use the program, forcing the user to run it on a mainstream (unethical, expensive, spying, abusive, consumerist, power hungry, shitty, ...) computer etc. This is not any made up reason, it is actually happening and many from the free software community try to address the issue, see e.g. [HyperbolaBSD](hyperbolabsd.md) policies on accepting packages which rejects a lot of popular "legally free" software on grounds of being bloat ([systemd](systemd.md), dbus, zstd, protobuf, [mono](mono.md), https://wiki.hyperbola.info/doku.php?id=en:philosophy:incompatible_packages). As the number of people being able to execute the basic freedom drops, we're approaching the scenario in which the software is de-facto controlled by a small number of people who can (e.g. due to the cost) effectively study, modify and maintain the program -- and a program that is controlled by a small group of people (e.g. a corporation) is by definition [proprietary](proprietary.md). If there is a web browser that has a free license but you, a lone programmer, can't afford to study it, modify it significantly and maintain it, and your friends aren't able to do that either, when the only one who can practically do this is the developer of the browser himself and perhaps a few other rich corporations that can pay dozens of full time programmers, then such browser cannot be considered free as it won't be shaped to benefit you, the user, but rather the developer, a corporation.
One of a very frequent questions you may hear a noob ask is **"How can bloat limit software freedom if such software has a [free](free_software.md) (or "[FOSS](foss.md)") [license](license.md)?"** Bloat [de-facto](de_facto.md) limits some of the four essential freedoms (to use, study, modify and share) required for a software to be free. A free license grants these freedoms legally, but if some of those freedoms are subsequently limited by other circumstances, the software becomes effectively less free. It is important to realize that **complexity itself goes against [freedom](freedom.md)** because a more complex system will inevitably reduce the number of people being able to execute freedoms such as modifying the software (the number of programmers being able to understand and modify a trivial program is much greater than the number of programmers being able to understand and modify a highly complex million [LOC](loc.md) program -- see [freedom distance](freedom_distance.md)). Once a piece of software becomes very large, it **starts to require full time developers**, meaning someone has to stop working and dedicate all his time to the project, meaning he has to make money from developing it and here [money](money.md) enter the scene, sponsors come in, [ads](marketing.md) start to appear, data start being collected and once the business (even one based around a "FOSS" project) is established, [forks](fork.md) become undesirable, inviting in a creeping obscurity, incompatibility, lock-ins and other obstacles (despite a free license) etcetc. { I recently noticed in the so called "open source" Firefox browser that "sponsored" links start appearing at the blank page :) ~drummyfish } A more bloated program won't run on simpler (older, cheaper, homemade, ...) computers, effectively limiting the freedom to use the program, forcing the user to run it on a mainstream (unethical, expensive, spying, abusive, consumerist, power hungry, shitty, ...) computer etc. This is not any made up reason, it is actually happening and many from the free software community try to address the issue, see e.g. [HyperbolaBSD](hyperbolabsd.md) policies on accepting packages which rejects a lot of popular "legally free" software on grounds of being bloat ([systemd](systemd.md), dbus, zstd, protobuf, [mono](mono.md), https://wiki.hyperbola.info/doku.php?id=en:philosophy:incompatible_packages). As the number of people being able to execute the basic freedom drops, we're approaching the scenario in which the software is de-facto controlled by a small number of people who can (e.g. due to the cost) effectively study, modify and maintain the program -- and a program that is controlled by a small group of people (e.g. a corporation) is by definition [proprietary](proprietary.md). If there is a web browser that has a free license but you, a lone programmer, can't afford to study it, modify it significantly and maintain it, and your friends aren't able to do that either, when the only one who can practically do this is the developer of the browser himself and perhaps a few other rich corporations that can pay dozens of full time programmers, then such browser cannot be considered free as it won't be shaped to benefit you, the user, but rather the developer, a corporation.
**How much bloat can we tolerate?** We are basically trying to get the most for the least price. The following diagram attempts to give an answer:

2
c.md
View file

@ -4,6 +4,8 @@
C is an [old](old.md) [low level](low_level.md) structured [statically typed](static_typing.md) [imperative](imperative.md) compiled [programming language](programming_language.md), it is very fast, efficient and currently possibly the most commonly used language by many [minimalist](minimalism.md) programmers including [less retarded software](lrs.md). Though by very strict standards it would still be considered [bloated](bloat.md), compared to any mainstream [modern](modern.md) language it is very bullshitless, [KISS](kiss.md), very well optimized, culturally established and stable, so it is also the go-to language of the [suckless](suckless.md) community as well as most true experts, for example the [Linux](linux.md) and [OpenBSD](openbsd.md) developers, owing to a good, relatively simple design, **uncontested performance**, **wide support**, great number of compilers, high level of control and a status of firmly tested and established language. C doesn't belong to the class of most minimal languages like [Forth](forth.md), [Lisp](lisp.md) and [Brainfuck](brainfuck.md), but it is among the most minimalist "traditional" kind of languages. C is **perhaps the most important language in [history](history.md)**; it influenced, to smaller or bigger degree, basically all of the widely used languages today such as [C++](c.md), [Java](java.md), [JavaScript](javascript.md) etc., however it is not a relic of the past, it is still actively used -- in the area of low level programming C is probably still the number one unsurpassed language. C is by no means perfect or extremely mathematically [elegant](beauty.md), but it is currently one of the best practical choice of a programming language. Though C is almost always compiled, C interpreters can be found too.
Notable software written in C includes [Unix](unix.md), [Doom](doom.md), [Duke Nukem 3D](duke3d.md), [Linux](linux.md), [OpenBSD](openbsd.md), [Anarch](anarch.md), [dwm](dwm.md), [git](git.md), [Vim](vim.md), [Quake](quake.md), [Wolfenstein 3D](wolf3d.md) and more.
{ See https://wiki.bibanon.org/The_Perpetual_Playthings. Also look up *The Ten Commandments for C Programmers* by Henry Spencer. Also the *Write in C* song (parody of *Let it Be*). ~drummyfish }
It is usually **not considered an easy language to learn** because of its low level nature and amount of control (fuck up opportunities) it gives: it requires good understanding of how a [computer](computer.md) works on the lower level and doesn't prevent the programmer from shooting himself in the foot. Programmer is given full control (and therefore "responsibility"). There are things considered "tricky" which one must be aware of, such as undefined behavior of certain operators or manual [memory management](memory_management.md). This is what can discourage a lot of modern "[coding monkeys](soydev.md)" from choosing C, but it's also what inevitably allows such great performance -- undefined behavior allows the compiler to choose the most efficient implementation. On the other hand, C as a language is pretty simple without [modern](modern.md) bullshit concepts such as [OOP](oop.md), it is not as much hard to learn but rather hard to master, as any other true [art](art.md). In any case **you have to learn C** even if you don't plan to program in it regularly, it's the most important language in history and lingua franca of programming, you will meet C in many places and have to at least understand it: programmers very often use C instead of [pseudocode](pseudocode.md) to explain algorithms, C is used for [optimizing](optimization.md) critical parts even in non-C projects, many languages compile to C, it is just all around and you have to understand it like you have to understand [English](english.md).

View file

@ -1,3 +1,3 @@
# Cyber
*Cyber* (taken from [cybernetics](cybernetics.md), the theory of communication and control, coming from Greek *kybernetes*, *steersman*) is a word prefix that signifies relatedness to [computers](computers.md), especially computer networks and [Internet](internet.md). It is nowadays used mainly for relating old concept to the [modern](modern.md) world dominated by computers. By itself or as a verb "cyber" often signifies *cybersex*. Some terms using the prefix include mentioned [cybernetics](cybernetics.md), [cyberpunk](cyberpunk.md), [cybersex](cybersex.md), [cyberspace](cyberspace.md), [cybercrime](cybercrime.md), [cyberbullying](cyberbullying.md), [cyberculture](culture.md), [cyborg](cyborg.md), [cybersecurity](security.md) etc.
*Cyber* (taken from [cybernetics](cybernetics.md), the theory of communication and control, coming from Greek *kybernetes*, *steersman*) is a word prefix that signifies a relation to [computers](computers.md), especially computer networks and the [Internet](internet.md). It is nowadays used mainly for relating old concept to the [modern](modern.md) world dominated by computers. By itself or as a verb "cyber" often signifies *cybersex*. Some terms using the prefix include [cybernetics](cybernetics.md), [cyberpunk](cyberpunk.md), [cybersex](cybersex.md), [cyberspace](cyberspace.md), [cybercrime](cybercrime.md), [cyberbullying](cyberbullying.md), [cyberculture](culture.md), [cyborg](cyborg.md), [cybersecurity](security.md) etc.

View file

@ -1,12 +1,12 @@
# Deferred Shading
In computer [graphics](graphics.md) programming deferred shading is a technique for speeding up the rendering of (mainly) [shaded](shading.md) 3D graphics (i.e. graphics with textures, materials, [normal maps](normal_mapping.md) etc.). It is nowadays used in many advanced 3D engines. In principle of course the idea may also be used in 2D graphics and outside graphics.
In computer [graphics](graphics.md) [programming](programming.md) deferred shading refers to a specific technique of speeding up the rendering of (mainly) [shaded](shading.md) [3D graphics](3d_rendering.md) (i.e. graphics with textures, materials, [normal maps](normal_mapping.md) etc.) by delaying (deferring) [shading](shading.md) to a time at which it's already known which parts of the rendered scene are visible. Today this technique is in very common use and will be found practically in every advanced 3D engine. In principle the general idea behind it may also be used in 2D graphics (and possibly even outside graphics).
The principle is following: in normal forward shading (non-deferred) the shading computation is applied immediately to any rendered pixel (fragment) as they are rendered. However, as objects can overlap, many of these expensively computed pixels may be overwritten by pixels of other objects, so many pixels end up being expensively computed but invisible (this is called *overdraw*). This is of course wasted computation. Deferred shading only computes shading of the pixels that will end up actually being visible -- this is achieved by **two rendering passes**:
The principle is following: in normal forward (non-deferred) shading the shading computation is applied immediately to any rasterized [pixel](pixel.md) (fragment). However, as objects can overlap, many of these expensively computed pixels may be overwritten by pixels of other objects, so many pixels end up being expensively computed but eventually invisible (this is called *overdraw*). This is of course wasted computation. Deferred shading only computes shading of the pixels that will end up actually being visible -- this is achieved with **two rendering passes**:
1. At first geometry is rendered without shading, only with information that is needed for shading (for example [normals](normal.md), material IDs, texture IDs etc.). The rendered image is stored in so called G-buffer which is basically an image in which every pixel stores the above mentioned shading information.
1. Geometry is first rendered without shading, only with information that is needed for shading (for example [normals](normal.md), material IDs, texture IDs etc.). The rendered image is stored in so called *G-buffer* which is basically an image where every pixel stores the above mentioned shading information.
2. The second pass applies the shading effects by applying the pixel/fragment [shader](shader.md) on each pixel of the G-buffer.
This is especially effective when we're using very expensive/complex pixel/fragment shaders AND we have many overlapping objects. **Sometimes deferred shading may be replaced by simply ordering the rendered models**, i.e. rendering front-to-back, which may achieve practically the same speed up. In simple cases deferred shading may not even be worth it -- in [LRS](lrs.md) programs we may use it only rarely.
This is especially effective when using very expensive/complex pixel/fragment shaders while at the same time having many overlapping objects. **Sometimes deferred shading may be replaced by simply ordering the rendered models**, i.e. rendering front-to-back, which may achieve practically the same speed up (but may in turn lose speed at the sorting step). In simple cases deferred shading may not even be worth it -- in [LRS](lrs.md) programs we may use it only rarely. As always, the [overhead](overhead.md) may make many cases worse off than going the simpler way, plus we add [bloat](bloat.md).
Deferred shading also comes with complications, for example **rasterization [anti aliasing](antialiasing.md) can't be used** because, of course, anti-aliasing in G-buffer doesn't really make sense. This is usually solved by some [screen-space](screen_space.md) antialiasing technique such as [FXAA](fxaa.md), but of course that may be a bit inferior. **Transparency also poses an issue**.
Deferred shading also comes with complications, for example **rasterization [anti aliasing](antialiasing.md) can't be used** because, well, anti-aliasing in G-buffer doesn't really make sense. This is usually solved by some [screen-space](screen_space.md) antialiasing technique such as [FXAA](fxaa.md), but of course that may be a bit inferior. **Transparency also poses an issue** (for blending G-buffer would somehow have to store information about more than one surface).

View file

@ -1,3 +1,5 @@
# Entrepreneur
Entrepreneur is an individual practicing legal slavery, murder and theft under [capitalism](capitalism.md); capitalists describe those actions by euphemisms such as "doing [business](business.md)". Successful entrepreneurs can also be seen as mass murderers and terrorists as they consciously firstly hoard resources that poor people lack (including basic resources needed for living) and secondly cause and perpetuate situations such as the third world slavery where people die on a daily basis performing extremely difficult, dangerous and low paid work, so that the entrepreneur can buy his ass yet another private jet.
Entrepreneur is an individual practicing legal slavery, murder and theft under [capitalism](capitalism.md); capitalists describe those actions by euphemisms such as "doing [business](business.md)". Successful entrepreneurs can also be seen as mass murderers and terrorists as they consciously firstly hoard resources that poor people lack (including basic resources needed for living) and secondly cause and perpetuate situations such as the third world slavery where people die on a daily basis performing extremely difficult, dangerous and low paid work, so that the entrepreneur can buy his ass yet another private jet.
Some of the most famous and successful entrepreneurs include [Elon Musk](elon_musk.md) (psychopath, pathological liar), [Steve Jobs](steve_jobs.md) (psychopath, pathological liar), [Elizabeth Holmes](elizabeth_holmes.md) (psychopath, pathological liar), [Bill Gates](bill_gates.md) (psychopath, pathological liar), [Donald Trump](trump.md) (psychopath, pathological liar) and others.

View file

@ -334,7 +334,7 @@ sin(x) / cos(x) - log2(2) = tg(x) - 1*, so we get *tg(x) >= 1*. So that will hol
99. Cache is a small memory placed between the CPU and main memory (RAM), it is a very fast type of memory, faster than the main memory, but it's also much smaller than main memory. The idea is that programs typically do a lot of work in some small region of main memory, they keep reading and writing the same (or nearby) memory cell(s) over and over and only after a while move somewhere else. So once the program starts a work in some memory area, the cache can load that area, let the program do its work very quickly in the cache, and then (when the program moves elsewhere) copy the results back from the cache to the memory. It's similar to downloading a file from the Internet to the disk, then editing the file locally and later on uploading it back. However the cache will be effective only if the assumption we made hold, i.e. if the program really mostly works in small areas of memory and makes minimum of long jumps, so if a program wants to fully utilize the cache, it should try to minimize these long jumps (for example by putting related data close to each other).
100. There is no correct answering with either "yes" or "no" (this is therefore the correct answer). The question can be reworded as: *Is "yes" the wrong answer to this question?*, neither yes or no (or both at once) work as an answer: answering "yes" leads to a contradiction (by giving "yes" as a correct answer we'll imply it's actually the wrong answer) and answering "no" would imply "yes" is the correct answer (which we've proven to not work).
101. BENIS
102. [Floating point](float.md) had decreasing precision towards higher values, this one if already beyond the resolution of 1, so the float type cannot represent this number plus one, adding one rounds the result down to the same number.
102. [Floating point](float.md) has decreasing precision towards higher values, this one is already beyond the resolution of 1, so the float type cannot represent this number plus one, adding one rounds the result down to the same number.
103. no
104. We can't replace *a^(b/c)* with *(a^b)^(1/c)* if *a* is negative, that equation doesn't generally hold.
105. { I hope this is right :D ~drummyfish } First imagine the graph of a polar coordinate function that says the radius of a plain circle with radius *r* depending on angle: the graph is just constant function (horizontal line) with value *r* going from 0 to *2 * pi*. Integrating this function (from 0 to 2 * pi, here we simply multiply *r* by *2 * pi* as the graph is a rectangle) will give us the formula for the circumference of circle: *2 * pi * r* -- we'll take this largely on intuition but it can be seen that this holds because we're adding constant tiny increments of length from 0 to what we know is the circle circumference (2 * pi * r). Now imagine similar function, just starting at *r1* and linearly increasing to *r2*, i.e. we just have a linear function saying the spiral radius for current angle. Again, we'll integrate this, this time getting (bottom rectangle plus upper right triangle): *2 * pi * r1 + 2 * pi * (r2 - r1) / 2*. Simplifying this we get *pi * (r1 + r2)*, which is hopefully the solution (we see this will be between the circumferences of the smaller and larger circles, also for *r1 = r2* we again get the circumference of plain circle etc.).
@ -351,7 +351,7 @@ sin(x) / cos(x) - log2(2) = tg(x) - 1*, so we get *tg(x) >= 1*. So that will hol
116. Should be 1792 { Unless I counted it wrong lol. ~drummyfish }. We can count this by just considering each square on the board and summing all possible queen and knight moves from that square (queen and knight together cover all possible moves). Queen can obviously end up on any square and from knight's walk we know we can place a knight anywhere as well. This can probably be computed even manually but writing a quick program does the job quicker.
117. The term "second world" used to exist -- during the Cold War "first world" was used for the "western world", countries allied with US/NATO; the "second world" meant the "USSR world", and "third world" everyone else. After dissolution of Soviet Union the second world basically stopped existing, or rather merged with the first world, and since then the terms got more of an economical meaning rather than political.
118. Two miners were coming down but only one up, more workers were entering the mine than were leaving, so the workers started to pile up in the mine. Cimrman solved this by advising the workers to eat a lot before the shift and then work hard to lose some weight so that two heavy miners would be able to lift two lighter ones.
119. a XOR b = (a OR b) AND NOT(a AND b) = ((a NAND a) NAND (b NAND b)) AND (a NAND b) = (((a NAND a) NAND (b NAND b)) NAND (a NAND b)) NAND (((a NAND a) NAND (b NAND b)) NAND (a NAND b)).
119. a XOR b = (a AND NOT(b)) OR (NOT(a) AND b) = (a AND (b NAND b)) OR ((a NAND a) AND b) = NOT(a NAND (b NAND b)) AND ((a NAND a) NAND b) = (a NAND (b NAND b)) NAND ((a NAND a) NAND b).
120. Let *p* be the ant's relative position on the rubber, i.e. the fraction of the rubber he has already traveled; when *p = 1* he'll be in the finish. At the beginning his speed in fractions of the rubber per second is *v = 1/100*. As the rubber expands, the fractional speed decreases (he keeps moving at 1 cm/s but the total number of cm to be traveled increases): we can write the speed as a function of time: *v = 1/(100 + t)*. Now the fractional position *p* over time is an [integral](integral.md) of speed, i.e. *p = integrate 1/(100 + t) dt = log(100 + t) + C* and the initial position is *p = 0*, i.e. *C = -log(100)*, so *p = log(100 + t) - log(100)*. Now we just have to compute when *p* reaches 1, i.e. *log(100 + t) - log(100) = 1*, which gives us *t = 100 * (e - 1) ~= 171.83*. So the ant will reach the end in nearly 3 minutes.
121. 3: I destroyed 4 computers, so he told me 4 times I'm a retard, i.e. he first told me I'm a retard (this was not a repetition) and then repeated it three times.
122. Constant bitrate means a given time unit of the video will always be encoded with (at least approximately) the same number of [bits](bit.md). One second of the video will therefore take the same size no matter how complex or simple the encoded scene is. Advantages are for example being able to estimate size of any video just from its duration alone, easier seeking and rewinding to a random position, or that during streaming over network there will be a constant number of bits transferred per second, which is very predictable and good for many protocols. Disadvantage may be that sometimes space is wasted (we encode a simple scene with more bits than necessary) and that quality of the video won't be constant (scenes for which bits don't suffice will have to have their quality lowered).

View file

@ -43,20 +43,28 @@ The developers of Debian operating system have created their own guidelines (Deb
## Measuring Practical Freedom With Freedom Distance
One big issue related to free software and similar causes (e.g. [free hardware](free_hardware.md)) is slipping into the trap of only apparent freedom, getting false feeling of freedom without actually having real, practical freedom; that is having freedom given legally on the paper which however may be [de facto](de_facto.md) extremely hard or impossible to make use of practically in real life. Imagine for example a highly complex software that by its license gives everyone the right to modify it but in practice to make meaningful modifications one needs specialized hardware and deep knowledge and know-how of how the code really works -- example of this is for example the [Android](android.md) operating system. This particular example is called [bloat monopoly](bloat_monopoly.md) and is highly used to mislead users into thinking they have freedom or that they support something ethical while in fact they don't (see also e.g. [openwashing](openwashing.md)). Giving only this apparent freedom is how [capitalism](capitalism.md) adjusted to the wave of free software, it is how businesses silently smother real freedom while pretending to embrace free software (which they rather call [open source](open_source.md)). For this we always have to evaluate practical freedom we have, i.e. whether, and with what difficulties, we can execute the four basic freedoms required by free software -- remember that all are essential and once even a single of the freedoms is lost, the whole software becomes completely [proprietary](proprietary.md) and non-free.
One big issue related to free software and similar causes (e.g. [free hardware](free_hardware.md)) is slipping into the trap of only apparent freedom and acquiring false feeling of freedom without actually having real, practical freedom; that is having freedom given legally, "on the paper", which may however be [de facto](de_facto.md) extremely hard or impossible to make use of practically in real life. Imagine for example a highly complex software that by its license gives everyone the right to modify it but in practice to make meaningful modifications one needs specialized hardware and deep knowledge and know-how of how the code really works -- this demonstrates for example the [Android](android.md) operating system. This particular example is called [bloat monopoly](bloat_monopoly.md), a modern phenomenon commonly used to mislead users into thinking they have freedom or that they support something ethical while in fact they don't (see also e.g. [openwashing](openwashing.md)). Giving only this apparent freedom is how [capitalism](capitalism.md) adjusted to the wave of free software, it is how businesses silently smother real freedom while pretending to embrace free software (which they rather call [open source](open_source.md)). For this we always have to evaluate practical freedom we have, i.e. whether, and with what difficulties, we can execute the four basic freedoms required by free software -- remember that all are essential and once even a single of the freedoms is lost, the whole software becomes completely [proprietary](proprietary.md) and non-free.
One possible measure of practical freedom is **freedom distance**. For any piece of software that comes with a free license (i.e. one that gives the four essential freedoms legally) let us define freedom distance as the average minimum distance to the nearest man that can PRACTICALLY execute ALL of the freedoms (taken over all people in the world). In other words it says how far you have to go to reach the freedom you are promised. As any metric it's a bit of a simplification, but while physical distances may seem to not matter much in the age of Internet, the measure contains in it embedded the number of people who have control over the piece of software, it says how centralized the control is and how difficult it will be to for example spot and remove malicious features. Large freedom distance means the freedom is far away, that you are relying on someone in another country to fix your software which of course is dangerous, even the Internet may get split, it is important for you to be able to execute your freedom locally (even if you're not doing it now, it is important that you COULD). It may also happen that the foreign maintainer of your software suddenly turns evil -- e.g. in pursuit of profit -- and then having someone close who can take over fixing and maintaining that software is key for freedom. From this point of view a freedom distance shorter than one's body is ideal -- it would mean that any single individual has complete control over his own tool.
One of possible measures of practical freedom is what we'll call a **freedom distance**. For any piece of software that comes with a free license (i.e. one that gives the four essential freedoms legally) let us define freedom distance as the average minimum distance to the nearest man that can PRACTICALLY execute ALL of the freedoms (taken over all people in the world). In other words it says how far you have to go to reach the freedom you are promised. As any metric it's a bit of a simplification, but while physical distances may seem to not matter much in the age of Internet, the measure contains in it embedded the number of people who have control over the piece of software, it says how centralized the control is and how difficult it will be to for example spot and remove malicious features. Large freedom distance means the freedom is far away, that you are relying on someone in another country to fix your software which of course is dangerous, even the Internet may get split, it is important for you to be able to execute your freedom locally (even if you're not doing it now, it is important that you COULD). It may also happen that the foreign maintainer of your software suddenly turns evil -- e.g. in pursuit of profit -- and then having someone close who can take over fixing and maintaining that software is key for freedom. From this point of view a freedom distance shorter than one's body is ideal -- it would mean that any single individual has complete control over his own tool.
Let's show this on two extreme examples:
Let's demonstrate it on a few examples:
- A simple program will have very small freedom distance. For example the [suckless](suckless.md) implementation of the [cat](cat.md) program (from the [sbase](sbase.md) package) is written in C and currently has about 50 lines of code. How far on average do you have to go to find someone that will be able to use the program AND understand every part of the source code AND share the program AND make any kind of meaningful modification to it? Using and sharing will be pretty easy for everyone, but remember, we are looking for the closest human that can execute ALL of the freedoms, so we are looking for someone who can compile and modify very basic C programs. As the program is extremely simple, anyone who ever learned complete basics of programming will be able to do this, even if he's not nearly an expert at programming -- this particular program doesn't even use [object oriented programming](oop.md), design patterns and similar "advanced" things that would further reduce the number of people who understand it. If you are reading this wiki, you can almost definitely exercise all the freedoms with this program but even if you can't, it's extremely likely you will find someone who can in the neighborhood of your very street, and if not, then definitely at least the ICT teacher at nearest elementary school will. If the Internet goes down, if your country isolates politically or if the program's maintainer turns nuts or just stops maintaining the program, the program still stays quite safe and in your hands: if it needs fixing or improvement, at worst you'll have to ask your neighbor to help you out. Now if we average this freedom distance for all people on Earth, we may get a freedom distance smaller than the size of a small village -- this is pretty good.
- A very complex program will have big freedom distance. Here let's take a look at the mentioned [Android](android.md) operating system. Compiling Android is very hard, it even requires quite powerful hardware, it's not very likely you'll find someone who can easily do it very near, however to make meaningful modifications to the system will be yet much, much more difficult. Imagine you for example want to change process scheduling in the system's kernel, add new filesystem support, remove all networking and telemetry, port it to run in web browser or you want to replace the GUI system with a completely different one etc. Can you do these things easily? Remember, as a reader of this wiki you are technically skilled, and even so you most likely can't do it -- even if you're an excellent programmer and dedicate all energy to it, you will likely need a few weeks of full time work to add a simple feature to the OS, and you are still a negligible exception among all the normies around, so how far away is someone who has complete control over Android? These people are probably just sitting in Google headquarters. So Android's freedom distance will be quite close to average distance to Google headquarters over all people on Earth, which will be a distance of many countries.
## History
Free software was invented by [Richard Stallman](rms.md) in the 1980s. His free software movement inspired later movements such as the [free culture](free_culture.md) movement and the evil [open-source](open_source.md) movement.
Precursors to free software may reach as far back in [history](history.md) as we are willing look. They may include for example ancient [mathematicians](math.md) sharing their equations with each other, people sharing recipes for meals and possibly even the general ideas of [communism](communism.md) (not to be [confused](often_confused.md) with [Marxism](marxism.md)). Early digital sharing communities on networks such as [BBS](bbs.md) and [Usenet](usenet.md) worked like free software communities "by default", without really articulating or naming the concept -- they shared software informally without [licenses](license.md) as back then capitalists haven't yet had enough time to ruin everything, but that slowly started to change with more commercialization of the brand new field.
TODO: something here
Free software, in a form discussed here, was invented by [Richard Stallman](rms.md) in the 1980s. He cites his frustration with a proprietary printer driver as an initial impulse. In 1983 he announced the now already legendary project called [GNU](gnu.md) -- one to implement a completely free as in freedom [operating system](os.md). The announcement already contains the word "free", but more in a sense of "not having to pay for permissions". Additionally in 1985 Stallman established the [Free Software Foundation](fsf.md), a non-profit for promotion and support of free software, and this is when the term *free software* seems to have been clearly distinguished.
In early [1990s](90s.md) a new project called [Linux](linux.md) -- an operating system kernel -- joined GNU and as a final piece of the puzzle completed its main goal. From now on it became practically possibly to do one's computing solely with free software.
Free software gained enough momentum to become a serious threat to capitalism and many started to attack it, most notably [Microsoft](microsoft.md) who was caught red handed with the leak of so called *Halloween documents* in late [1990s](90s.md), in which they discuss strategies for eliminating the threat of free software.
Later on the free software movement inspired movements such as [free culture](free_culture.md) (shortly after the year 2000) and the evil [open-source](open_source.md) [fork](fork.md) (1998, a malicious response of business, a kind of "free software" minus ethics).
TODO: more more more, famous cases of FS (Doom engine, ...)
**By 2024 free software is dead** -- yes, [FSF](fsf.md) and a few other software "activists" are still around, but they don't bear any significance anymore, the free software movement disappeared just like hippies disappeared with 1960s. FSF has become just an email spamming organization supporting lesbian [rights](rights_culture.md) on the Internet, and those who truly believe in free software form a community that by its size is comparable to such insignificantly small groups as [suckless](suckless.md) for example. Everything is now "[open $ource](open_source.md)", which only means one thing: it is hosted on [GitHub](github.md), and doesn't at all imply free code, available code, non-malicious features or even perhaps such a laughable thing as pursuit of freedom. Corruption, politics and [free market](capitalism.md) have finally killed the free software movement, [open $ource](open_source.md) prevailed exactly as it was planned by capitalists at the meeting in 1998, and it has now redefined even the basic pillars of the four freedoms (partial openness, [fair use](fair_use.md) or just source availability is now practically synonymous with "open source") -- just like for example "thou shalt not kill" was removed from Christianity because it wasn't convenient for the overlords -- and by this the fate of technology is sealed, free software seems to have only postponed the [capitalist disaster](capitalist_singularity.md) by a few decades, which is still a remarkable feat. { It's been pointed out to me that even some project that call themselves "free" or "libre", such as "Libre"Boot, are in fact breaking the rules of freedom now, for example by including proprietary blobs. ~drummyfish }

3
gnu.md
View file

@ -63,4 +63,5 @@ GNU has developed an almost unbelievable amount of software, they have software
- [GNAA](gnaa.md)
- [PETA](peta.md)
- [copyleft](copyleft.md)
- [free software](free_software.md)
- [free software](free_software.md)
- [Linux](linux.md)

View file

@ -75,7 +75,7 @@ Latest trend on social media seems to be the **pseudo political incorrectness**,
Here is a small insult thesaurus. { The moby-thesaurus package for [dict](dict.md) can be used to get some more insults. ~drummyfish }
abomination, alibaba, anus, ape, assburger, asshole, ballsucker, bastard, bitch, blockhead, [boomer](boomer.md), braindead, burden, buttfucker, [capitalist](capitalism.md), castrato, chicken shit, chink, ching chong, chimp, cocksucker, clown, coon, crap, creep, cretin, cripple, cuck, cunt, cyclope, degenerate, dement, dickhead, dipshit, disgusting, dumbass, dummy, dwarf, egghead, eunuch, excrement, faggot, failed abortion, failure, fart, fat, fetus, [feminist](feminism.md), filth, fool, freak, fucker, garbage, gator bait, [gay](gay.md), gimp, gender bender, goblin, goon, gorilla, half-cattle, [Hitler](hitler.md), hoe, homo, idiot, imbecile, inbreeder, jackass, jerk, [kike](kike.md), kebab, king kong, landwhale, leech, lesbo, libtard, loser, maggot, manchild, menstruator, midget, monkey, moron, motherfucker, mudblood, mummy, mutant, neanderthal, [nigger](nigger.md), [noob](noob.md), [NPC](npc.md), normie, ogre, orc, oven dodger, oxygen thief, pain in the ass, pajeet, peasant, pidor, piece of shit, pig, pisshead, potato, prick, puke, pussy, quasimodo, rapist, rat, redneck, [retard](retard.md), rubbish, sandnigger, scat, schizo, scum, shemale, shirt lifter, [shit](shit.md), shitskin, simp, sissy, skeleton, skunk, slave, smelly, slut, snot, son of a bitch, stupid, soyboy, stinker, subhuman, sucker, terrorist, titsucker, trash, triffid, troon, turd, ugly, vegetable, voldemort, waste, weirdo, wimp, witch, whore, worm, yankee, [zoomer](zoomer.md)
abomination, alibaba, anus, ape, assburger, asshole, ballsucker, bastard, bitch, blockhead, [boomer](boomer.md), braindead, burden, buttfucker, [capitalist](capitalism.md), castrato, chicken shit, chink, ching chong, chimp, cocksucker, clown, coon, crap, creep, cretin, cripple, cuck, cunt, cyclope, degenerate, dement, dickhead, dipshit, disgusting, dumbass, dummy, dwarf, egghead, eunuch, excrement, faggot, failed abortion, failure, fart, fat, fetus, [feminist](feminism.md), filth, fool, freak, fucker, garbage, gator bait, [gay](gay.md), gimp, gender bender, goblin, goon, gorilla, half-cattle, [Hitler](hitler.md), hoe, homo, idiot, imbecile, inbreeder, jackass, jerk, [kike](kike.md), kebab, king kong, landwhale, leech, lesbo, libtard, loser, maggot, manchild, menstruator, midget, monkey, moron, motherfucker, mouthbreather, mudblood, mummy, mutant, neanderthal, [nigger](nigger.md), [noob](noob.md), [NPC](npc.md), normie, ogre, orc, oven dodger, oxygen thief, pain in the ass, pajeet, peasant, pidor, piece of shit, pig, pisshead, potato, prick, puke, pussy, quasimodo, rapist, rat, redneck, [retard](retard.md), rubbish, sandnigger, scat, schizo, scum, shemale, shirt lifter, [shit](shit.md), shitskin, simp, sissy, skeleton, skunk, slave, smelly, slut, snot, son of a bitch, stupid, soyboy, stinker, subhuman, sucker, terrorist, titsucker, trash, triffid, troon, turd, ugly, vegetable, voldemort, waste, weirdo, wimp, witch, whore, worm, yankee, [zoomer](zoomer.md)
**Insult generators** can be made for example using [regular expressions](regex.md) such as `(ass|butt|dick|cum|shit|fuck|soy|dumb|fat|crap|gay|skunk|jew|mud|cock|leech|jerk|dog)(head|wipe|nigger|whore|slut|tard|butt|boy|clown|bubble|turd|rat|pig|muggle|fart|fail|sucker)`.

View file

@ -17,12 +17,12 @@ Also let it be said that everyone has to find his own way of doing projects, it'
- **Take long breaks**, enjoy the fact this is not a "[job](work.md)" -- when you've become fed up with your project, take a pause. If you have other projects, you may hop onto another one (but if you're simply overall tired, just take a full vacation, go play games or whatever). In a week, month or a year you'll start to feel the urge to get back to it and when you do, it's a sign you'll be enjoying doing it again, it's very likely you'll then get a period of """[productivity](productivity_cult.md)""" (better said just enjoyment) and inspiration. Also when you get stuck or stand before an important decision taking a break is very much advised, you need a fresh mind and even if you make a decision, take a few more days to see if you still think it's good after some time.
- **Have multiple projects in progress**. This is cool for several reasons, for example it prevents a burn out of a single project -- if one projects becomes boring, shows to lead nowhere or you simply get tired of it for a while, you switch to a different one. Even if it fails completely and you delete it, you still have many other "children", it won't be a disaster. Sometimes you have a period when you want to program, so there's a programming project waiting for you, other times you feel like you wanna do music, and there is the project that needs some music, just ready for you. So this also stimulates you in different ways. And sometimes you get surprised if some small project turns into something unexpected maybe. It's just good to have this diversity in your art.
- **Do everything yourself and keep switching tasks**. This is similar to the other point about having multiple projects, just within a single project. Be your own programmer, graphic designer, musician, tester, writer and so on -- at least as much as possible. This not only helps you become a cool generalist, an independent, non-capitalist living being, but also prevents burn out from doing the same activity over and over.
- **Publish everything immediately**, don't wait until the project is "polished", this NEVER, never ends well. Really just have everything public at all times, keep no secrets, make it public even if it's buggy, shit, cringe, dangerous or whatever. This doesn't mean "go promote your buggy unfinished game", but simply "have your work-in-progress git repo public". This is not capitalism in which you work in secrecy and then "ship" a "product". Just make art and let anyone watch you, give you "feedback", advice and so on, get rid of shame, don't let others waste time on making what you're already making, don't let perfectionism paralyze you so that you'd never release your art.
- **Publish everything immediately**, don't wait until the project is "polished", this NEVER, never ends well. Really just have everything public at all times, keep no secrets, make it public even if it's buggy, shit, cringe, dangerous or whatever. This doesn't mean "go promote your buggy unfinished game", but simply "have your work-in-progress git repo public". This is not capitalism in which you work in secrecy and then "ship" a "product". Just make art and let anyone watch you, give you "feedback", advice and so on, get rid of shame, don't let others waste time on making what you're already making, don't let perfectionism paralyze you so that you'd never release your art. On the other hand, however, **leave the "official release" part for the very end** -- i.e. have the project public, but don't go actively showing it to people, don't waste time on adding it to repositories, making websites and similar stuff. Firstly this leaves you a kind of "reward" at the end, something you get for FINISHING the project. If you show a 50% finished game to the Internet and get a praise, you've gotten your treat ahead of time, you will no longer want to pursue finishing the thing. Secondly you may very likely abandon the project (and more so due to what's just been stated), leaving just a spam of unfinished half-baked ideas behind. Take a look a libregamewiki, vast majority of games are "50% finished" prototypes of no value to anyone.
- **If you ARE ambitious, separate the thing into multiple less ambitious projects**. Firstly this is just a good design, you shouldn't make a huge monolithic program but rather multiple simple things out of which it is easy to make the big thing. This achieves multiple things: you'll have several parallel projects as advised above and also if you don't finish the grandiose piece, you'll still probably finish at least some parts of it that will be useful on its own. So if you really want to make that GTA clone (and have at least 20 years of experience so that you can even think about it), rather make several projects such as a 3D renderer, physics engine, a pack of car 3D models etc. When all of the projects are ready, you may try to merge them into the magnum opus.
- **"It would be cool" is not a good enough motivation for a bigger project.** You can't start a big thing just out of boredom. Finishing a greater thing will be painful, you'll be through sleepless nights, periods of desperation, headaches and burn outs, you'll sacrifice social life to hunting down bugs and rewriting shitty code. To keep yourself going through this it's not enough to know that "the result will be nice I guess". It needs more -- you must absolutely feel it is necessary to make the thing, you have to think the world NEEDs you to make it, only then you will keep torturing yourself to make it to the finish. So choose very wisely.
- **Before making a big thing of type X make a small thing of type X** or as it's been said "plan to throw one away". This is to say that you can't make a good game if it's the first game you're making, so you better make your first game small knowing that it ill suck rather than making a big game that would suck. The first thing is just for the experience. You can't prepare yourself for making an operating system just by reading a book, you have to make one to REALLY comprehend what it will be about, to see the whole picture and to properly plan it.
- **Don't spontaneously start projects, don't rush, only start well thought through things.** As a creative being you'll be getting hundreds and hundreds of amazing ideas -- don't think you're a genius, this is common for many people, even normies get many ideas for great games and "apps" and whatever, so don't get too excited, it is important you judge carefully what to do and what to leave for later: planning and actually MAKING the thing is the actual part that will distinguish you from the normie. Write your amazing ideas down if you need, but don't jump in on any new great idea that appears, always let any idea sit for at least half a year, maybe even several years. It is very tempting to start new things but you must have self control, or else you'll end up like the [dog](dog.md) that starts chasing any new smell it catches and will be just chaotically running around without any goal, making unplanned projects that will fail every time. If an idea should deserve your valuable time, it has to pass the great filter of time -- if it survives in your head after a few months, in all the avalanche of new and new ideas, you know it may truly be worth trying. Furthermore you also have to have a good plan for any project you start and this planning requires a lot of thinking ahead -- you should only start writing code once you have the whole project in your head. This planning CANNOT be rushed, you can't plan it over a weekend, this is not [capitalism](capitalism.md) where things are made on schedule, this is [art](art.md) that needs its time, it must wait for inspiration, small improvements and rethinks over the time that it's sitting in your head. In this meantime stay with your already work in progress projects.
- **Leave your session with something pleasant to be done next**: this will make you look forwards to come back to "work" on the project next time. If you're doing something painful, like being in a middle of [debugging](debugging.md) horror, try to finish it, and once there is something enjoyable next on the TODO, such as making game levels or playtesting, leave it for next time.
- **Leave your session with something pleasant to be done next**: this will make you look forwards to come back to "work" on the project next time. If you're doing something painful, like being in a middle of [debugging](debugging.md) horror, try to finish it, and once there is something enjoyable next on the TODO, such as making game levels or playtesting, leave it for next time. In general **make it easy and pleasant for your future self to come back to the project**, i.e. don't leave in the middle of solving some complicated task -- rather finish it and leave with a choice of what to do next.
- On very rare occasion inspiration comes and a masterpiece is born within an hour, but moments like these are as common as finding a gold nugget in mounds of dirt -- rare sparks of genius are a small reward to diligent artists, but cannot be relied on. Most of the time **great art is simply made by sitting on it for hours without end and pouring TONS of time, sweat and blood in**, trying and failing over and over, rewriting and refining, testing and rebuilding from scratch. Do not wait for the muses, they won't come, you are wasting time. You must rely only on your patience to make something worthy of appreciation -- go do it right now. Miraculous accidental discoveries do happen, but they always happen to those who keep exploring tirelessly, never to those who just wait for something to fall from the sky.
- **Start small and humble (if it's meant to be big, it will become big naturally), focus on the thing you're making (not its promotion or "management").** Some nubs just see [Steve Jewbs](steve_jobs.md) or [Che Guevara](che_guevara.md) and think "I'LL BE A BIG PROJECT LEADER", they pick some shitty idea they don't even care too much about and then just start capitalisting, they buy a suit, coffee machine, web domains, set up a kickstarter, make a Jewtube video, Twitter account, logos, set up [promotional](marketing.md) websites, write manifestos and other shite. Yes, manifestos are cool, but only promise yourself to write it once the project is fucking done and worth something ;) Sometimes they hype a million people to jump on board, promising to make a HUGE, gigantically successful and revolutionary thing, while having 3 lines of code written so far. Congratulations, you now have nothing and the pressure of the whole world to make something big. This is the best way to hell. At BEST you will become a slave to the project, will hate it and somehow manage to make an ugly, rushed version of it because you didn't foresee what obstacles there would appear but which you would still have to solve fucking quickly because everything is falling on your head and people are shitting on you, angry that you're already two years late and you're already burned out and depressed and out of budget. Just don't be such a capitalist pussy, make a nice small thing in your basement and let its value show itself.
- **Make it a habit/routine to do your project**. As with everything requiring a lot of time investment and dedication (exercise, language learning, ...), it's important to make it a routine (unless of course you're taking a break) to really do something significant. A small, spontaneous, irregular polish of your project is great too, but to really do the biggest part you just need a habit. People often say they're lazy and can't get into it -- everyone is lazy and everyone can get into it. Here is the trick: start with trivial things, just to get into the habit, i.e. at first it's literally enough to write 1 line of code every day. At the beginning you're not really doing much of any significant "work", you are just setting up your habit. Anyone can write 1 line of code per day: just tell yourself to do this -- write 1 line and then, if you want, you're done. You will find that second or third day you'll be writing 10 lines and in a week you will quite likely be looking forward to it, soon you'll have the other problem -- getting yourself to stop.

File diff suppressed because it is too large Load diff

65
unix.md
View file

@ -33,11 +33,13 @@ UNDER CONSTRUCTION
*Note: here by "Unix" we will more or less assume a system conforming to some version of the POSIX standard.*
This section will help complete noobs kickstart their journey with a Unix-like system such as [GNU](gnu.md)/[Linux](linux.md) or [BSD](bsd.md). Please be aware that each system has its additional specifics, for example [package managers](package_manager.md), init systems and so on -- these you must learn about elsewhere as here we may only cover the core parts those systems inherited from the original Unix. Having learned this though you should be able to somewhat fly any Unix like system. Obviously we'll be making some simplifications here too.
This should help complete noobs kickstart their journey with a Unix-like system such as [GNU](gnu.md)/[Linux](linux.md) or [BSD](bsd.md). Please be aware that each system has its additional specifics, for example [package managers](package_manager.md), init systems, [GUI](gui.md) and so on -- these you must learn about elsewhere as here we may only cover the core parts those systems inherited from the original Unix. Having learned this though you should be able to somewhat fly any Unix like system. Obviously we'll be making some simplifications here too, don't be too pedantic if you're a pro Unix guru please.
Learning to use Unix practically means **learning the [command line](cli.md)** plus a few extra things (such as various concepts, philosophies, conventions, file system structure etc.). Your system will have a way for you to enter the command line where you can interact with it only through textual commands (i.e. without [GUI](gui.md)). Sometimes the system boots up to command line, sometimes you must click some icon (usually called *terminal*, *term*, *shell*, *command line* etc.), sometimes you can switch [TTY](tty.md)s with *CTRL+ALT+Fkeys* etc. To command line virgins this will seem a little intimidating but it's absolutely required to know at least the basics, on Unices the command line is extremely powerful, efficient and much can only ever be achieved through command line.
Also a NOTE: terms such as *command line*, *terminal* or *shell* have different meanings, but for simplicity we'll be treating them more or less as synonyms here.
**The gist**: unsurprisingly in command line you write commands -- many of these are actually tiny programs called **Unix utilities** (or just "utils"). These are tools for you to do whatever you want (including stuff that on normie systems are usually done by clicking with a [mouse](mouse.md)). For example `ls` is a program that writes out list of files in the working directory, `cd` is a program that changes working directory etc. There are many more such programs and you must learn at least the most commonly used ones. Good news is that these programs are more or less the same on every Unix system so you just learn this once. There also exist other kinds of commands -- those defined by the shell language ([shell](shell.md) is basically a fancy word for the textual interface), which allow us to combine the utilities together and even [program](programming.md) the shell (we call this [scripting](script.md)). First learn the utils (see the list below).
Learning to use Unix in practical terms firstly means **learning the [command line](cli.md)** and then a few extra things (various concepts, philosophies, conventions, file system structure etc.). Your system will have a way for you to enter the command line that allows you to interact with it only through textual commands (i.e. without [GUI](gui.md)). Sometimes the system boots up to command line, other time you must click an icon somewhere (called *terminal*, *term*, *shell*, *command line* etc.), sometimes you can switch [TTY](tty.md)s with *CTRL+ALT+Fkeys* etc. To command line virgins this will seem a little intimidating but it's absolutely necessary to know at least the basics, on Unices the command line is extremely powerful, efficient and much can only ever be achieved through the command line.
**The gist**: unsurprisingly in command line you write commands -- many of these are actually tiny programs called **Unix utilities** (or just "utils"). These are installed by default and, they're tools for you to do whatever you want (including stuff that on normie systems you usually do by clicking with a [mouse](mouse.md)). For example `ls` is a program that writes out list of files in the working directory, `cd` is a program that changes working directory etc. There are many more such programs and you must learn at least the most commonly used ones. Good news is that the programs are more or less the same on every Unix system so you just learn this once. There also exist other kinds of commands -- those defined by the shell language ([shell](shell.md) is basically a fancy word for the textual interface), which allow us to combine the utilities together and even [program](programming.md) the shell (we call this [scripting](script.md)). First learn the utils (see the list below).
PRO TIP: convenient features are often implemented, most useful ones include going through the history of previously typed commands with UP/DOWN keys and completing commands with the TAB key, which you'll find yourself using very frequently. Try it. It's enough to type just first few letters and then press tab, the command will be completed (at least as much as can be guessed).
@ -51,17 +53,13 @@ To **run a program** that's present in the current directory as a file you can't
Now to the very basic stuff: **browsing directories, moving and deleting files etc.** This is done with the following utils: `ls` (prints files in current directory), `pwd` (prints path to current directory), `cd` (travels to given directory, `cd ..` travels back), `cat` (outputs content of given file), `mkdir` (creates directory), `rm` (removes given file; to remove a directory `-rf` flag must be present), `cp` (copies file), `mv` (moves file, including directory -- note that moving also serves for renaming). As an exercise try these out (careful with `rm -rf`) and read manual pages of the commands (you'll find that `ls` can also tell you for example the file sizes and so on).
**Files and file system**: On Unices the whole filesystem hierarchy starts with a directory called just `/` (the root directory), i.e. every absolute (full) path will always start with slash. For example pictures belonging to the user *john* may live under `/home/john/pictures`. It's also possible to use relative paths, i.e. ones that are considered to start in the current (working) directory. A dot (`.`) stands for current directory and two dots (`..`) for the directory "above" the current one. I.e. if our current directory is `/home/john`, we can list the pictures with `ls pictures` as well as `ls /home/john/pictures` or `ls ./pictures`. Absolute and relative paths are distinguished by the fact the absolute one always starts with `/` while relative don't. There are several **types of files**, most importantly *regular files* (the "normal" files) and *directories* (there are more such *symbolic links*, *sockets*, *block special files* etc., but for now we'll be ignoring these). Unix has a [paradigm](paradigm.md) stating that **everything's a [file](file.md)**, so notably accessing e.g. hardware devices is done by accessing special device files (placed in `/dev`).
**Files and file system**: On Unices the whole filesystem hierarchy starts with a directory called just `/` (the root directory), i.e. every absolute (full) path will always start with slash (don't confuse `/` with `\`). For example pictures belonging to the user *john* may live under `/home/john/pictures`. It's also possible to use relative paths, i.e. ones that are considered to start in the current (working) directory. A dot (`.`) stands for current directory and two dots (`..`) for the directory "above" the current one. I.e. if our current directory is `/home/john`, we can list the pictures with `ls pictures` as well as `ls /home/john/pictures` or `ls ./pictures`. Absolute and relative paths are distinguished by the fact the absolute one always starts with `/` while relative don't. There are several **types of files**, most importantly *regular files* (the "normal" files) and *directories* (there are more such *symbolic links*, *sockets*, *block special files* etc., but for now we'll be ignoring these). Unix has a [paradigm](paradigm.md) stating that **everything's a [file](file.md)**, so notably accessing e.g. hardware devices is done by accessing special device files (placed in `/dev`). Just remember this concept, you'll hear about it often.
NOTE: On Unices files often don't have extensions as it's often relied on so called [magic number](magic_numbers.md) (first few bytes in the file) to decide what kind of file we're dealing with. You will see files with extension (`.sh`, `.txt`, ...) but notably for example compiled programs typically don't have any (unlike for example on [Windows](windows.md)).
Files additionally have attributes, importantly so called **permissions** -- unfortunately these are a bit complicated, but as a mere user working with your own files you won't have to deal too much with them, only remember if you encounter issues with accessing files, it's likely due to this. In short: each file has an owner and then also a set of permissions that say who's allowed to do what with the file. There are three kind of permissions: *read* (`r`), *write* (`w`) and *execute* (`x`), and ALL THREE are defined for the file's owner, for the file's group and for everyone else, plus there is a magical value suid/sgid/sticky we won't delve into. All of this is then usually written either as a 4 digit [octal](octal.md) number (each digit expresses the three permission [bits](bit.md)) or as a 12 character string (containing the `r`/`w`/`x`/`-` characters). Well, let's not dig much deeper now.
TODO: more more more
PRO TIP: there is a very useful feature called **wildcard characters** that help us handle many files at once. Most commonly used are `*` and `?` wildcards -- if we use these in a program argument, the arguments will be expanded so that we get a list of files matching certain pattern. This sounds complicated but let's see an example. If we write let's say `rm *.jpg`, we are going to remove all files in current directory whose name ends with `.jpg`. This is because `*` is a wildcard character that matches any string and when we execute the command, the shell actually replaces our argument with all files that match our pattern, so the command may actually internally look like `rm picture1.jpg picture2.jpg picture3.jpg`. `?` character is similar but matches exactly one character (whatever it is), so to list for example all files whose name is exactly three characters we can write `ls ???`.
Here is a quick cheatsheet of the most common Unix utilities:
@ -100,11 +98,11 @@ Here is a quick cheatsheet of the most common Unix utilities:
| [vi](vi.md) | advanced text editor | |
| wc | word count (count characters or lines in file, can tell exact file size) | -c (character), -l (lines), file |
NOTES on the utilities:
NOTES on the above table:
- Typically there are two ways of feeding input data to a utility: either by specifying a file to read from or by feeding the input on to the utility's standard input. This also applies to the output. Using standard input/output is a more "Unix" way as it allows us to chain the utlities with pipes, make one program feed its output to another an input.
- Typically there are two ways of feeding input data to a utility: either by specifying a file to read from or by feeding the input on to the utility's standard input. This also applies to the output. Using standard input/output is a more "Unix" way as it allows us to chain the utlities with pipes, make one program feed its output to another as input.
- Utilities try to follow common conventions so that it's easier to guess and remember what flags mean etc., for example `-h` is commonly a flag for getting help, `-o` is one for specifying output file etc.
- Specific Unix systems will normally have more feature rich utilities, supporting additional flags and even adding new utilities. Check out manual pages on your system. You'll have to learn about common utils that aren't part of POSIX, e.g. [wget](wget.md), [ssh](ssh.md), [curl](curl.md), [sudo](sudo.md), [apt](apt.md) and more.
- Specific Unix systems will normally have more feature rich utilities, supporting additional flags and even adding new utilities. Check out manual pages on your system. You'll probably have to learn about common utils that aren't part of POSIX, e.g. *[wget](wget.md)*, *history*, *[ssh](ssh.md)*, *[curl](curl.md)*, *[sudo](sudo.md)*, *[apt](apt.md)* and more. And of course there are thousands and thousands of additional utilities/programs you can download, program or otherwise install on your system.
Now on to a key feature of Unix: **pipelines and redirects**. [Processes](process.md) (running programs) on Unix have so called **standard input** (*stdin*) and **standard output** (*stdout*) -- these are streams of data (often textual but also binary) that the process takes on input and output respectively. There may also exist more streams (notably e.g. *standard error output*) but again, we'll ignore this now. When you run a program (utility etc.) in the command line, standard input will normally come from your keyboard and standard output will be connected to the terminal (i.e. you'll see it being written out in the command line). However sometimes you may want the program to take input from a file and/or to write its output to a file (imagine e.g. keeping [logs](logging.md)), or you may even want one program to feed its output as an input to another program! This is very powerful as you may combine the many small utilities into more powerful units. See also [Unix philosophy](unix_philosophy.md).
@ -112,14 +110,45 @@ Most commonly used redirections are done like this:
- `command > file`: redirects output of *command* to file *file* (rewriting its content if there is any).
- `command < file`: redirects input of *command* to come from *file*.
- `command >> file`: output of *command* will be appended (added to the end) to *file*.
- `command >> file`: output of *command* will be appended to *file* (i.e. added at its end).
Pipelines are similar: they are chains of several programs separated by a "pipe" character: `|`. This makes a program feed its output to the input of the next program. For example `ls | grep \.html` will run the `ls` command and pass its output (list of files in current directory) to `grep`, which will only filter out those that contain the ".html" string.
Several commands can also be written on a single line, they just have to be separated with `;`.
**Example**:
**Example** of doing stuff in a Unix terminal (`#` character starts a [comment](comment.md) -- these are here only to describe what's happening in the example):
TODO: stdin/out/err, utils, shell, sh (running programs, ...), usual "workflows" (man pages, history, arrows, tab-completion, ...), often used commands, examples, permissions, variables and exit codes, wildcards
```
> pwd
/home/drummyfish
> ls
Pictures Documents Downloads
git Videos
> cd Downloads
> ls
free_software_song.midi hentai_porn.mp4
lrs_wiki.txt
> rm hentai_porn.mp4 # oh noes, quickly delete this
> cd ../git; ls
Anarch comun Licar
raycastlib small3dlib
> cd Anarch
> wc -l *.h *.c | tail -n 1 # count lines of code in .h and .c files
14711 total
> cat *.h *.c | grep "TODO" # show all TODOs in code
(SFG_game.backgroundScaleMap[(pixel->position.y // ^ TODO: get rid of mod?
RCL_Unit direction; // TODO: rename to "angle" to keep consistency
TODO: maybe array functions should be replaced by defines of funtion names
/* FIXME/TODO: The adjusted (=orthogonal, camera-space) distance could
RCL_Unit limit1, // TODO: int16_t?
RCL_Unit depth = 0; /* TODO: this is for clamping depth to 0 so that we don't
increment == -1 ? i >= limit : i <= limit; /* TODO: is efficient? */\
RCL_Unit limit1, // TODO: int16_t?
increment == -1 ? i >= limit : i <= limit; // TODO: is efficient?
// TODO: probably doesn't work
#if 1 // TODO: add other options for input handling (SDL, xinput, ...)
> echo "Remember to fix the TODOs in code!" >> TODO.txt # add note to TODO file
```
## See Also

File diff suppressed because one or more lines are too long

View file

@ -3,9 +3,9 @@
This is an autogenerated article holding stats about this wiki.
- number of articles: 626
- number of commits: 979
- total size of all texts in bytes: 5110607
- total number of lines of article texts: 37104
- number of commits: 980
- total size of all texts in bytes: 5118393
- total number of lines of article texts: 37142
- number of script lines: 324
- occurrences of the word "person": 10
- occurrences of the word "nigger": 114
@ -35,60 +35,71 @@ longest articles:
top 50 5+ letter words:
- which (2820)
- there (2207)
- people (2173)
- example (1779)
- other (1595)
- about (1421)
- number (1332)
- which (2823)
- there (2214)
- people (2174)
- example (1786)
- other (1597)
- about (1422)
- number (1333)
- software (1267)
- because (1175)
- their (1104)
- would (1073)
- something (1053)
- program (1047)
- being (1029)
- something (1056)
- program (1052)
- being (1033)
- things (962)
- language (937)
- called (933)
- language (938)
- called (936)
- without (865)
- function (864)
- simple (862)
- simple (863)
- computer (844)
- numbers (831)
- different (796)
- these (781)
- however (779)
- numbers (834)
- different (797)
- these (784)
- however (780)
- programming (771)
- world (758)
- system (741)
- world (760)
- system (743)
- should (723)
- doesn (714)
- doesn (715)
- still (712)
- games (691)
- games (692)
- while (673)
- society (672)
- drummyfish (671)
- while (670)
- point (669)
- simply (656)
- possible (654)
- possible (655)
- probably (646)
- using (643)
- always (631)
- using (644)
- always (633)
- course (612)
- similar (602)
- actually (592)
- someone (587)
- https (587)
- though (582)
- basically (571)
- basically (572)
- really (569)
- usually (556)
latest changes:
```
Date: Sun Mar 2 21:01:56 2025 +0100
ascii.md
atheism.md
number.md
piracy.md
portability.md
productivity_cult.md
random_page.md
unix.md
wiki_pages.md
wiki_stats.md
Date: Sat Mar 1 19:31:47 2025 +0100
3d_rendering.md
bitreich.md
@ -111,17 +122,6 @@ Date: Sat Mar 1 13:35:54 2025 +0100
free_software.md
fsf.md
gnu.md
random_page.md
shit.md
shitpress.md
thrembo.md
wiki_pages.md
wiki_stats.md
Date: Sat Mar 1 01:35:35 2025 +0100
anarch.md
atan.md
bootstrap.md
chess.md
```
most wanted pages:
@ -150,8 +150,8 @@ most wanted pages:
most popular and lonely pages:
- [lrs](lrs.md) (337)
- [capitalism](capitalism.md) (304)
- [c](c.md) (238)
- [capitalism](capitalism.md) (305)
- [c](c.md) (239)
- [bloat](bloat.md) (230)
- [free_software](free_software.md) (198)
- [game](game.md) (152)
@ -166,12 +166,12 @@ most popular and lonely pages:
- [fun](fun.md) (105)
- [math](math.md) (104)
- [gnu](gnu.md) (102)
- [shit](shit.md) (100)
- [shit](shit.md) (101)
- [linux](linux.md) (100)
- [woman](woman.md) (99)
- [corporation](corporation.md) (96)
- [bullshit](bullshit.md) (96)
- [fight_culture](fight_culture.md) (95)
- [corporation](corporation.md) (95)
- [bullshit](bullshit.md) (95)
- [art](art.md) (93)
- [less_retarded_society](less_retarded_society.md) (92)
- [hacking](hacking.md) (92)