Skip to content

Instantly share code, notes, and snippets.

@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');
# Disallow all crawlers access to certain pages.
# Block Yandex from crawling site
User-agent: Yandex
Disallow: /
# Block Yeti
User-agent: Yeti
Disallow: /
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>
@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 / Adding script to the head with wp_head
Created December 28, 2018 18:16
To manually add script to the head of a WordPress site you can use the wp_head action by using one of the the following function examples in function.php If using the echo function you will need to use double quotes around scripts single quotes to keep from breaking the function.
<?php
/**
* add script to head with wrapping php
*/
function addtohead_cf() {
?>
<script></script>
<?php
}
add_action('wp_head', 'addtohead_cf');