sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| # Define ULID_DECODE and ULID_ENCODE which convert a ulid string to a binary and vice versa. | |
| delimiter // | |
| DROP FUNCTION IF EXISTS ULID_DECODE// | |
| CREATE FUNCTION ULID_DECODE (s CHAR(26)) RETURNS BINARY(16) DETERMINISTIC | |
| BEGIN | |
| DECLARE s_base32 CHAR(26); | |
| SET s_base32 = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(UPPER(s), 'J', 'I'), 'K', 'J'), 'M', 'K'), 'N', 'L'), 'P', 'M'), 'Q', 'N'), 'R', 'O'), 'S', 'P'), 'T', 'Q'), 'V', 'R'), 'W', 'S'), 'X', 'T'), 'Y', 'U'), 'Z', 'V'); | |
| RETURN UNHEX(CONCAT(LPAD(CONV(SUBSTRING(s_base32, 1, 2), 32, 16), 2, '0'), LPAD(CONV(SUBSTRING(s_base32, 3, 12), 32, 16), 15, '0'), LPAD(CONV(SUBSTRING(s_base32, 15, 12), 32, 16), 15, '0'))); | |
| END// |
| # Based on articles: | |
| # https://ruhighload.com/%D0%9A%D1%8D%D1%88%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+%D1%81+nginx | |
| # https://wiki.enchtex.info/practice/nginx/cache | |
| # https://gist.github.com/yanmhlv/5612256 | |
| # https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html | |
| # https://blog.runcloud.io/2017/10/28/nginx-caching-tutorial-wordpress.html | |
| # https://www.digitalocean.com/community/tutorials/how-to-setup-fastcgi-caching-with-nginx-on-your-vps | |
| # https://easyengine.io/wordpress-nginx/tutorials/single-site/fastcgi-cache-with-purging/ | |
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| class SpoofHttpMethodMiddleware | |
| { | |
| /** | |
| * Handle an incoming request. |
| # Comment | |
| 30 17 * * * rsync –av --delete /path/to/source /home/mark/rsync/daily | |
| 00 18 * * 5 rsync –av --delete /home/mark/rsync/daily /home/mark/rsync/weekly | |
| 00 6 1 * * tar -cvjf /home/mark/rsync/monthly/monthly_$(date +%Y%m%d).tar.bz2 /home/rsync/daily/ |
| #! /bin/bash | |
| newUser='testuser' | |
| newDbPassword='testpwd' | |
| newDb='testdb' | |
| host=localhost | |
| #host='%' | |
| commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.* | |
| TO '${newUser}'@'${host}';FLUSH PRIVILEGES;" |
| <html> | |
| <head> | |
| <script src="data:text/javascript;base64,d2luZG93LnN0b3AoKQ=="></script> | |
| </head> | |
| <body> | |
| <p> | |
| Я есть, но меня как бы нет :) | |
| </p> | |
| </body> | |
| </html> |
| var | |
| head = document.getElementsByTagName("head")[0], | |
| script = document.createElement("script") | |
| ; | |
| head.insertBefore(script, head.lastChild); |
| #!/usr/bin/python | |
| ########################################################### | |
| # | |
| # This python script is used for mysql database backup | |
| # using mysqldump and tar utility. | |
| # | |
| # Written by : Rahul Kumar | |
| # Website: http://tecadmin.net | |
| # Created date: Dec 03, 2013 |
| // Create a closure for triggering add/remove css class event | |
| (function(){ | |
| // Your base, I'm in it! | |
| var originalAddClassMethod = jQuery.fn.addClass; | |
| var originalRemoveClassMethod = jQuery.fn.removeClass; | |
| jQuery.fn.addClass = function(){ | |
| // Execute the original method. | |
| var result = originalAddClassMethod.apply( this, arguments ); |