1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//! # Dynamic programming languages

// # Dynamic programming languages and Amateur enterprise Java engineers

/// # Amateur enterprise Java engineers
///
/// Today I'm attacking `https://airpush.com`, an ad platform.
///
/// Their Android SDK has a `.jar` file, which is automatically generated. The file's package name is automatically generated, for example:
///
/// ```java
/// com.nndvj7uvkmc5cktz8i4rohlk.p9fogepwy0ia
/// ```
///
/// So you cannot write a common library which use their SDK. For each implementation, you have to repeat boilerplate code.
///
/// So Airpush, you have an amateur Android team. Whenever I have a client asking me about your platform, I would highly suggest them to avoid
/// it.
const _27_: () = ();

/// # Running a Rust web server with [`systemd`][systemd]
///
/// _I have one note ahead: I'm an amateur programmer. So my experiences should only be used as references._
///
/// ## Why [`systemd`][systemd]?
///
/// Quoting from its website:
///
/// > `systemd` is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts
/// > the rest of the system. `systemd` provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting
/// > services, offers on-demand starting of daemons, keeps track of processes using Linux control groups, maintains mount and automount points,
/// > and implements an elaborate transactional dependency-based service control logic. `systemd` supports SysV and LSB init scripts and works
/// > as a replacement for sysvinit. Other parts include a logging daemon, utilities to control basic system configuration like the hostname,
/// > date, locale, maintain a list of logged-in users and running containers and virtual machines, system accounts, runtime directories and
/// > settings, and daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution.
///
/// From my view, it's basically a process manager.
///
/// ## Quick use
///
/// Normally, a service file is put in `/etc/systemd/system/` with `.service` extension. For example:
///
/// ```ini
/// [Unit]
/// Description=API-1
///
/// [Service]
/// ExecStart=/home/api1/bin/api1
/// WorkingDirectory=/home/api1/bin/
/// LimitCPU=infinity
/// LimitCORE=infinity
/// LimitNOFILE=infinity
/// MemoryLimit=infinity
///
/// [Install]
/// WantedBy=multi-user.target
/// ```
///
/// Note that some default settings are very limited. For example I called `libc::getrlimit()` of `libc::RLIMIT_NOFILE` under root user, and got
/// `1_048_576`. But then calling that when running as a service, I got `4096` (or `4095`, I don't remember correctly). That's why I added some
/// limit flags to the sample.
///
/// ## Enabling/disabling a service
///
/// To enable:
///
/// ```shell
/// sudo systemctl enable --now file-name.service
/// ```
///
/// To disable, replace `enable` with `disable`.
///
/// ## Viewing logs
///
/// Human readable:
///
/// ```shell
/// systemctl status file-name.service
/// ```
///
/// Parsable by machine:
///
/// ```shell
/// systemctl show file-name.service
/// ```
///
/// ## Conclusion
///
/// That's it  `:-D`
///
/// I guess you might want to try with your test projects first.
///
/// [systemd]: https://freedesktop.org/wiki/Software/systemd/
pub const _15_: () = ();

/// # Dynamic programming languages
///
/// They have good ideas about shortening the code. But they are too arrogant to take away a lot:
///
/// - They run garbage collectors: they are selfish. Garbage collectors reflect laziness from developers.
/// - They introduce duck typing: they treat developers like chicken, which are true. Any developers on this planet who use duck typing, are
///   chicken. I don't understand why employers sign any contract to people who write contractless code?
/// - They use [global interpreter lock (GIL)][wiki:global-interpreter-lock]. Today is near the end of 2018, let's name a few: PHP, Ruby,
///   Python... Wow! Years of researches and developments have contributed power to the languages' designers, to keep the GIL in, up and
///   healthy.
/// - They shave RAM.
///
/// # However...
///
/// The clouds love them. Of course. They shave RAM. They bite the heads of CPU chips during a meeting.
///
/// Lazy "developers" love them.
///
/// It's all good for business.
///
/// I like dynamic programming languages too. Once I know that my competitors use dynamic programming languages, I consider them wiped out, on
/// the market.
///
/// # Java
///
/// I like this one even more. It's an extremely gorgeous language ever invented on this planet. It's not a dynamic language, but it's so good
/// that makes me name it here.
///
/// Millions upon millions of developers are using Java.
///
/// Good.
///
/// [wiki:global-interpreter-lock]: https://en.wikipedia.org/wiki/Global_interpreter_lock
pub const _08_: () = ();