Dkngit 发布的文章

Question

Whenever login to debian OS via ssh will get this message:

Linux ds1821-virtual-debian 5.10.0-15-amd64 #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Answer

As Joan notes, motd is the key. The Debian wiki has good information on how the motd file is generated at boot and how to modify it. Check out the How to keep your /etc/motd from being overwritten section to make permanent motd changes.

If you just want to disable it for your user, create a .hushlogin file in your home directory:

touch ~/.hushlogin

https://raspberrypi.stackexchange.com/questions/32006/remove-gnu-licence-and-no-warranty-thing-when-logging-into-ssh/32007

    <mvc:annotation-driven/>
...
    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
        <property name="messageConverters">
            <list>
                <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                    <property name="supportedMediaTypes" value = "text/plain;charset=UTF-8" />
                </bean>
                <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
            </list>
        </property>
    </bean>

此时配置,response content-type 依然是 text/plain;charset=ISO-8859-1

    <mvc:annotation-driven>
        <mvc:message-converters>
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <constructor-arg>
                    <util:constant static-field="java.nio.charset.StandardCharsets.UTF_8"/>
                </constructor-arg>
                <property name="writeAcceptCharset" value="false" />
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>

<mvc:annotation-driven> 配置存在时,bean StringHttpMessageConverter 放于 <mvc:message-converters> 中, response 才能正确返回 text/plain;charset=UTF-8


声明 util:
<beans ...
     xmlns:util="http://www.springframework.org/schema/util"
...
 xsi:schemaLocation="...
     http://www.springframework.org/schema/util
     http://www.springframework.org/schema/util/spring-util-3.1.xsd
...">
xml: 注入静态成员变量至 spring bean
https://www.cnblogs.com/yzx2018/p/8884141.html

There is a way using CSS!

If you set your width depending on the parent container you can set the height to 0 and set padding-bottom to the percentage which will be calculated depending on the current width:

.some_element {
    position: relative;
    width: 20%;
    height: 0;
    padding-bottom: 20%;
}

This works well in all major browsers.

https://stackoverflow.com/questions/5445491/height-equal-to-dynamic-width-css-fluid-layout

Since there are several answers here showing non-working code for Windows, here is a clarification:

Runtime.getRuntime().exec("cls");

This command does not work, for two reasons:

There is no executable named cls.exe or cls.com in a standard Windows installation that could be invoked via Runtime.exec, as the well-known command cls is builtin to Windows’ command line interpreter.

When launching a new process via Runtime.exec, the standard output gets redirected to a pipe which the initiating Java process can read. But when the output of the cls command gets redirected, it doesn’t clear the console.

To solve this problem, we have to invoke the command line interpreter (cmd) and tell it to execute a command (/c cls) which allows invoking builtin commands. Further we have to directly connect its output channel to the Java process’ output channel, which works starting with Java 7, using inheritIO():

import java.io.IOException;

public class CLS {
    public static void main(String... arg) throws IOException, InterruptedException {
        new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
    }
}

Now when the Java process is connected to a console, i.e. has been started from a command line without output redirection, it will clear the console.

https://stackoverflow.com/questions/2979383/how-to-clear-the-console

git 设置用户名邮箱:

对当前项目生效:

git config user.name 'your username'
git config user.email 'your email'

对全局生效,加上 --global:

git config --global user.name 'your username'
git config --global user.email 'your email'