突突唧之家

我的疑问 & 我的解决方案

当 Windows 10 连接过某个 Wi-Fi 后,这个 Wi-Fi 热点的 SSID、密码等信息就会保存到系统当中,之后再度进入到 Wi-Fi 范围可以自动连接。然而,已经保存在系统的 Wi-Fi,却不能直接查看密码。

使用下列命令可以查看 Windows 10 保存的 Wi-Fi 密码:

netsh wlan show profile name=<SSID> key=clear

其中,SSID 就填写你想要查看密码的 Wi-Fi 热点的名称。例如笔者想要查看 HUAWEI Mate 30 这个热点的密码,则输入:

netsh wlan show profile name="HUAWEI Mate 30" key=clear

在显示出来的“安全设置”一栏当中,“关键内容”所显示的,就是该 Wi-Fi 热点对应的密码了。

The $@ variable expands to all command-line parameters separated by spaces. Here is an example.

abc "$@"

When using $@, you should (almost) always put it in double-quotes to avoid misparsing of arguments containing spaces or wildcards (see below). This works for multiple arguments. It is also portable to all POSIX-compliant shells.

It is also worth nothing that $0 (generally the script's name or path) is not in $@.

The Bash Reference Manual Special Parameters Section says that $@ expands to the positional parameters starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word. That is "$@" is equivalent to "$1" "$2" "$3"....

Passing Some Arguments

If you want to pass all but the first arguments, you can first use shift to "consume" the first argument and then pass "$@" to pass the remaining arguments to another command. In bash (and zsh and ksh, but not in plain POSIX shells like dash), you can do this without messing with the argument list using a variant of array slicing: "${@:3}" will get you the arguments starting with "$3". "${@:3:4}" will get you up to four arguments starting at "$3" (i.e. "$3" "$4" "$5" "$6"), if that many arguments were passed.

Things You Probably Don't Want to Do

"$*" gives all the arguments stuck together into a single string (separated by spaces, or whatever the first character of $IFS is). This looses the distinction between spaces within arguments and the spaces between arguments, so is generally a bad idea. Although it might be ok for printing the arguments, e.g. echo "$*", provided you don't care about preserving the space within/between distinction.

Assigning the arguments to a regular variable (as in args="$@") mashes all the arguments together like "$*" does. If you want to store the arguments in a variable, use an array with args=("$@") (the parentheses make it an array), and then reference them as e.g. "${args[0]}" etc. Note that in bash and ksh, array indexes start at 0, so $1 will be in args[0], etc. zsh, on the other hand, starts array indexes at 1, so $1 will be in args[1]. More basic shells like dash don't have arrays at all.

Leaving off the double-quotes, with either $@ or $*, will try to split each argument up into separate words (based on whitespace or whatever is in $IFS), and also try to expand anything that looks like a filename wildcard into a list of matching filenames. This can have really weird effects, and should almost always be avoided. (Except in zsh, where this expansion doesn't take place by default.)

Open terminal and edit /etc/mysql/mysql.conf.d/mysqld.cnf. Underneath the [mysqld] section, add:

lower_case_table_names = 1

Restart MySQL:

sudo service mysql restart

Then check it here:

mysqladmin -u root -p variables

If you have any local changes, they will be lost. With or without --hard option, any local commits that haven't been pushed will be lost. If you have any files that are not tracked by Git (e.g. uploaded user content), these files will not be affected.

First, run a fetch to update all origin/<branch> refs to latest:

git fetch --all

Then, reset the current branch:

git reset --hard origin/<branch>

Explanation

git fetch downloads the latest from remote without trying to merge or rebase anything.

Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/<branch>.

Uncommitted Changes

Uncommitted changes, however (even staged), will be lost. Make sure to stash and commit anything you need. For that you can run the following:

git stash

Then to reapply these uncommitted changes:

git stash pop

Try to put reference immediately below picture like this:

\begin{frame}
\includegraphics[width=\linewidth]{example-image}\\[-1ex]
{\tiny Source: \cite{foo12}}
\end{frame}

Use find.

To see exactly which files you will remove:

find . -name "*.bak" -type f

To count the number of files:

find . -name "*.bak" -type f | wc -l

To delete these files:

find . -name "*.bak" -type f -delete

Make sure that -delete is the last argument in your command. If you put it before the -name "*.bak" argument, it will delete everything.

Position Independent Code means that the generated machine code is not dependent on being located at a specific address in order to work.

E.g., jumps would be generated as relative rather than absolute.

Pseudo-assembly:

  • PIC: This would work whether the code was at address 100 or 1000

    100: COMPARE REG1, REG2
    101: JUMP_IF_EQUAL CURRENT+10
    ...
    111: NOP
  • Non-PIC: This will only work if the code is at address 100

    100: COMPARE REG1, REG2
    101: JUMP_IF_EQUAL 111
    ...
    111: NOP

If your code is compiled with -fPIC, it's suitable for inclusion in a library. The library must be able to be relocated from its preferred location in memory to another address, there could be another already loaded library at the address your library prefers.

When building a binary or library, specifying the rpath, i.e.

-Wl,-rpath,<path/to/lib>

tells the linker where to find the required library at runtime.

In the case of rpath, it makes no sense to use a relative path, since a relative path will be relative to the current working directory, NOT relative to the directory where the binary/library was found. So it simply won't work for executables found in $PATH or libraries in pretty much any case.

Instead, you can use the $ORIGIN "special" path to have a path relative to the executable with -Wl,-rpath,'$ORIGIN'. Note that you need quotes around it to avoid having the shell interpret it as a variable, and if you try to do this in a Makefile, you need $$ to avoid having make interpret the $ as well.

You normally want to pass two arguments to the linker (-rpath and the actual path argument), thus the comma between them. GNU ld will accept it as either two arguments or a single argument with an =, so either can work. Other linkers, e.g., Solaris, only accept it as two arguments.