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
const moment = require('moment'); | |
let timestamp = moment().utc().format("YYYY-MM-DD HH:mm:ss"); | |
pm.globals.set("timestamp", timestamp); | |
const access = "ACCESS_KEY"; | |
let csting = timestamp+access+"GET"+pm.request.url.getPathWithQuery(); | |
const secret = "SECRET_KEY"; | |
const hmac = CryptoJS.HmacSHA1(csting, secret); | |
const signature = hmac.toString(CryptoJS.enc.Base64); | |
pm.globals.set("signature", signature); |
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
find /mnt/g/imgtest/ -not -path "*/static/*" \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) -print0 | xargs -0 -P8 -n2 mogrify -strip -thumbnail '1920>' | |
find -size +1M |
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
RewriteCond %{HTTP_REFERER} !^$ | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC] | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?facebook.com [NC] | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?twitter.com [NC] | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?pinterest.com [NC] | |
RewriteRule \.(jpg|jpeg|png|gif)$ https://picsum.photos/200 [R,L] |
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 | |
APACHE_USER=wwwhost | |
VHOSTS_DOMAINS=(example.com second.example.com) | |
sudo ufw allow in "OpenSSH" | |
# Install Apache | |
sudo apt-get update | |
sudo apt-get install apache2 | |
sudo nano /etc/apache2/apache2.conf # Add ServerName ... directive at bottom |
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
BEGIN | |
DECLARE startingRange INT DEFAULT 1; | |
WHILE startingRange <= 100 DO | |
SET FOREIGN_KEY_CHECKS=0; | |
INSERT INTO `user_tour_qualification` (`id`, `user_id`, `tour_qualification_id`, `created_at`, `updated_at`) VALUES (startingRange, startingRange, '9', '2020-08-18 00:00:00', '2020-08-18 00:00:00'); | |
SET startingRange = startingRange + 1; | |
SET FOREIGN_KEY_CHECKS=1; | |
END WHILE; | |
END |
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
<VirtualHost 127.0.0.28> | |
ServerName wp | |
ServerAdmin webmaster@localhost | |
DocumentRoot /mnt/g/wp | |
<Directory /mnt/g/wp/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All |
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 | |
include "wp-load.php"; | |
$posts = new WP_Query('post_type=any&posts_per_page=-1&post_status=publish'); | |
$posts = $posts->posts; | |
header('Content-type:text/plain'); | |
foreach($posts as $post) { | |
switch ($post->post_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
Options -Indexes | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
# www | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# https | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https |
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
<div class="parent"> | |
<h4 class="ribbon">Skip The Line<br> <small>not available elsewhere</small></h4> | |
</div> | |
<style> | |
@import url('https://fonts.googleapis.com/css?family=Rubik&display=swap'); | |
.parent { | |
overflow: hidden; | |
width: 100%; | |
height: 300px; |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://old', 'http://new') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://old', 'http://new'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://old','http://new'); | |
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'http://old','http://new'); | |
UPDATE wp_links SET link_url = replace(link_url, 'http://old','http://new'); |
NewerOlder