Skip to content

Instantly share code, notes, and snippets.

# Disallow all crawlers access to certain pages.
# Block Yandex from crawling site
User-agent: Yandex
Disallow: /
# Block Yeti
User-agent: Yeti
Disallow: /
@ai2ik
ai2ik / Vestacp SSL
Created December 28, 2018 18:22
How To Use Let’s Encrypt On VestaCP Login Panel (Port 8083)
1. This is assuming you know how to login to your admin panel + creating a Lets Encrypt cert for servers hostname.
2. SSH into your server and enter these two commands to rename/backup the old files :
mv /usr/local/vesta/ssl/certificate.crt /usr/local/vesta/ssl/unusable.crt
mv /usr/local/vesta/ssl/certificate.key /usr/local/vesta/ssl/unusable.key
3. Create symlinks to point to the new ones (Replace admin with your admin username and server.domain.com with your server’s hostname (FQDN).
ln -s /home/admin/conf/web/ssl.server.domain.com.crt /usr/local/vesta/ssl/certificate.crt
@ai2ik
ai2ik / c-engine.php
Created October 18, 2017 14:47
Bulletproof simple contact form
<!-- Add this form to your webpage -->
<form method="post" action="c-engine.php" class="form">
<div class="form-group">
<input type="text" name="Name" id="Name" class="form-control" placeholder="Your Name">
</div>
<div class="form-group">
<input type="text" name="Phone" id="Phone" class="form-control" placeholder="Phone Number">
</div>
<div class="form-group">
@ai2ik
ai2ik / clean-up-boot-partition-ubuntu.md
Created February 26, 2019 14:24 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js"></script>
<script>
WebFont.load({
google: {
families: ['Source Sans Pro:400,600,700,400italic,700italic', 'Roboto Condensed:400,700']
}
});
</script>
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`,
`user_status`)
VALUES ('admin999', MD5('password999'), 'firstname lastname', 'email@example.com', '0');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users),
'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');
For Universal Analytics (analytics.js) your code will follow this format:
onclick="ga('send', 'event', 'Phone Call Tracking', 'Click to Call', '855-713-7262', 0);"
For Classic Analytics (ga.js) your code will follow this format:
onClick="_gaq.push(['_trackEvent', 'Category', 'Action', 'Label',, false]);"
onClick="_gaq.push(['_trackEvent', 'Phone Call', 'Click', 'CTA',, false]);"
apt install roundcube-core roundcube-mysql roundcube-plugins
wget http://c.vestacp.com/0.9.8/debian/apache2-webmail.conf -O /etc/roundcube/apache.conf
nano /etc/roundcube/debian-db.php (enter password)
cd /usr/share
mv roundcube roundcube-bk
rm -r roundcube
wget https://github.com/roundcube/roundcubemail/releases/download/1.3.7/roundcubemail-1.3.7-complete.tar.gz
tar -xvf roundcubemail-1.3.7-complete.tar.gz
mv roundcubemail-1.3.7-complete roundcube
rm -r /usr/share/roundcube/installer
@ai2ik
ai2ik / Track In-Page Events
Created December 28, 2018 18:23
After you install the pixel track in-page actions, such as product purchases, by tying events to HTML elements such as buttons. For example:
<button onClick="fbq('track', 'Purchase');">Button Text</button>
Or you could create a function that pushes the event. The advantage is if you have multiple HTML elements, you can call a single function when someone clicks any of them; you don't have to define individual onClick element.
For example, to push the event:
<script>
function onClick() {
fbq('track', 'Purchase');
};
</script>