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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Canvas saver</title> | |
</head> | |
<body> | |
<canvas id="canvas" width="600" height="315"></canvas> | |
<p> | |
<button id="button">Сохранить постер</button> | |
</p> |
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
location /facebook { | |
set $token "href=${arg_id}&layout=button_count&locale=en_US"; | |
resolver 1.1.1.1; | |
proxy_pass https://www.facebook.com/plugins/like.php?$token; | |
proxy_ignore_headers Expires; | |
proxy_ignore_headers Cache-Control; | |
proxy_hide_header Content-Type; |
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
location /facebook/ { | |
access_log off; | |
log_not_found off; | |
set $token "${args}&access_token="; | |
if ( $arg_id ~ "^https://knife.media/" ) { | |
set $args $token; | |
} |
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
#!/usr/bin/env bash | |
set -e | |
#set -x | |
# ask user for password | |
read -p "Input password for check: " -t 30 passwd | |
if [ -n "$passwd" ]; then | |
hash=$(echo -n "$passwd" | sha1sum | awk '{print $1}') |
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
# Drop for eth0 all incoming connections | |
sudo iptables -A INPUT -i eth0 -p tcp --dport 3000 -j DROP | |
# Save rules | |
sudo service netfilter-persistent save |
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
<?php | |
add_filter('wp_unique_post_slug_is_bad_flat_slug', function($bad_slug, $slug) { | |
if($slug === 'social') { | |
return true; | |
} | |
return $bad_slug; | |
}, 10, 2); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Test your knowlege!</title> | |
</head> | |
<body> | |
<h1>I answered <!--# echo var="count" --> questions correctly!</h1> | |
</body> | |
</html> |
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
version: '3.7' | |
services: | |
db: | |
image: mysql | |
command: --default-authentication-plugin=mysql_native_password | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
ports: |
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
# 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 | |