Featured

I love Vivaldi, from a not-so experienced WP user.

Hello Vivaldi community, this is my first post on My Vivaldi Blog.

When I first logged in, I felt very familiar, and happy too, seeing the WordPress interface. Because I’m building my own WordPress site, and I have to install everything from scratch, you know, rent a separate VPS hosting and do everything yourself from installing the operating system, web server, WordPress source code. and the plugins that come with it, and the hardest part: optimizing for the server to run faster.

The optimal stage takes a lot of time. I’m not a major in information technology, but I love to explore and learn by myself. Just a few days ago, I didn’t even know what memcache, Varnish cache, zend opcache, and Nginx pagepeed were. But now everything is installed, and you only need to learn a little bit and have some background on commands in Linux.

However, successful installation is one thing, but understanding how they work and interact with one another takes more time to dig deep.

But let’s talk about that later .

Here is my Vivaldi browser screenshot. I use it as my main browser every day. I often switch between browsers like Vivaldi, Firefox, and Edge, and use all three at the same time.

Just few days ago, I remembered Vivaldi community having a blog service and decide to go back and write something. I used to be a core Opera user and also played at My Opera Community (now closed) before, but after learning about this, I have switched to Vivaldi since then.

vivaldi_browser

This is a link to my personal website, although it is still in development right now, but I will try to improve its content soon.

https://pquan.info

You can also contact me at my Reddit’s profile, check out my old posts, and maybe we have the same interests and can become friends 🙂

Cryptanalysis of coronavirus

by Elena Larina

Source: https://aurora.network/articles/1-mirovoy-krizis/77716-kriptoanalitika-koronavirusa

In collaboration with Vladimir Ovchinsky

Behind the scenes of a pandemic

The coronavirus pandemic is a complex and dangerous process. When discussing it, there is no place for hype, hatering, cheap conspiracy theories and amateurish reasoning. Virologists and physicians should speak out about epidemics. Therefore, let us leave the epidemiological aspects of the coronavirus proper to virologists, and turn to the cryptanalysis of the coronavirus.

Cryptanalysis deals with subtle, encrypted or carefully hidden aspects of events, situations or processes that are important for global dynamics. Without claiming to be a complete and detailed analysis of the cryptanalysts of the coronavirus, we will draw the attention of thoughtful readers to some strange facts. They are still being ignored on the agenda set by mainstream media and leading politicians.

For simplicity and clarity, we will not spread over the tree, but we will present cryptanalytic riddles clearly, clearly and with reference to sources.

The first riddle. In 1981, one of the most popular American actors of techno-thrillers and scientific horror, rival Stephen King - Dean Kunz wrote the novel “Eyes of Darkness”. The famous best-selling author in the late nineties slightly corrected the original text of the novel, bringing it in line with new realities. It was in this form that the novel was published in our country back in the zero years. Events in the novel revolve around an unauthorized leak from the stores of one of the Pentagon's contractors of a Chinese war virus called Wuhan-400. This virus acted very selectively, killing some and modifying the organisms of others. 

Regarding reality, the following is known. At the beginning of March, when the epidemic in China was already taken under control and the first tangible successes appeared, the Foreign Ministry spokesman Zhao Lijian suggested that the US military brought a new type of coronavirus to the Chinese city of Wuhan.

At the same time, specialists in the field of genetic engineering and investigative journalists know exactly the following. The Wuhan Institute of Virology, including one working for defense, has close ties with the Galverston National Laboratory at the University of Texas, one of the Pentagon’s largest biological defense and synthetic biology contractors. Obviously, we are dealing with a coincidence, but as Carl Jung wrote, sometimes the future opens up to science fiction writers through synchrony.

The second riddle. Typically, leaders of major powers and leading politicians try to make the most balanced, responsible, truthful, and at the same time calm statements about processes that can cause public panic. 

At the end of the first decade of March, the usually restrained and cautious Angela Merkel suddenly announced that 60-70% of Germans could become infected with a coronavirus, and a certain part of them would die, since in the near future the medicine for coronavirus, even if created, will not be available to the general public . Angela Merkel is not alone in her alarmism.

Donald Trump, according to the presidential pool of journalists in his speeches recently, demonstrates a clear misunderstanding of the processes and an obvious confusion. The same vice president Mike Pence is much more confident, businesslike and active. It was he who led the White House working group on the fight against coronavirus.

A few days ago, the leading British government center for public health, Public Health England, prepared for leadership a report that states:

“It is expected that up to 80% of the population will be infected with Covid-19 over the next 12 months and up to 15% (7.9 million people) will be hospitalized due to their serious condition”

It is clear that such speeches and documents only kindle panic among the population, have a devastating effect on financial and economic markets, and literally plunge management structures into a stupor. Those. leading politicians say and do exactly the opposite of what responsible leaders must do in times of crisis.

The riddle of the third. On October 18, 2019, in New York, the Johns Hopkins University Health Safety Center (it is by its resources that the whole world is now tracking the coronavirus epidemic), in partnership with the World Economic Forum and the Bill and Melinda Gates Foundation, hosted the Event 201 event about responding to a high-level pandemic. 

The meeting was held as a kind of strategic game. During the game, the process of spreading a pandemic of a stable virus transmitted by airborne droplets, as well as with handshakes and other tactile contacts, was simulated. A feature of the virus was the lack of an effective vaccine and selective mortality, mainly associated with individuals whose immunity is weakened.

The business game, held on October 18, was attended by a group of politicians, business leaders and health officials from leading countries of the world, whose list is partially classified. However, videos from the event are still available online.

As told Eric Toner, senior fellow at the Center for Health Security at Hopkins University:

“At first, the new virus will be difficult to recognize, because it looks like flu or SARS, but more deadly. In simulating the spread of the virus and the efforts of doctors and epidemiologists to combat it, 65 million people died in the developing world in the first 18 months. According to the results of the game, the virus surpassed the deadliest pandemic in history – the Spanish flu of 1918. ”

It is important to note this. The game was held on October 18 last year, when not a single case of coronavirus was recorded. When the epidemic began, the mainstream global media, demonstrating the deserted cities of China, carefully created the image of the American and European public about the locality of this dangerous phenomenon. Moreover, not a single mainstream media, not to mention the largest video platforms, has not yet connected the computer emulation of Event 201 with what is unfolding around the world in real time.

The fourth riddle, the shortest and at the same time the most sinister. Among the organizers of Event 201 and the development of a vaccine against coronavirus, one of the key places is occupied by Bill and Melinda Gates. 

Few people know, but back in 2010, Bill Gates, who did not spoil his audience with speeches too often, nevertheless made an exception for the TED conference, the most popular in America and accessible via the Internet to millions of users around the world.

Here is one of the key findings of this important report of Bill Gates:

“A huge problem is demography. Now 6.8 billion people live in the world. Soon the number will increase to 9 billion. However, if we do a lot of high-quality work on the development of reproductive health services, changes in health systems and the release of new mass vaccines, we will be able to reduce population growth by at least 10-15% ”

After performing simple arithmetic calculations, it can be calculated that effective vaccination should reduce the population growth by about 200-300 million people, according to Gates.

After the epidemic began to decline in China, the global media switched to Italy. The Apennines have become the main newsmakers in the field of coronavirus. In the summer of 2019, the European Commission began urgently to develop measures in relation to Italy, designed to prevent default of this country. Italy in the last few years has become a sick person in Europe.

The country has one of the highest levels of external debt in Europe. It accounts for approximately 135% of the country’s GDP. And this is when the growth rate of GDP and the chronic instability of governments are decreasing from year to year. They were planning to treat Italy with severe shock therapy methods similar to those that were used for Greece and are offered for Ukraine. And then came the coronavirus. Now the European Central Bank and the EU leadership have decided on a large-scale emission of the euro, as well as restructuring and even writing off various debts in order to save the Community economy.

Just the other day, the focus of coronavirus coverage has shifted to the United States. A few days later, namely, March 16, which in the future will undoubtedly be called “Black Monday”, the largest stock market crash in history occurred. The lost capitalization gains of overseas securities markets that Donald Trump was so proud of.

It was with these achievements that he linked confidence in re-election to the presidency. The main thing is that before our eyes the coronavirus landed the virtual economy of the USA and returned the understanding of the values ​​of real production, including construction, radio electronics, food, clothing, etc. – all that has largely left America, having moved to Asia and Mexico.

Although Trump so far speaks only of a recession, the vast majority of serious economists believe that America and the world have entered into a full-blown, above all, economic, associated with real production, as well as financial and economic crisis.

This is interesting. Among investors and economists, the resource www.shadowstats.com enjoys great trust and continued popularity. According to resource analysts who have learned to masterfully clean government statistics of workloads and falsifications, over the past year and a half, the U.S. economy has balanced at the recession level, and at the end of 2019 to the beginning of 2020. at least in terms of the real economy, it entered into a crisis, potentially fraught with the collapse of financial and stock markets. Subscribers of the paid resource newsletter familiarized themselves with this rating as early as Christmas 2019.

Media platforms and social networks are full of anger and indignation of the Americans, who rightly believe that financiers, the so-called bankers, and irresponsible politicians have led the country to serious trials in a situation that, because of the polarization of voters, is called the Cold Civil War. And then came the coronavirus.

We tried to bring into a single coherent whole not considerations and judgments, but facts and cross-confirmed events, carefully concealed by mainstream media. Aristotle, the first cryptanalyst in history, said that knowledge begins with surprise. We will be surprised and learn what is happening here and now, at this apparently turning point in History.

Some usual Varnish commands

(for CentOS 7)

nano /etc/varnish/default.vcl

nano /etc/varnish/varnish.params

varnish_reload_vcl

netstat -lntp | grep 80

service nginx reload

varnishstat

varnishlog

service nginx restart

service varnish restart

# Start and enable Varnish process to start at system boot.

systemctl enable –now varnish

nano /etc/nginx/conf.d/…

# Verify that Varnish is running

systemctl status varnish

systemctl status varnish.service

journalctl -xe

varnishd -F -f /etc/varnish/default.vcl

service varnish-agent start

Configure Varnish to auto direct from http to https

In SSH terminal, edit the domain configuration file in /etc/nginx/conf.d/

  1. Configure Nginx as SSL Proxy
server {
        listen 443 ssl http2;
        server_name pquan.info;  #change mine to your domain.

        # SSL #You can use Let's Encrypt or Comodo
        ssl_certificate /etc/nginx/ssl/nginx.crt;
        ssl_certificate_key /etc/nginx/ssl/nginx.key;

        location / {
            proxy_pass http://127.0.0.1:8080;
            proxy_set_header X-Real-IP  $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto https;
            proxy_set_header X-Forwarded-Port 443;
            proxy_set_header Host $host;
        }
}
  1. Configure Varnish to auto direct http to https

In SSH terminal, type nano /etc/varnish/default.vcl and add the following code:

sub vcl_recv {
        # Ask Varnish to fire 750 status for HTTP requests from external IPs and port 80,
        # and not from SSL Termination Proxy (Nginx).
        if ( (req.http.host ~ "^(?i)www. pquan.info " || req.http.host ~ "^(?i)pquan.info") && req.http.X-Forwarded-Proto !~ "(?i)https") {
                return (synth(750, ""));
        }
}

sub vcl_synth {
        # Listen to 750 status from vcl_recv.
        if (resp.status == 750) {
                set resp.status = 301;
                set resp.http.Location = "https://pquan.info " + req.url;
                return(deliver);
        }
}

then, type command service varnish reload to reload Varnish configuration.

If it still does not convert http to https, more specifically, if you type only yourdomain.com in the broswer, it’ll say refused to connect, that means you are still only able to visit https:// yourdomain.com. So you need to look in the file /etc/varnish/varnish.param and change the following value:

VARNISH_LISTEN_PORT=80

How to Easily Display Code on Your WordPress Site

Repost from https://www.wpbeginner.com/wp-tutorials/how-to-easily-display-code-on-your-wordpress-site/

Do you want to display code in your WordPress blog posts? If you tried to add code like regular text, then WordPress will not display it correctly.

WordPress runs your content through several cleanup filters each time you save a post. These filters are there to make sure someone does not inject code via post editor to hack your website.

In this article, we will show you the proper ways to easily display code on your WordPress site. We will show you different methods, and you can choose the one that best fits your needs.

How to easily display code in WordPress posts

Method 1. Display Code Using The Default Editor in WordPress

This method is recommended for beginners and users who don’t need to display code very often.

Simply edit the blog post or page where you want to display the code. On the post edit screen, add a new code block to your post.

Add code block to your WordPress posts

You can now enter the code snippet in the text area of the block.

Add code to your blog post

After that, you can save your blog post and preview it to see the code block in action.

PHP code displayed in WordPress

Depending on your WordPress theme, the code block may look different on your website.

Method 2. Display Code in WordPress Using a Plugin

For this method, we will be using a WordPress plugin to display code in your blog posts. This method is recommended for users who often display code in their articles.

It gives you the following advantages over the default code block:

  • It allows you to easily display any code in any programming language
  • It displays the code with syntax highlighting and line numbers
  • Your users can easily study the code and copy it

First, you need to install and activate the SyntaxHighlighter Evolved plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you can go ahead and edit the blog post where you want to display the code. On the post edit screen, add the ‘SyntaxHighlighter Code’ block to your post.

SyntaxHighlighter code block

You will now see a new code block in the post editor where you can enter your code. After adding the code, you need to select the block settings from the right column.

SyntaxHighlighter code block settings

First, you need to select the language for your code. After that, you can turn off line numbers, provide first line number, highlight any line you want, and turn off the feature to make links clickable.

Once you are done, save your post and click on the preview button to see it in action.

Code displayed with syntax highlighting

The plugin comes with a number of color schemes and themes. To change the color theme, you need to visit Settings » SyntaxHighlighter page.

SyntaxHighlighter settings

From the settings page, you can select a color theme and change SyntaxHighlighter settings. You can save your settings to see a preview of the code block at the bottom of the page.

Code block preview

Using SyntaxHighlighter with Classic Editor

If you are still using the old classic WordPress editor, then here is how you would use SyntaxHighlighter plugin to add code to your WordPress blog posts.

Simply wrap your code around square brackets with the language name. For example, if you are going to add PHP code, then you will add it like this:

[php]
<?php
private function get_time_tags() {
$time = get_the_time(‘d M, Y’);
return $time;
}
?>
[/php]

Similarly, if you wanted to add an HTML code, then you will wrap it around the HTML shortcode like this:

[html]
<a href=”example.com”>A sample link</a>
[/html]

Method 3. Display Code in WordPress Manually (No Plugin or Block)

This method is for advanced users because it requires more work and does not always work as intended.

It is suitable for users who are still using the old classic editor and want to display code without using a plugin.

First, you need to pass your code through an online HTML entities encoder tool. It will change your code markup to HTML entities, which will allow you to add the code and bypass the WordPress cleanup filters.

Now copy and paste your code in the text editor and wrap it around <pre> and <code> tags.

Adding code manually in classic editor

Your code would look like this:

<pre><code>
&lt;p&gt;&lt;a href=&quot;/home.html&quot;&gt;This is a sample link&lt;/a&gt;&lt;/p&gt;
</pre></code>

You can now save your post and preview the code in action. Your browser will convert the HTML entities and users will be able to see and copy the correct code.

Manually displaying code in WordPress

We hope this article helped you learn how to easily display code on your WordPress site. You may also want to see our ultimate list of the most wanted WordPress tips, tricks, and hacks.

Building Offline Sites with ServiceWorkers and UpUp

Repost from https://dev.opera.com/articles/offline-with-upup-service-workers/

We are living in an increasingly mobile world. We rely on our phones to keep us connected wherever we go, and to provide us with the information we need to get through our day.

But connectivity hasn’t quite caught up with our dependence on it yet.

Every day we find ourselves without a working internet connection. Even in countries with near-perfect coverage, we lose connectivity when stepping into the elevator, or taking the subway. We have areas in our house that never seem to have a solid connection… and don’t even get me started about travel. The minute we leave our comfortable homes and offices, whether we’re boarding a plane, or just driving from town to town, we are at the mercy of the cell towers.

Now think of your users, and their dependence on the information you provide them. Are you running a travel site offering online hotel bookings? What would your users do if they just landed in Tokyo, without a local data plan, but they needed to access your site in order to find their hotel’s address? Does your store have a website? What would your users do if they were riding the elevator down to the parking lot while trying to find out your store’s opening hours?

Luckily we are living in very exciting times for web development. New technologies are coming out every day, unleashing new possibilities, and changing our perception of what is and isn’t possible in the browser. Two of the most important technologies to come out in recent years — service workers and the CacheStorage API — allow us an amazing level of control over the user’s browsing experience — even when their internet connection fails.

Taking control of the offline experience

One library to provide an easy solution for the connectivity problem is called UpUp(Editor’s note: Tal is the developer of the UpUp library.)

UpUp allows you to define exactly what you want to show your users when they are offline, while handling all of the logic of intercepting requests, detecting when they fail, returning the right content from cache, managing that cache, and generally dealing with all the headaches of cross-browser compatibility.

The content you show your users can be as simple as one page (e.g. your business’ info, address, etc.), all the way to fully customized offline experiences with data customized for each user (e.g. a travel site’s user could browse his bookings, and get details on each booking, even while offline).

The best part of all, UpUp lets you do all of this in just a few lines of code:

<script src="/upup.min.js"></script>
<script>
	UpUp.start({
		'content-url': 'offline.html'
	});
</script>

In this article we’ll first look at how you can use UpUp to add offline capabilities to your site in under 10 minutes. We will then dive deeper behind the scenes, and see how UpUp achieves all of this.

10 minute tutorial

Let’s begin with a simple site, and add offline features to it:

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Lonely Globe Advisor</title>
</head>
<body>
	<h1>Top Hotels in Rome</h1>
	<ol>
		<li>Villa Domus — Via Piacenza 9, Rome, Italy</li>
		<li>Hotel Trivelli — Piazza Barberini 11, Rome, Italy</li>
	</ol>
</body>
</html>

Our sample site, Lonely Globe Advisor, offers visitors a list of the top fictional hotels in Rome.

But what happens if our user just landed in Rome and doesn’t have a local data plan? She’ll be out of luck.

We can improve on this experience by loading UpUp, and telling it what content we want it to show the user if she is offline.

<h1>Top Hotels in Rome</h1>
<ol>
	<li>Villa Domus — Via Piacenza 9, Rome, Italy</li>
	<li>Hotel Trivelli — Piazza Barberini 11, Rome, Italy</li>
</ol>
<script src="/upup.min.js"></script>
<script>
	UpUp.start({
		'content-url': '/offline.html'
	});
</script>

With just this tiny bit of code, we’ve added an offline experience for our site, and allowed our users to see the best hotels in Rome… even when they can’t access the web.

Any user that visited our site in the past, and is now trying to access it again without an internet connection, will now see the content of offline.html. Make sure you create this file and place it in the location you defined under content-url.

The sample above just shows a simple html page. You can improve on your offline content by including stylesheets, images, or even videos in your offline.html. You just need to make sure to tell UpUp what files you’re using, and it will cache them so they are available for your users when they are offline.

<h1>Top Hotels in Rome</h1>
<ol>
	<li>Villa Domus — Via Piacenza 9, Rome, Italy</li>
	<li>Hotel Trivelli — Piazza Barberini 11, Rome, Italy</li>
</ol>
<script src="/upup.min.js"></script>
<script>
	UpUp.start({
		'content-url': 'offline.html',
		'assets': [
			'css/bootstrap.min.css',
			'img/trivelli.jpg',
			'mov/intro.mp4'
		]
	});
</script>

With just one command and a couple of settings, we can create rich offline experiences for our users. These can be as simple as the example above, or as robust as a full single page application using frameworks like AngularJS, with content customized for each user, videos and files the user can access while offline.

There’s a more detailed tutorial available on the official site, as well as complete documentation of UpUp’s API.

How does it work?

How does UpUp serve this content to our users if they aren’t connected to the internet?

tl;dr

UpUp uses a new type of script called a ServiceWorker. This script runs even when the user is offline, and wraps every request made to the server with a promise. If the server can’t be reached, that promise is broken. The script catches broken promises, checks in its cache to see what offline content you’ve chosen to show and returns that instead of an error.

ServiceWorkers

In order to understand how this works, let’s first understand how ServiceWorkers work.

A ServiceWorker is a special type of script that any site can register in the user’s browser. Once registered, this script sits in a very interesting position between the browser windows and that site’s server.

As you can see, while the ServiceWorker runs within the user’s browser, it isn’t attached to any one window. Instead it runs in the background, and can communicate with the windows in its scope (the site that registered it).

From this unique location in the browser, ServiceWorkers have the power to examine each request as it is sent from the user’s browser, decide what to do with it, and then send it to the server. The ServiceWorker can then examine the response as it is returned from the server, decide what to do with it, and then pass either the original or a modified response back to the user’s window.

In a way, you can think of a ServiceWorker as a local proxy server inside the user’s browser. A proxy written in JavaScript that has the power to change requests and their responses.

Now if you think about this flow, you can probably begin to see the many different possibilities this grants us as developers.

For example, you could have a templating engine written entirely inside a ServiceWorker. This ServiceWorker would intercept requests to the server for HTML, asking the server for JSON instead. It would then parse that JSON against a template it has stored within it, and finally return simple HTML as the response. This could save us from rendering the HTML on the server, save bandwidth in the responses, and save us from having to include the templating logic in every page of our site. In other words, the server returns simple JSON, and the web page receives simple HTML.

Another idea could be a ServiceWorker that redirects requests to video files to either SD or HD videos based on the user’s connection speed or settings — this could be done without requiring each page to hold the logic for making that decision, or involving the server in the decision, allowing us to use a server optimized for delivering static files.

ServiceWorkers and UpUp

UpUp uses the power of ServiceWorkers to provide a solution to the lost connectivity problem described above, and serve content to the user even when their connection is down.

Let’s follow what happens behind the scenes of UpUp.

We’ll begin by registering a ServiceWorker. Once registered, all requests from the browser to our server go through the ServiceWorker, where they are wrapped in a JavaScript promise, and pass on untouched to our server. If that promise is broken (ie. we did not receive a response from the server), the ServiceWorker catches that error before it is shown to the user. It will then check for the cached content we’ve decided to show the user, and return that as the response, instead of an error .

To the browser’s window, responses returned from the server or from the cache by the ServiceWorker look exactly the same.

Where does the offline content come from?

The final piece of the puzzle is the new caching technology used by UpUp — CacheStorage. Note: don’t confuse this with the browser’s own cache, or with that douchebag, the Application Cache. This is something new and much more powerful.

When we first registered our ServiceWorker, we told it what content to store in cache for later (we defined this in the content-url and assets settings). The UpUp ServiceWorker script went ahead and fetched that content, and stored it using the CacheStorage interface.

This content will now be available for the ServiceWorker the next time the user is offline.

Important ServiceWorkers Considerations

When using ServiceWorkers, there are a few things you need to always keep in mind.

HTTPS Only

To preserve the user’s security and privacy, ServiceWorkers can only detect requests over a secure connection.

During development you can use UpUp through localhost or file (e.g. both http://localhost/ and file:///Users/tal_ater/index.html are OK), but to deploy it to production you’ll need to have HTTPS set up on your server.

Browser Support

UpUp plays nicely with all browsers, progressively enhancing browsers that support ServiceWorkers, while leaving users with older browsers unaffected.

UpUp currently supports Opera (since version 27), Chrome (since version 40) and Firefox (since version 41). If your users are using a different browser, they simply won’t notice anything different.

Where Should I Place My Files?

For security reasons, the browser only lets UpUp’s ServiceWorker see network requests within its scope.

The scope that the ServiceWorker can affect is determined by where you’ve placed upup.min.js and upup.sw.min.js. For example, if you place it on https://yoursite.com/js/upup.sw.min.js, UpUp will only be able to show your offline content when users try to look at the /js/ directory.

This is why it’s important to place both files on the same server as your content, and not in a subdirectory. This should ideally be in the root of your site (e.g. https://yoursite.com/upup.min.js).

What’s Next?

It’s hard not to be excited about all the new possibilities ServiceWorker opens up to us as developers.

Go ahead, and try UpUp on your own site, you can see it in action and find more details and tutorials on doing Offline First with UpUp.

If you’d like to dive deeper and play some more with ServiceWorkers, there’s a great introduction by Matt Gaunt. If you’d like a few other ideas of how to improve caching with ServiceWorkers, check out Jake Archibald’s Offline Cookbook.

Vivaldi