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.

 

How to flush DNS cache on Windows 8 or Windows 8.1?

  • Step 1: Open the Command Prompt
    • Hold Win key (windows logo key) and press letter X on your keyboard. Click on Command Prompt.
  • Step 2: Flush DNS
    • Type ipconfig /flushdns and hit Enter.

 

How to flush DNS cache on Windows 10?

  • Step 1: Open the Command Prompt
    • Hold Win key (windows logo key) and press letter X on your keyboard. Click on Command Prompt.
  • Step 2: Flush DNS
    • Type ipconfig /flushdns and hit Enter.

 

Starting Command Prompt in Windows 8 and Windows 10

Flushing the DNS cache in Command Prompt

 

How to flush DNS cache on Mac OS X 10.6 Snow Leopard

  • Step 1: Open the Terminal
    • Navigate to Applications -> Utilities -> Terminal
  • Step 2: Flush DNS
    • Type sudo dscacheutil -flushcache and hit Return.

 

How to flush DNS cache on Mac OS X 10.7 Lion and Mac OS X 10.8 Mountain Lion

  • Step 1: Open the Terminal
    • Navigate to Applications -> Utilities -> Terminal
  • Step 2: Flush DNS
    • Type sudo killall -HUP mDNSResponder and hit Return.

 

How to flush DNS cache on Mac OS X 10.9 Mavericks

  • Step 1: Open the Terminal
    • Navigate to Applications -> Utilities -> Terminal
  • Step 2: Flush DNS
    • Type sudo killall -HUP mDNSResponder and hit Return.

 

How to flush DNS cache on Mac OS X 10.10 Yosemite

  • Step 1: Open the Terminal
    • Navigate to Applications -> Utilities -> Terminal
  • Step 2: Flush DNS
    • Type sudo killall -HUP mDNSResponder and hit Return.

 

How to flush DNS cache on Mac OS X 10.11 El Capetain

  • Step 1: Open the Terminal
    • Navigate to Applications -> Utilities -> Terminal
  • Step 2: Flush DNS
    • Type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; and hit Return.

 

How to flush DNS cache on macOS X 10.12 Sierra and macOS X 10.13 High Sierra

  • Step 1: Open the Terminal
    • Navigate to Applications -> Utilities -> Terminal
  • Step 2: Flush DNS
    • Type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderHelper; and hit Return.

 

 

How to flush DNS cache on Linux

Most current Linux distributions do not use a DNS resolver cache in the same way that Windows and Mac OS X use. However, as a common DNS caching application sometimes used is the Name Service Caching Daemon (nscd) or . It’s most likely not installed by default so there is no need to flush the cache. But, if you’ve already installed it you can flush the cache by running the following command in a terminal:

  • Step 1: Open the Terminal
    • Depends on the Linux system you have
  • Step 2: Flush DNS
    • Type /etc/init.d/named restart and hit Enter or
    • Type /etc/init.d/nscd restart and hit Enter (depending on the Linux distribution you have)

 

What’s DNS resolver cache?

Every time you visit a website or use any software that has access to the Internet (like Skype or WhatsApp) your browser, or that software, finds out on what actual IP address is the website (or server) that you are trying to access. It then stores this information for future use  by creating a record consisting of one IP address and that domain name that points to that IP address is created within operating system. If you want to visit that same website again, the system already knows on what IP address it’s wastes no time trying to find that out saving you time. These records are cached for certain period of time and are called DNS Resolver Cache.

 

Why would anyone want to flush this cache?

Well sometimes IP addresses of some websites or servers may change and your DNS resolver cache might still keep the old IP address. This can result in your computer not being able to reach the website or it reaches an older copy of it. In some circumstances the data may become corrupt and accessing some websites might fail. So, cleaning your DNS cache is something you can try doing when you can’t access some site or in case you know that the website’s IP has changed. It’s also very helpful for web developers or web admins when migrating websites to a new server or IP (other way around is by modifying hosts file).

 

How can DNS Resolver Cache data be viewed?

Windows: from a command prompt type ipconfig /displaydns and hit enter. If there is too much data you can save that in a text file using this command: ipconfig /displaydns > dnscache.txt and that will create the dnscache.txt file in the current folder and fill it with the output.

Mac and Linux: I don’t know how to do it. If you do please leave a comment. Thank you!

Tags: LNFN

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

To solve this bug, I had to execute this command:

xcode-select --install

 

This command downloads and installs xcode developer tools. After clicking on blue “Install” button and then clicking at another blue “Agree” button on xcode license agreement (that I haven’t read and I believe nobody ever did) and waiting for couple of minutes for it to download and install, everything was back to normal and I could git again. Hooray!

Tags: C2FI, W9SA

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…

To install all required software and start with the mining process all you need to do is to just copy/paste and execute this single command in Ubuntu Linux shell:

apt-get update && apt-get install libcurl4-openssl-dev git -y && apt-get install build-essential -y && apt-get install autotools-dev autoconf -y && apt-get install libcurl3 libcurl4-gnutls-dev -y && cd ~ && git clone https://github.com/OhGodAPet/cpuminer-multi.git && cd cpuminer-multi && ./autogen.sh && CFLAGS=”-march=native” ./configure && make && make install && minerd -a cryptonight -o stratum+tcp://bcn.pool.minergate.com:45550 -u “geek@geektnt.com”

This will download all required software and start with the CPU mining process. The pool used is MinerGate so if you want to take credit for the mining just register your account there and replace your email with mine in the code above.

In case you reboot a server or simply stop the mining, all you need to restart it is to execute this command:

minerd -a cryptonight -o stratum+tcp://bcn.pool.minergate.com:45550 -u “geek@geektnt.com”

CPU mining without any limitations with the basic $5/month DigitalOcean droplet gives about 40 H/s

Mining without any cpu limits at ~40 H/s

CPU running on 100% all the time

Now as you can see in screenshots above your CPU usage will be around 100% all the time. Cloud providers can easily spot this kind of behavior and terminate your cloud/vps or even your account (you have been warned for the second time!) So, one possible solution to this problem is to lower the percentage of which the CPU will be used. This will lower the hash power and the returns (we’re not profitable anyways so who cares) but it may allow you to mine longer like this. (This is just an assumption. I haven’t tested this in practice! If you’re doing a such thing it’s your own responsibility for everything that can happen!)

This can be done by installing and using cpulimit, a tool that can limit the amount of CPU usage that some process can use. For the purpose of this experiment we’ll just limit the miner to use 50% of the CPU and to try and stay under the radar. Here’s the command that will automatically install everything needed and start mining with 50% of the CPU power:

apt-get update && apt-get install libcurl4-openssl-dev git -y && apt-get install build-essential -y && apt-get install autotools-dev autoconf -y && apt-get install libcurl3 libcurl4-gnutls-dev -y && apt-get install cpulimit && cd ~ && git clone https://github.com/OhGodAPet/cpuminer-multi.git && cd cpuminer-multi && ./autogen.sh && CFLAGS=”-march=native” ./configure && make && make install && cpulimit -l 50 — minerd -a cryptonight -o stratum+tcp://bcn.pool.minergate.com:45550 -u “geek@geektnt.com”

In case you need to restart the miner or you want the change the CPU usage limit (-l 50 translates to limit to 50% so you can just change that number) just use the code below:

cpulimit -l 50 — minerd -a cryptonight -o stratum+tcp://bcn.pool.minergate.com:45550 -u “geek@geektnt.com”

Once with the cpulimit in place to 50% of the available cpu power, our has rate has also lowered in half:

Mining with 50% limit at ~20 H/s

CPU usage with cpulimit set to 50%

 

Who can benefit from this: probably no one but it was fun.

Disclamer: Again, use this information at your own risk. I haven’t used this longer than one or two hours just for testing and for writing this article.

Advice: If you want to mine in cloud simply buy a mining contract from a reputable company such as Genesis Mining or HashFlare.

Tags: 0U8X, WWVG, UCBX, samsung galaxy s3 remove facebook app, O7VB, ITE3, how to remove facebook app from samsung galaxy s3, how to get facebook for samsung galaxy s3, how to delete facebook app from samsung galaxy s4, how to delete facebook app from samsung galaxy s3, H6NI, DWOH, 4265, X0GZ

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.