Category Archives: sadmin

sadmin

Инсталиране на Electrum Bitcoin Wallet под Linux

su-;
apt-get install python3-setuptools python3-pyqt5 python3-pip;
pip3 install https://download.electrum.org/3.0.6/Electrum-3.0.6.tar.gz;

Грешка:
error: invalid command 'bdist_wheel'

Решение:
pip install wheel;
pip install setuptools --upgrade;
pip3 install https://download.electrum.org/3.0.6/Electrum-3.0.6.tar.gz
Collecting https://download.electrum.org/3.0.6/Electrum-3.0.6.tar.gz
Using cached https://download.electrum.org/3.0.6/Electrum-3.0.6.tar.gz
Requirement already satisfied (use --upgrade to upgrade): Electrum===3.0.6 from https://download.electrum.org/3.0.6/Electrum-3.0.6.tar.gz in /usr/local/lib/python3.5/dist-packages
Requirement already satisfied (use --upgrade to upgrade): pyaes>=0.1a1 in /usr/local/lib/python3.5/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): ecdsa>=0.9 in /usr/local/lib/python3.5/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): pbkdf2 in /usr/local/lib/python3.5/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): qrcode in /usr/local/lib/python3.5/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): protobuf in /usr/local/lib/python3.5/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): dnspython in /usr/local/lib/python3.5/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): jsonrpclib-pelix in /usr/local/lib/python3.5/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): PySocks>=1.6.6 in /usr/local/lib/python3.5/dist-packages (from Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python3/dist-packages (from qrcode->Electrum===3.0.6)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python3/dist-packages (from protobuf->Electrum===3.0.6)
Building wheels for collected packages: Electrum
Running setup.py bdist_wheel for Electrum … done
Stored in directory: /root/.cache/pip/wheels/3f/90/d2/d93db52c5f0a5c620ff486c44e1810e86c7b97d9496d01bcff
Successfully built Electrum

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

prestashop корекция на грешки

Грешка:
"PHP Fatal error: Redefinition of parameter $id_shop in /var/www/modules/spverticalmenu/Verticalmenu.php on line 655"

Решение:
Стар код:
protected function getCMSPages($id_cms_category, $id_shop = false, $id_lang = false, $id_shop = false)
{
$id_shop = ($id_shop !== false) ? (int)$id_shop : (int)Context::getContext()->shop->id;
$id_lang = $id_lang ? (int)$id_lang : (int)Context::getContext()->language->id;
Нов код:
public function getCMSPages($id_cms_category, $id_shop = false, $id_lang = false, $id_shop2 = false, $is_list = false)
{
$id_shop = ($id_shop !== false) ? (int)$id_shop : (int)Context::getContext()->shop->id;
$id_shop = ($id_shop2 !== false) ? (int)$id_shop2 : (int)Context::getContext()->shop->id;
Грешка:
"PHP Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /var/www/classes/Rijndael.php:50"

Решение:
UPDATE `ps_configuration` SET `value` = '0' WHERE `name` = 'PS_CIPHER_ALGORITHM';

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Проблем със session,php (ERR_CACHE_MISS)

Confirm Form Resubmission

This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed.
Press the reload button to resubmit the data needed to load the page.
ERR_CACHE_MISS

header('Cache-Control: no cache'); //no cache
session_cache_limiter('private_no_expire'); // works
session_start();

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

ssh грешка: diffie-hellman-group1-sha1

ssh  root@IP -p 22 -v

Unable to negotiate with IP port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 root@IP -p 22 -v
Тук вече се конектва правилно!

Има и друг вариант

Файл:  /etc/ssh/ssh_config:

Host *
GSSAPIAuthentication yes
KexAlgorithms +diffie-hellman-group1-sha1

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Инсталиране,конфигуриране и пренасочване на ssl сертификат от суперхостинг

1. Генериране на nginx файлове от Суперхостинг

cat "Частен ключ (Private Key)" > nginx.key

cat "Сертификат" > bundle.crt
cat "CA-Bundle / Root certificate" >> bundle.crt

На практика bundle.crt, включва "Сертификат" и "CA-Bundle / Root certificate"
2. .htaccess
RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]

3. Nginx

server
{
listen 80;
listen 443 ssl;
server_name domain.com www.domain.com;
ssl_certificate /etc/nginx/ssl/domain.com/bundle.crt;
ssl_certificate_key /etc/nginx/ssl/domain.comg/nginx.key;
if ($server_port = 80) {
rewrite ^/(.*)$ https://profi.bg/$1 permanent;
}

………..
}

4. Reload
nginx -t
/etc/init.d/nginx reload

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

Оптимизиране на chrome,firefox -- linux

file:/etc/rc.local

#Optimize chrome
mkdir /tmp/ccache
mount -t tmpfs -o size=512M,mode=0744 tmpfs /tmp/ccache/;
chmod -R 777 /tmp/ccache/;

#Shortcut
#/usr/bin/google-chrome-stable -disk-cache-dir="/tmp/ccache/" -disk-cache-size=600000000 --password-store=basic#Optimize firefox

about:config
browser.cache.disk.enable -- false
browser.cache.memory.enable -- true
about:cache

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)