Objectives:
Edit: running native php on windows sucks!
- It is extremly low performant (PHP is designed for UNIX systems and depends on UNIX native libraries)
- What works for you on Windows, chances that critical things will break in Linux servers
- Windows now has WSL2 and it is awesome!
- Docker also :-)
Beginners, use latest stable version, for example 8.0.10 at the writing of this gist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH inactive_connections AS ( | |
SELECT | |
pid, | |
rank() over (partition by client_addr order by backend_start ASC) as rank | |
FROM | |
pg_stat_activity | |
WHERE | |
-- Exclude the thread owned connection (ie no auto-kill) | |
pid <> pg_backend_pid( ) | |
AND |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this to ~/.profile or correct profile file used by your shell | |
export RBENV_ROOT="/home/madalin/.rbenv" | |
if [ -d "${RBENV_ROOT}" ] ; then | |
PATH="${RBENV_ROOT}/bin:$PATH" | |
eval "$(rbenv init -)" | |
fi | |
export PHPENV_ROOT="/home/madalin/.phpenv" | |
if [ -d "${PHPENV_ROOT}" ] ; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unlet! skip_defaults_vim | |
source $VIMRUNTIME/defaults.vim | |
python3 from powerline.vim import setup as powerline_setup | |
python3 powerline_setup() | |
python3 del powerline_setup | |
set laststatus=2 " Always display the statusline in all windows | |
set showtabline=2 " Always display the tabline, even if there is only one tab | |
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--fg: #f0f0f0; | |
--bg: #222; | |
--border: #525252; | |
--well: #303030; | |
} | |
body { | |
color: var(--fg) !important; | |
background-color: var(--bg) !important; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP_NAME=Laravel | |
APP_ENV=local | |
APP_KEY=base64:nFiB+9iH3czw93BGTUvW0Ua4j+pQFIn+sUq6IJJzHWI= | |
APP_DEBUG=true | |
APP_URL=http://localhost:8000 | |
SANCTUM_STATEFUL_DOMAINS=localhost:3000 | |
SPA_URL=http://localhost:3000 | |
SESSION_DOMAIN=localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
USERNAME=wpk8s # TODO: Customize the sudo non-root username here | |
# Create user and immediately expire password to force a change on login | |
useradd --create-home --shell "/bin/bash" --groups sudo "${USERNAME}" | |
passwd --delete "${USERNAME}" | |
chage --lastday 0 "${USERNAME}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default settings for chromium-browser. This file is sourced by /bin/sh | |
# from /usr/bin/chromium-browser | |
CHROMIUM_FLAGS="$CHROMIUM_FLAGS \ | |
--disable-low-res-tiling \ | |
--num-raster-threads=6 \ | |
--profiler-timing=0 \ | |
--disable-composited-antialiasing \ | |
--test-type \ | |
--show-component-extension-options \ | |
--ignore-gpu-blacklist \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh user@yourhost "cat /etc/php/7.4/fpm/php.ini" | clip |