Alex
This author hasn't added his/her bio.
Sanasol
Wrong X-TARGETDURATION in m3u8 playlist causes error on Andorid Chrome. Error not visible in console or everywhere else, so its really hard to detect. Chrome Desktop ignore this error for some reason, but mobile sensitive to it. I have wrongly thought that it should be full video duration. Solution is: X-TARGETDURATION should contain duration of longest video fragment. Here is an example of a Media Playlist: #EXTM3U #EXT-X-TARGETDURATION:10 #EXTINF:9.009, http://media.example.com/first.ts #EXTINF:9.009, http://media.example.com/second.ts #EXTINF:3.003,.. Read More
Installing dependencies like here build unix BerkeleyDB is required for the wallet. Debian repository doesn’t contains libdb4.8. So need to get sources and compile it manually. Get db4.8 source, compile and install:
1 2 3 4 5 6 |
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz tar -xzvf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix ../dist/configure --enable-cxx make make install |
Tell your system where to find db4.8
1 2 3 |
export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include" export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib" ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so |
Then move to bitcoin sources folder and compile it:
1 2 3 |
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" make make install |
Sources: https://github.com/bitcoin/bitcoin/issues/3686#issuecomment-35211263 https://github.com/bitcoin/bitcoin/issues/3686#issuecomment-35236768
How to fix “Incorrect string value” errors? Mysql support only 3 bytes in «basic» utf8. So in case of use some new characters like emoji it gives Incorrect string value error. To fix this error you need change encoding utf8 to utf8bm4.
Стриминг видео с сервера очень сильно кушает канал. Поэтому появляется мысль кешировать видео через CloudFlare. При этом надо сохранить возможность перемотки и разбить файлы на небольшие куски, чтобы CF ничего не заподозрил, а так же не попасть под лимит который не кешируется. Будем использовать Uppod плеер. 1. Разбить видео 2. Создать страницу сайта UP 19.07 Трафик продолжает снижаться
I have a lot saved passwords in Google Chrome about 2000. So when I try to sync it on any linux distr. I got high cpu usage from keyring daemon. To prevent it we need disable password encryption ;( 1. Open Terminal 2.
1 |
sudo nano /usr/bin/google-chrome |
or
1 |
sudo nano /usr/bin/google-chrome-stable |
3. Find these lines at end of file
1 2 3 4 5 6 7 |
if [[ -n "$CHROME_USER_DATA_DIR" ]]; then # Note: exec -a below is a bashism. exec -a "$0" "$HERE/chrome" \ --user-data-dir="$CHROME_USER_DATA_DIR" "$@" else exec -a "$0" "$HERE/chrome" "$@" fi |
4. Replace with
1 2 3 4 5 6 7 8 9 10 |
if [[ -n "$CHROME_USER_DATA_DIR" ]]; then if [[ -n "$CHROME_USER_DATA_DIR" ]]; then # Note: exec -a below is a bashism. exec -a "$0" "$HERE/chrome" \ --user-data-dir="$CHROME_USER_DATA_DIR" \ --password-store=basic "$@" else exec -a "$0" "$HERE/chrome" \ --password-store=basic "$@" fi |
5. Save it. 6. Kill all keyring processes. 7. Restart Chrome, wait password sync… Read More
The token could not be parsed from the request For some magic reasons(simulating requests) phpunit can’t pass tests with JWT token header or GET param token=?. Solution is just add few lines to middleware or anywhere else like this. Got it work with this code in my middleware:
1 2 3 |
if (env('APP_ENV') === 'testing') { JWTAuth::setRequest($request); } |
Result middleware for api auth
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; use Illuminate\Http\Request; use JWTAuth; class AuthenticateApi { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @param string|null $guard * @return mixed */ public function handle(Request $request, Closure $next, $guard = null) { if (env('APP_ENV') === 'testing') { JWTAuth::setRequest($request); } JWTAuth::parseToken(); $user = JWTAuth::parseToken()->authenticate(); return $next($request); } } |
Заменяем старый IP на всех доменах добавленных в CloudFlare. Ставим из композера: jamesryanbell/cloudflare
1 |
composer require jamesryanbell/cloudflare |
Создаем php файл
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<?php include('vendor/autoload.php'); $old_ip = "127.0.0.1"; $new_ip = "127.0.0.2"; $zone = new Cloudflare\Zone($client); $dns = new Cloudflare\Zone\Dns($client); $zones = $zone->zones(); foreach($zones->result as $zone){ $dns_records = $dns->list_records($zone->id); foreach($dns_records->result as $record){ if(strpos($record->content, $old_ip) !== false){ echo $record->id.'-'.$zone->name.PHP_EOL; $dns->update($zone->id, $record->id, $record->type, $record->name, str_replace($old_ip,$new_ip,$record->content)); } } } |
Заполняем переменные: старый/текущий IP, новый IP, email аккаунта на CF, API ключ CF Запускаем … Профит!
Я большой любитель кальяна, и придумалось сделать генератор миксов. Так как кальян я курю почти каждый день, запомнить все вариации чаш которые я забиваю(чтобы не повторяться) стало трудновато. При этом хочется пробовать новые варианты, а не делать одно и тоже. В общем на фоне этого не так давно пришла мысль вести это в каком-нибудь «списке дел» или еще где-то. Но это слишком трудно, каждый раз записывать и придумывать новые варианты, я слишком стар.. Read More
Вчера началась складчина на доступ к бородач сервису. За 540 рублей вместо обычных 999р можно получить полный доступ к сервису. Складчина «авторская», каждый получает персональный оплаченный аккаунт на сервисе. Т.е. это оптовая покупка, а не один аккаунт на всех 🙂 Складчина проходит здесь
VPS #1 — Франция nginx+php mysql-1 haproxy VPS #2 — Канада nginx+php haproxy VPS #3 — Нидерланды nginx+php mysql-2 haproxy mysql — master-master репликация. haproxy — балансирует запросы на два mysql мастера. haproxy.cfg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
global log 127.0.0.1 local0 notice user haproxy group haproxy defaults log global retries 2 timeout connect 3000 timeout server 5000 timeout client 5000 listen mysql-cluster bind 127.0.0.1:3306 mode tcp option mysql-check user haproxy_check balance roundrobin server mysql-1 vps1:3307 check server mysql-2 vps3:3307 check listen stats 0.0.0.0:8080 mode http stats enable stats uri / stats realm Strictly\ Private stats auth admin:admin |
На каждый сервер идёт свой поддомен. Чтобы завалить сервис необходимо положить как минимум 2 хоста из 3. Для этого надо знать какие хосты держат mysql сервера. В противном случае класть придётся все хосты, дабы вывести из строя сервис.