server {
listen 80;
server_name v2.benedikt.gr;
location / {
This file contains 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
export default function getScrollbarWidth() { | |
// Creating invisible container | |
const outer = document.createElement("div"); | |
outer.style.visibility = "hidden"; | |
outer.style.overflow = "scroll"; // forcing scrollbar to appear | |
// @ts-ignore | |
outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps | |
document.body.appendChild(outer); |
This file contains 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/sh | |
# This script generates a ssh key for a single repository | |
# and adds a custom configuration to the users (not global) ssh config file, | |
# and outputs the public key for you to copy and paste as the repo deploy key | |
# and outputs the url for you to clone the repo on the machine. | |
# Github docs ref: | |
# https://docs.github.com/en/developers/overview/managing-deploy-keys#using-multiple-repositories-on-one-server | |
# | |
# 1. Add the script to the user account of the machine. The home directory is fine. | |
# 2. Make the script executable by running the following command as the user: |
This file contains 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
sup { | |
vertical-align: baseline; | |
font-feature-settings: "sups"; | |
font-size: 1em; | |
} | |
sub { | |
vertical-align: baseline; | |
font-feature-settings: "subs"; | |
font-size: 1em; | |
} |
This file contains 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/sh | |
# This script generates a ssh key for a single repository | |
# and adds a custom configuration to the users (not global) ssh config file, | |
# and outputs the public key for you to copy and paste as the repo deploy key | |
# and outputs the url for you to clone the repo on the machine. | |
# Github docs ref: | |
# https://docs.github.com/en/developers/overview/managing-deploy-keys#using-multiple-repositories-on-one-server | |
# | |
# 1. Add the script to the user account of the machine. The home directory is fine. | |
# 2. Make the script executable by running the following command as the user: |
src: https://superuser.com/a/1419434
nmap -sP 192.168.0.0/24
This file contains 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
// Replace letters | |
@function str-replace($string, $search, $replace: '') { | |
$index: str-index($string, $search); | |
@if $index { | |
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); | |
} | |
@return $string; | |
} |
This is the LAMP / LEMP environment backup guide in case you want or need to try my highload LEMP installation.
As a first thing we will setup a variable that will store current date and time. We will use year-month-day_hours-minutes-seconds format:
now=$(date +"%Y-%m-%d_%H-%M-%S")
This file contains 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
docker pull postgres | |
docker pull dpage/pgadmin4 | |
docker run \ | |
--name temppg \ | |
--net database_default \ | |
-p 54332:5432 \ | |
-e 'POSTGRES_USER=root' \ | |
-e 'POSTGRES_PASSWORD=root' \ | |
-e 'POSTGRES_DB=testtest' \ |
NewerOlder