First let's install Homebrew.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
| Symptoms: | |
| - returns the default "The site caanot be reached" | |
| - sudo apachectl -k restart returns "Segmentation fault: 11 $HTTPD "$@"" | |
| The reason: | |
| - Apache tries to load two versions of PHP | |
| Solution: | |
| - Comment module loading in file "/etc/apache2/other/+php-osx.conf" | |
| # to avoid #1067 - Invalid default value for 'post_date' ERROR: | |
| SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | |
| SET AUTOCOMMIT = 0; | |
| START TRANSACTION; | |
| SET time_zone = "+00:00"; | |
| # then remove INDEX: | |
| ALTER TABLE wp_posts DROP INDEX post_type_post_title; | |
| # show MySQL indexes |
| /** | |
| * Convert HEX to RGB with alpha channel | |
| * @param {Array} [r, g, b] | |
| * @returns {String} rgba string | |
| */ | |
| function hexToRGBA(rgb) { | |
| let lowest = Math.min.apply(null, rgb), | |
| alpha = (255 - lowest) / 255, | |
| value = 'rgba('; |
| /** | |
| * wifi things | |
| */ | |
| airport -s | |
| airport en1 sniff 8 | |
| cd ../../users/user/hashcat-utils/src |
| ssh -i .ssh/key.pem user@server |
| # MacOS | |
| sudo chown -R _www:_www /var/www/test | |
| # Ubuntu | |
| sudo chown -R www-data:www-data /var/www/test |
| UPDATE wp_options SET option_value = replace(option_value, 'http://likeaprothemes.com', 'https://likeaprothemes.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET guid = replace(guid, 'http://likeaprothemes.com','https://likeaprothemes.com'); | |
| UPDATE wp_posts SET post_content = replace(post_content, 'http://likeaprothemes.com', 'https://likeaprothemes.com'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://likeaprothemes.com','https://likeaprothemes.com'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value,'http:\/\/likeaprothemes.com','https:\/\/likeaprothemes.com'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value,'https:\\/\\/themeforest.net\\/item\\/nowadays-multipurpose-onemultipage-wordpress-theme\\/18399207','https:\\/\\/1.envato.market\\/xM0zv'); |
| /** | |
| * Don't even think to steal my code. | |
| */ | |
| function creativeMarketGetFollowers() { | |
| var pageLogins = document.querySelectorAll('.username'), | |
| followers = localStorage.getItem('creativeMarketFollowers') ? localStorage.getItem('creativeMarketFollowers') : []; | |
| //конвертнём это дерьмо в риил эррэй | |
| if (followers.length) followers = followers.split(','); |
| function e() { | |
| var h = prompt('How many hours you have worked?'), | |
| m = prompt('minutes?'), | |
| rate = prompt('your rate?'); | |
| var result = (parseInt(h) * 60 + parseInt(m)) * (parseInt(rate) / 60); | |
| alert('Result: ' + result); | |
| } |