Skip to content

Instantly share code, notes, and snippets.

View srcmaker's full-sized avatar

Manny Lee srcmaker

  • Seoul, South Korea
View GitHub Profile
# Maintainer: Jakub Hajek, [email protected]
#
# 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.
@dmarkey
dmarkey / microk8s.yaml
Created January 19, 2019 14:46
Microk8s Cloud Init
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"
@ilbunilcho
ilbunilcho / How to remove Windows paths from WSL path.md
Created November 1, 2018 16:41
How to remove Windows paths from WSL path

after Build 17093

  • can override settings by edit "/etc/wsl.conf"
  • normally this file is not exists at first
$ sudo vi /etc/wsl.conf

[interop]
appendWindowsPath = false
@rubiread
rubiread / Cloneuser.sh
Created September 13, 2016 13:36
clone linux user
#!/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"
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 21, 2025 03:52
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some 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)
@CMCDragonkai
CMCDragonkai / NativeSession.php
Created October 10, 2013 03:44
PHP: Session Handler Abstraction. Requires 5.4.12 or higher.
<?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.