vi /etc/hosts
192.168.x.x nas.local
:w!q
ping nas.local
ssh nas.local
cat /etc/ssh/sshd_config | grep Pubkey
sudo synoservicectl --reload sshd
ssh-copy-id -i xxx.ssh user@nas.local
ssh user@nas.local
sudo /bin/sshd -d -p 1234
ssh user@nas.local -p 1234
sudo vi /var/packages/Git/target/webapi/SYNO.Git.lib
git init --bare <repo.git>
git clone ssh://[Git users]@[Your Synology server's IP address or hostname]/[Git repository path]
git clone ssh://user@nas.local/volume1/git/test1.git
git clone [git_user]@nas.local:/volume1/git/helloworld.git
vi ~/.ssh/config
Host nas.local
Port 1234
Follow the steps to change the npm registry
npm config set registry https://registry.npm.taobao.org
npm config get registry
Reset to default value
In order to delete the history of the git commit and make it the branch new repo, please follow the steps below
Checkout the code to a new branch
git checkout --orphan latest_branch
Stage the code
git add -A
Commit the change
git commit -am "commit message"
Delete the master branch
git branch -D master
Rename the current branch to master
git branch -m master
Push to remote branch
git push -f origin master
Download and install from the script.
# bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
systemctl enable v2ray
systemctl start v2ray
systemctl status v2ray
systemctl stop v2ray
systemctl restart v2ray
Check the configuration
Sample https://github.com/v2fly/v2ray-examples
Check the console output during the script running for the config file name
Another way to find the config file name systemctl status v2ray
Setup the client
class Employee{
// instance fields
private String name ;
private double salary;
private Local Date hireDay;
// constructor
public Employee(St ring n , double s, int year , int month , int day){
name = n;
salary = s;
hireDay = Local Date.of (year , month, day) ;
// a method
public String getName(){
return name;
}
// more methods
// ...
}
class Util{
public static int getCount(){
return 100;
}
}
class Test{
public static void main(){
System.out.println(Util.getCount());
}
}
class Employee{
//something here
}
class Manager extends Employee{
//something here
}
if (employee instanceof Manager){
Manager boss = (Manager) employee;
}
try{
System.out.println("hello world");
} catch (Exception e){
e.printStackTrace();
} finally {
System.out.println("finally");
}
public abstract class AbstractEmployee {
/**
* This is for demo the abstract method
* @return a string
*/
public abstract String generateName();
}
public class Employee extends AbstractEmployee {
@Override
public String generateName() {
return null;
}
}
public interface EmployeeInterface {
/**
* Show interface
* @return
*/
String generateName();
}
public class EmployeeImp implements EmployeeInterface {
@Override
public String generateName() {
return null;
}
}
String[] players = {"Rafael Nadal", "Novak Djokovic", "Stanislas Wawrinka", "David Ferrer", "Roger Federer", "Andy Murray",
"Tomas Berdych", "Juan Martin Del Potro","Richard Gasquet", "John Isner"};
Arrays.sort(players,(String s1, String s2) -> s1.length() - s2.length() );
Arrays.stream(players).forEach(System.out::println);
java -jar aaa.jar
Map<String, Employee> employeeMap = new HashMap<String, Employee>(4);
Employee emp = new Employee("my name");
System.out.println(emp);
emp = new Employee("new name");
employeeMap.put("SN1", emp);
System.out.println(employeeMap.get("SN1"));
手写是指不依赖IDE,使用纯文本编辑器或者传统纸笔来编写代码片段。不要求代码可以运行,但是关键知识点需要正确