Skip to content

Instantly share code, notes, and snippets.

View onebelarusianguy's full-sized avatar
😮

Пашенька onebelarusianguy

😮
View GitHub Profile
@onebelarusianguy
onebelarusianguy / macos_high_sierra_apache_php_brew_2018.md
Created July 5, 2021 17:45 — forked from karlhillx/macos_high_sierra_apache_php_brew_2018.md
macOS High Sierra Setup: Homebrew + Apache + PHP + MariaDB + SSL

macOS High Sierra Setup: Homebrew + Apache + PHP + MariaDB + SSL

Homebrew Installation

First let's install Homebrew.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

@onebelarusianguy
onebelarusianguy / gist:628af45077a68b6cd6637e0ae351dcd6
Created July 4, 2021 22:17
Apache doesn't work after php updated
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
@onebelarusianguy
onebelarusianguy / gist:8c4a44fba7756738f6cb5a799b33e14c
Last active January 1, 2020 22:14
To perform the requested action, WordPress needs to access your web 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');
@onebelarusianguy
onebelarusianguy / js
Last active March 23, 2021 02:39
get logins of creative market followers
/**
* 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);
}