This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install required dependencies | |
sudo apt-get install build-essential curl git python libglib2.0-dev | |
cd /tmp | |
# Install depot_tools first (needed for source checkout) | |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
export PATH=`pwd`/depot_tools:"$PATH" | |
# Download v8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------Преобразуване от двоична(binary) в десетична (decimal) бройна система (numeric system):------------ | |
01010101 - Имаме това двойчно бройно число | |
76543210 - Изброяваме го в обратен ред | |
2(7)2(6)2(5)2(4)2(3)2(2)2(1)2(0) - Степенуваме 2(тъй като ще преобразуваме от двойчна система) по всяко от позицийте | |
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 - Това е резултата | |
0 + 64 + 0 + 16 + 0 + 4 + 0 + 1 - Събираме всички получени числа които отговарят на единица(1) в бинарното число. | |
85 - полученият резултат е в десетичен вариант. | |
* Всяко степенуване по 0 е = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You may receive a response such as this when running Nginx and php-fpm after a fixed amount of time (default = 60s). | |
Connection timed out | |
[error] upstream timed out (110: Connection timed out) while reading upstream, client: x.x.x.x, server: host.tld, request: "POST /script.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", ... | |
The “Connection timed out” usually happens when running large scripts, that need a lot of time for processing – such as import jobs parsing large XML or CSV files. The problem is that Nginx waits by default for 60s on the fastCGI response. If it takes too long, the request is stopped. The “Connection timed out” error means that Nginx hit a timeout before it received a response from the FastCGI backend. | |
You can change the time Nginx waits for the FastCGI backend, by changing the fastcgi_read_timeout parameter in the general nginx.conf. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!isset($_SERVER['PHP_AUTH_USER'])) { | |
header('WWW-Authenticate: Basic realm="My Realm"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
echo 'Text to send if user hits Cancel button'; | |
exit; | |
} else { | |
$headers = apache_request_headers(); // Also can be viewed in apache request | |
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>"; | |
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// RFC base64 encode - https://tools.ietf.org/html/rfc7515#appendix-C | |
$secret = 'kiro'; | |
// Make base64 valid for url's | |
function base64UrlEncode($text) | |
{ | |
return str_replace( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://support.ssl.com/Knowledgebase/Article/View/19/0/der-vs-crt-vs-cer-vs-pem-certificates-and-how-to-convert-them | |
Certificates and Encodings | |
At its core an X.509 certificate is a digital document that has been encoded and/or digitally signed according to RFC 5280. | |
In fact, the term X.509 certificate usually refers to the IETF’s PKIX Certificate and CRL Profile of the X.509 v3 certificate standard, as specified in RFC 5280, commonly referred to as PKIX for Public Key Infrastructure (X.509). | |
X509 File Extensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Pagination { | |
constructor(vm, limit, total, page_param_name) { | |
this.vm = vm | |
this.limit = parseInt(limit) | |
this.total = parseInt(total) | |
this.page_param_name = page_param_name | |
this.setMaxPagesToShow(5) | |
this.setDefaultStyles() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'https://valkata.lulin'; | |
$proxyList = ['186.47.82.6:41430', '43.240.5.1:31777', '202.166.201.65:23500']; | |
$browserAgents = [ | |
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7', | |
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', | |
'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36', | |
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36', | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are a lot of guides out there that deals with this topic (installing ssl certificate) | |
but not much that are actually tailored for this pair, GoDaddy and Ubuntu. So hopefully today’s | |
article will be helpful for many people. | |
Elements | |
Basically in order to successfully install an SSL certificate you need the following things | |
CSR file | |
Private key | |
Certificate key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To enable anti-aliased fonts just for Netbeans, add -J-Dawt.useSystemAAFontSettings=on to the end of the netbeans_default_options line in /usr/share/netbeans/etc/netbeans.conf e.g.: | |
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dawt.useSystemAAFontSettings=on" | |
Alternatively, you can set this globally so that all AWT apps are affected, by setting the _JAVA_OPTIONS environment variable in your .bash_profile: | |
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true' | |
This also has Swing equivalent, using the swing.aatext preference. You'll have to log out and log back in for this to take effect. |