Skip to content

Instantly share code, notes, and snippets.

View m-adamski's full-sized avatar

Maciej Adamski m-adamski

View GitHub Profile
@m-adamski
m-adamski / mysql-docker.sh
Created September 3, 2021 13:20 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
%WINDIR%\System32\cmd.exe /c "echo off | clip"
server {
listen 80;
listen [::]:80;
server_name example.com;
server_tokens off;
if ($host = example.com) {
return 301 https://$host$request_uri;
}
@m-adamski
m-adamski / ContextCmder-Disable.reg
Created November 16, 2020 12:13
Cmder & Windows shell
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@m-adamski
m-adamski / nginx.conf
Created February 12, 2020 14:11 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@m-adamski
m-adamski / .editorconfig
Last active October 4, 2019 11:15
Boilerplate for assets compilation in new projects
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Function CZYSCPOLSKIEZNAKI(strCiag As String) As String
Dim arrFind As Variant, arrReplace As Variant, iArr As Integer
Dim i As Integer, temp As String
arrFind = Array("ę", "ó", "ą", "ś", "ł", "ż", "ź", "ć", "ń", "Ę", "Ó", "Ą", "Ś", "Ł", "Ż", "Ź", "Ć", "Ń")
arrReplace = Array("e", "o", "a", "s", "l", "z", "z", "c", "n", "E", "O", "A", "S", "L", "Z", "Z", "C", "N")
temp = strCiag
For i = 1 To Len(temp)
If Asc(Mid(temp, i, 1)) > 122 Then
@m-adamski
m-adamski / domain.name
Last active December 4, 2020 14:50
An example configuration of the virtual host for NGINX
server {
listen 80;
listen [::]:80;
server_name <domain.name>;
server_tokens off;
if ($host = <domain.name>) {
return 301 https://$host$request_uri;
}