- can override settings by edit "/etc/wsl.conf"
- normally this file is not exists at first
$ sudo vi /etc/wsl.conf
[interop]
appendWindowsPath = false
| # Maintainer: Jakub Hajek, jakub.hajek@cometari.com | |
| # | |
| # docker stack deploy -c stack-elastic.yml elastic | |
| # | |
| # The stack creates Elasticsearch cluster consiting of | |
| # - 3 dedicated master nodes in order to keep quorum | |
| # - 4 dedicated data nodes to manage CRUD, | |
| # | |
| # Docker compose file to easily deploy Elasticsearch cluster 7.x on Docker Swarm cluster. |
| runcmd: | |
| - "snap install microk8s --classic" | |
| - "echo '-H tcp://0.0.0.0' >> /var/snap/microk8s/current/args/dockerd" | |
| - "systemctl restart snap.microk8s.daemon-docker.service" | |
| - "ln -s /var/snap/microk8s/current/docker.sock /var/run/docker.sock" | |
| - "/snap/bin/microk8s.start" | |
| - "/snap/bin/microk8s.status --wait-ready" | |
| - "/snap/bin/microk8s.enable dns storage ingress" | |
| - "/snap/bin/microk8s.status --wait-ready" | |
| - "iptables -P FORWARD ACCEPT" |
| #!/bin/bash | |
| # clone a user | |
| # usage: | |
| # if you named this as below then | |
| # change to the directory and run this command | |
| # sudo bash clone-user.sh | |
| echo "=============" | |
| echo "this script will create a new user" |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)| <?php | |
| /** | |
| * NativeSession implements the native PHP session handler to handle the server side sessions for the currently | |
| * authenticated user. When sessions are not available, such as when they are disabled, this class just fallsback | |
| * onto memory implementation of $_SESSION, which will only be persisted for the lifetime of the PHP process or | |
| * request/response. So this will work even when you're not using cookies and trying to be RESTful. This implementation | |
| * will not work in PHP daemons such as Ratchet. This is because $_SESSION is a global variable for the entire process. | |
| * Therefore all the session operations like login and logout would operate globally. There would need to be a more | |
| * fine grained session implementation such as Symfony Sessions. |