Here is a guide for setting up SFTP users who’s access is restricted to their home directory.
Add the following to the end of the /etc/ssh/sshd_config file:
Subsystem sftp internal-sftp
# This section must be placed at the very end of sshd_config
| <?php | |
| /** | |
| * Ported from Laravel 4 for external usage. | |
| */ | |
| function is($pattern, $value) { | |
| if ($pattern == $value) return true; | |
| $pattern = preg_quote($pattern, '#'); |
| package tests; | |
| import org.apache.commons.codec.binary.Base64; | |
| import javax.crypto.Cipher; | |
| import java.nio.file.Files; | |
| import java.nio.file.Path; | |
| import java.nio.file.Paths; | |
| import java.security.KeyFactory; | |
| import java.security.PrivateKey; |
alias nw="/Applications/nwjs.app/Contents/MacOS/nwjs"| // insert and return id | |
| @Insert("INSERT INTO photo_category (uuid, album_uuid, name, status, addtime, modtime) VALUES (" + | |
| "REPLACE(UUID(), '-', ''), #{albumUuid}, #{name}, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP())") | |
| @SelectKey(before = false, keyProperty = "id", statement = "SELECT LAST_INSERT_ID()", resultType = Integer.class) | |
| void insert(PhotoCategoryDO item); | |
| // return HashMap | |
| @ResultType(value = java.util.HashMap.class) | |
| HashMap getSumDismissionRate(@Param("companyId") String companyId, @Param("yearmo") Integer yearmo); |
| /* | |
| From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators | |
| Generators compute their yielded values on demand, which allows them to efficiently | |
| represent sequences that are expensive to compute, or even infinite sequences as | |
| demonstrated above. | |
| The next() method also accepts a value which can be used to modify the internal state | |
| of the generator. A value passed to next() will be treated as the result of the last | |
| yield expression that paused the generator. |
teamviewer setup| # 安装 | |
| yum install postgresql-server postgresql-contrib | |
| # 初始化 | |
| postgresql-setup initdb | |
| # ident 改为 md5,ident是使用系统账号验证; md5使用单独的数据库账号 | |
| vi /var/lib/pgsql/data/pg_hba.conf | |
| # 开机启动 |
| # ssh反向隧道,实现NAT穿透 | |
| # 在局域网内执行 | |
| # 把局域网内的 192.168.1.100:443 暴露到 138.47.99.99:19999 | |
| ssh -R 19999:192.168.1.100:443 [email protected] | |
| # 暴露后的 138.47.99.99:19999 貌似只能本地访问,即 telnet localhost 19999 是通的,远程 telnet 138.47.99.99 19999 不通 | |
| # 如果只是做ssh跳板机,上面就够了,先ssh到138.47.99.99再ssh localhost -p 19999 | |
| # 如果要实现网页访问,即远程通过公网IP访问19999端口 |