vault backup: 2026-01-05 13:03:55
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: Filesystem limitation
|
||||
created: 2025-12-30
|
||||
updated: 2025-12-30
|
||||
tags: []
|
||||
---
|
||||
|
||||
Fundamental rules for for Universal Naming Convention (UNC),which enable applications to create and process valid names for files and directories, regardless of the file system:
|
||||
|
||||
Following reserved characters:
|
||||
```
|
||||
< (less than)
|
||||
> (greater than)
|
||||
: (colon)
|
||||
" (double quote)
|
||||
/ (forward slash)
|
||||
\ (backslash)
|
||||
| (vertical bar or pipe)
|
||||
? (question mark)
|
||||
* (asterisk)
|
||||
```
|
||||
Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255),
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: Gradle cheatsheet
|
||||
created: 2025-12-30
|
||||
updated: 2025-12-30
|
||||
tags: []
|
||||
---
|
||||
|
||||
Java parameters references:
|
||||
[Gradle Java Plugin](https://docs.gradle.org/current/userguide/java_plugin.html)
|
||||
|
||||
Running only certain test to debug problems:
|
||||
```
|
||||
gradle test --tests org.gradle.SomeTest.someSpecificFeature
|
||||
gradle test --tests *SomeTest.someSpecificFeature
|
||||
gradle test --tests *SomeSpecificTest
|
||||
gradle test --tests all.in.specific.package*
|
||||
gradle test --tests *IntegTest
|
||||
gradle test --tests *IntegTest*ui*
|
||||
gradle test --tests *IntegTest.singleMethod
|
||||
gradle someTestTask --tests *UiTest someOtherTestTask --tests *WebTest*ui
|
||||
```
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: Install IPA server
|
||||
created: 2025-12-30
|
||||
updated: 2025-12-30
|
||||
tags: []
|
||||
---
|
||||
|
||||
```bash
|
||||
|
||||
sudo ipa-server-install --realm=INT.IT2000.COM.CN --domain=int.it2000.com.cn --ds-password=admingzzn --admin-password=admingzzn --hostname=ipa.int.it2000.com.cn --ip-address=10.16.67.98 --setup-dns
|
||||
|
||||
sudo firewall-cmd --add-service={http,https,dns,ntp,freeipa-ldap,freeipa-ldaps} --permanent
|
||||
|
||||
sudo firewall-cmd --reload
|
||||
|
||||
```
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: The Omnipresence of Work - More to That
|
||||
created: 2025-12-30
|
||||
updated: 2025-12-30
|
||||
tags: []
|
||||
---
|
||||
|
||||
Title: "The Omnipresence of Work - More to That"
|
||||
Author: [[moretothat.com]]
|
||||
From: https://moretothat.com/the-omnipresence-of-work/
|
||||
|
||||
## Highlights:
|
||||
|
||||
The moment one node dies, many others will learn from the ideas of that node, and those thoughts form the foundation of further ideas to come. This is why the words of dead poets, politicians, and philosophers grow increasingly influential as time runs its course
|
||||
|
||||
---
|
||||
|
||||
In this case, the always-on nature of the mind is a key feature of our species, creating products that hopefully increase well-being with each release.
|
||||
|
||||
---
|
||||
|
||||
If Condition #1 is taken to its logical endpoint, then we will view the natural world primarily for its utility, rather than for its sheer beauty
|
||||
|
||||
---
|
||||
|
||||
If Condition #2 is taken to its logical endpoint, then things look even bleaker. If everything we touch in the material world has to serve some sort of function, isn't it only a matter of time before humans themselves have to serve some sort of greater function as well
|
||||
|
||||
---
|
||||
|
||||
In both scenarios, however, labor and leisure were delineated by physical space. If you were situated within the four walls of your factory or office, it was time to work. If you found yourself within the four walls of your home, it was time to relax
|
||||
|
||||
---
|
||||
|
||||
The home is no longer an environmental cue to put work aside. It is a place that constantly reminds you that there is always more work to be done.
|
||||
|
||||
---
|
||||
|
||||
Availability is no longer determined by one's time, but by one's attention.
|
||||
|
||||
---
|
||||
|
||||
Technological progress in the era of knowledge work can be defined by these three things:
|
||||
|
||||
(1) Make it easier to connect with others,
|
||||
|
||||
(2) Make it faster to get what you need,
|
||||
|
||||
(3) Make it pretty and appealing.
|
||||
|
||||
---
|
||||
|
||||
We willingly tether ourselves to the constant demands of the workplace, either by actively working on our projects during the day, or by passively checking on their progress at night.
|
||||
|
||||
---
|
||||
|
||||
but given this dynamic, it seems inevitable that we start defining ourselves by what we're able to produce, while everything else goes by the wayside.
|
||||
|
||||
---
|
||||
|
||||
Work, like everything else in nature, follows a circadian rhythm. Intense periods of energy expenditure are followed by requisite periods of rest. The important thing is that the rest must be sustained, and not broken up by intermittent worries and thoughts. That's like getting 8 hours of sleep, but having it interrupted by the hour. You and I know that nothing productive will be done the following morning.
|
||||
|
||||
---
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: block sudo to specific command
|
||||
created: 2025-12-30
|
||||
updated: 2025-12-30
|
||||
tags: []
|
||||
---
|
||||
|
||||
If your user is called `user` and your host is called you could add these lines to `/etc/sudoers`:
|
||||
|
||||
```
|
||||
user = (root) NOPASSWD: /sbin/shutdown
|
||||
user = (root) NOPASSWD: /sbin/reboot
|
||||
```
|
||||
|
||||
This will allow the user `user` to run the desired commands without entering a password. All other sudoed commands will still require a password.
|
||||
|
||||
The commands specified in the `sudoers` file _must_ be fully qualified (i.e. using the absolute path to the command to run)
|
||||
|
||||
If the command ends with a trailing `/` character and points to a directory, the user will be able to run any command in that directory (but not in any sub-directories therein). In the following example, the user `user` can run any command in the directory `/home/someuser/bin/`:
|
||||
|
||||
```
|
||||
user = (root) NOPASSWD: /home/someuser/bin/
|
||||
```
|
||||
|
||||
As an alternative to editing the `/etc/sudoers` file, you could add the two lines to a new file in `/etc/sudoers.d` e.g. `/etc/sudoers.d/shutdown`. This is an elegant way of separating different changes to the `sudo` rights and also leaves the original `sudoers` file untouched for easier upgrades.
|
||||
|
||||
*visudo can be used to edit those files too, this prevent error that could lock you out of the system*
|
||||
```
|
||||
sudo visudo -f /etc/sudoers.d/shutdown
|
||||
```
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
title: curl POST examples
|
||||
created: 2025-12-30
|
||||
updated: 2025-12-30
|
||||
tags: []
|
||||
---
|
||||
|
||||
|
||||
|
||||
<h2>Common Options</h2>
|
||||
<div>-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.</div>
|
||||
<div>-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).</div>
|
||||
<div>-c, --cookie-jar <file name> File to save response cookies to.</div>
|
||||
<div>-d, --data <data> Send specified data in POST request. Details provided below.</div>
|
||||
<div>-f, --fail Fail silently (don't output HTML error form if returned).</div>
|
||||
<div>-F, --form <name=content> Submit form data.</div>
|
||||
<div>-H, --header <header> Headers to supply with request.</div>
|
||||
<div>-i, --include Include HTTP headers in the output.</div>
|
||||
<div>-I, --head Fetch headers only.</div>
|
||||
<div>-k, --insecure Allow insecure connections to succeed.</div>
|
||||
<div>-L, --location Follow redirects.</div>
|
||||
<div>-o, --output <file> Write output to . Can use --create-dirs in conjunction with this to create any directories specified in the -o path.</div>
|
||||
<div>-O, --remote-name Write output to file named like the remote file (only writes to current directory).</div>
|
||||
<div>-s, --silent Silent (quiet) mode. Use with -S to force it to show errors.</div>
|
||||
<div>-v, --verbose Provide more information (useful for debugging).</div>
|
||||
<div>-w, --write-out <format> Make curl display information on stdout after a completed transfer. See man page for more details on available variables. Convenient way to force curl to append a newline to output: -w "\n" (can add to ~/.curlrc).</div>
|
||||
<div>-X, --request The request method to use.</div>
|
||||
<h2>POST</h2>
|
||||
<div>When sending data via a POST or PUT request, two common formats (specified via the Content-Type header) are:</div>
|
||||
<ul><li><div>application/json</div></li><li><div>application/x-www-form-urlencoded</div></li></ul>
|
||||
<div>Many APIs will accept both formats, so if you're using curl at the command line, it can be a bit easier to use the form urlencoded format instead of json because</div>
|
||||
<ul><li><div>the json format requires a bunch of extra quoting</div></li><li><div>curl will send form urlencoded by default, so for json the Content-Type header must be explicitly set</div></li></ul>
|
||||
<div>This gist provides examples for using both formats, including how to use sample data files in either format with your curl requests.</div>
|
||||
<h2>curl usage</h2>
|
||||
<div>For sending data with POST and PUT requests, these are common curl options:</div>
|
||||
<ul><li><div>request type</div></li><ul><li><div>-X POST</div></li><li><div>-X PUT</div></li></ul><li><div>content type header</div></li><li><div>-H "Content-Type: application/x-www-form-urlencoded"</div></li><li><div>-H "Content-Type: application/json"</div></li><li><div>data</div></li><ul><li><div>form urlencoded: -d "param1=value1&m2=value2" or -d @data.txt</div></li><li><div>json: -d '{"key1":"value1", "key2":"value2"}' or -d @data.json</div></li></ul></ul>
|
||||
<h2>Examples</h2>
|
||||
<h3>POST application/x-www-form-urlencoded</h3>
|
||||
<div>application/x-www-form-urlencoded is the default:</div>
|
||||
<div>curl -d "param1=value1&m2=value2" -X POST http://localhost:3000/data</div>
|
||||
<div>explicit:</div>
|
||||
<div>curl -d "param1=value1&m2=value2" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://localhost:3000/data</div>
|
||||
<div>with a data file</div>
|
||||
<div>curl -d "@data.txt" -X POST http://localhost:3000/data</div>
|
||||
<h3>POST application/json</h3>
|
||||
<div>curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost:3000/data</div>
|
||||
<div>with a data file</div>
|
||||
<div>curl -d "@data.json" -X POST http://localhost:3000/data</div>
|
||||
<div><br></div>
|
||||
Reference in New Issue
Block a user