How to DNS cache on Windows or macOS?

Almost all operating systems cache DNS records to improve the performance of applications and speed up internet access. Browsers do cache DNS records too and to flush these the easiest way is just to close the browser and start ti again. But sometimes there is a need to flush operating system DNS cache. Here’s how you can do that easily.

How to flush DNS cache on Windows XP / Windows Vista?

  • Step 1: Open the Command Prompt
    • Click on the Start Menu and click Run. Type in cmd and hit Enter.
  • Step 2: Flush DNS
    • Type ipconfig /flushdns and hit Enter.

 

How to flush DNS cache on Windows Vista or Windows 7?

  • Step 1: Open the Command Prompt
    • Click on the Start Menu and type cmd in the search bar and hit Enter.
  • Step 2: Flush DNS
    • Type ipconfig /flushdns and hit Enter.

Continue Reading

After upgrading mac from Sierra to High Sierra git no longer works

Recently I have upgraded your macOS on my MacBook Air from Sierra to High Sierra. After the update (that took some time to complete) everything seemed to be working fine… until I was about to do some more coding and have I tried to execute git. I’ve got this error:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Continue Reading

Easiest way to start CPU mining on DigitalOcean, AWS, Google Cloud in under one minute

So, you have probably read a dozen articles or seen a handful of clips on Youtube about  how to use DigitalOcean / Amazon AWS / Google Cloud / Azure / PaperSpace or some other cloud server to mine bitcoins (or some other cryptocurrency coins) and you probably already know it’s not profitable. I know that too but still I wanted to experiment with that a bit 🙂

Many cloud providers do not allow mining on their computers since these are mostly distributed systems so they aren’t happy when some user is using a resource at full power all the time. So, once they find out that someone is mining on their hardware they usually shut these servers down or even close accounts (rarely, but it can happen!) Finding that someone is using their hardware for mining is also quite easy since the CPU will be running at 100% all the time. So it will stand out from normal usage that’s probably nowhere close to that.

Also, mining Bitcoins with CPU today is not even theoretically possible now so don’t waste your time with that. On the other side there are some alternative crypto currencies that are made to be mined only with CPU and most of these use cryptonote algorithm. If you’re going to be mining with the CPU – then simply mine these. Currently, Bytecoin, Monero and Dashcoin are the most popular. For the purpose of this post I’ll use Bytecoin (BCN).

This experiment has two goals: first one is to install everything and start mining with just one command and second is to try and limit the CPU usage so and try and stay under the radar…

Continue Reading

How to block language spam

While I was working on my referral traffic spam article today, I have noticed one more form of spam in my Google Analytics statistics. It’s called a language spam and in this case it had something to do with Trump LOL.

language-spam

Here’s the language spam volume:

language-spam-volume

When I filter it by country I can again see that these bots are coming from Russia (same as with referral spam). Now, apparently, someone from Russia (actually the guy behind this is Vitaly Popov, a well-known Analytics spammer) wants me to open this url: secret.ɢoogle.com and to vote for Donald Trump ?!?!? Mind blowing, really… As, you can clearly see that it’s again multi-byte domain, and that the letter G is multi-byte letter, and that it’s clearly a fake url/domain so don’t open it!

This spam actually just hits your Google Analytics, and no bot traffic is sent to your site, so all you need to do is to simply filter out these fake languages. To make things perfectly clear this kind of spam can’t harm your SEO or Rankings because there are no real backlinks or traffic to your site and Google also deosn’t use data from your Google Analytics for website ranking. The only one this spam is affecting is you! You are the only one who can see it while you’re checking your Google Analytics, and you should block it so your statistics are accurate and you can make some good decisions based on them.

Here’s the best way how to block the language spam: go to Google Analytics, and click Admin. Now under your account click All Filters:

and then click on Add filter and make a filter like this (follow my arrows from top to bottom of the picture):

  • Filter Name: write something descriptive so you know what’s this filter for: blocks language spam is a good name
  • Filter Type: pick Custom
  • Filter Field: search for and pick Language Settings
  • Filter Pattern: enter \.
  • Apply Filter to Views: select views that you want to apply this filter on and click Add (moves them from left to right into selected views list)
  • Click Save

That’s it! You have created a filter that will discard any language containing a dot (basically a domain name). This should remove your language spam from future Google Analytics stats.

However if you would like to filter current data and see the correct stats without the language spam hits you’ll have to create a new segment like this: on just about any report in Google Analytics click on +Add Segment:

and now click on red button +New Segment:

Now enter some meaningful name, for the language pick does not contain and just add a single dot in the filed right to it and press save above:

Here you can see the result of this filter with before and after charts:

This way you can filter data on any report. Just click add segment and search for the new segment we created (so it’s important to add a meaningful name to the segment so you can easily locate it anytime you need it).

 

 

How to open Sublime Text in command line with subl on Mac OS?

I have tried to setup Sublime Text 3 so I could run it on my new Mac from terminal just typing subl . but all the when I wanted to make the symlink I was getting this error: ln: /usr/local/bin/subl: No such file or directory  all the time.

The problem is that I had no bin directory on that path. So to fix that you need to do the following:

cd /usr/local
sudo mkdir bin

Now we have that bin folder on /usr/local/bin path and now we can create the link using:

Sublime Text 3

sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Sublime Text 2

sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /bin/local/bin/subl

Exit the terminal and start it again and you should be able to use subl . to open all files in current folder in sublime text for editing.