Search This Blog

Disclosure

Everything Tech Review is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on Amazon.com. Amazon and the Amazon logo are trademarks of Amazon.com, Inc, or its affiliates.

Sunday, August 14, 2022

How to change your DNS Server to Cloudflare and Google's and more tips and tricks for windows users!

Here is a guide for how to check your DNS settings and configurations for sites you own or want to visit. Some of these tips are for beginners but there are plenty of new things even for advanced users to learn! 

The terminal/command prompt commands I will be using in the post are only relevant to windows users... If you have a Mac or Linux they will not work... 

The connected world

1) How to open command prompt and some cool commands

Win + R -> type CMD -> click Ok or press Enter 

Command choices: 

ipconfig - generic stats about your network adapters and IP addresses

ipconfig /all - more detailed view

getmac - returns the MAC address of all the devices on your computer 

2) Run WHOIS locally

whois - want to see who owns a website, when it expires and who the domain registrar is? On windows, this doesn't come built into the operation system but it is a package which you can add do do the check. You can add the path location to your environment variables which allows you to run it in any directory via CMD. 

setx whois "C:\enter your directory here"

in my case:

setx whois "C:\Program Files\whois"

where whois is the folder containing the EXE
where whois is the folder containing the EXE

Now you can close all your command prompt windows... then re-open one and type: 
whois -v example.com to see all the info on that website (another optional flag is -nobanner to remove some more annoying text)

Alternatively, you can perform a search for whois in your favorite search engine and there are 3rd party websites which provide a similar service. I prefer using the windows package as it's faster and there are no ads or bloatware unlike on those websites. 

3) Get a new IP address 

Exercise Caution with these ones: 

ipconfig /release - releases your DHCP leased IP address... you will lose internet after running this

ipconfig /renew - gets you a new IP address (run this immediately after the release command finishes)

4) Find an IP address from a domain name:

Open CMD and write: ping example.com 

That command also shows you server response time and packet loss...This is a great tool to check and verify if you can access a website or not. 

Command Flags: The syntax is usually as follows "command argument -flag1 -flag2"

Flags are optional additions to the command argument which enable different modes, you can use then in succession just make sure to include a space between them. If you are unsure which flag does what, you can type "command /?", .. then it will fill the screen with all types of flags and what they do!

command /?"
Just an example

If you want to check continuously, you can add a -t and it will go on forever... till you hit Ctrl + C or click the X button. 

There are other flags such as -a which is supposed to give you the address of the server, you can also force it to give you an IPV4 address with -4 or -6 to force a IPV6 address

5) Purge DNS Cache Globally

Another powerful tool is purge cache, this let's you submit a request to these DNS services to tell them to refresh their database for the specific domain that you want. 

If it isn't purged, the record should usually update within 72 hours but usually occurs much faster. Essentially, one DNS server finds out the new IP address, then it gets passed on to other level servers, etc. till it is all updated. By "purging" the cache yourself, it can speed up certain parts of the process for customers who are using either Cloudflare (1.1.1.1 or 1.0.0.1) as a DNS provider or Google (8.8.8.8 or 8.8.4.4)

https://dns.google/cache (also for google)

You want to select the CNAME record (this is what ties the domain to a server via another name), and the A record (ties the name to an IP address). This is meant for domain admins usually when they change a DNS entry to switch servers to notify and have the new IP address ready. 

6) Flush your local DNS cache (on your computer)

ipconfig /flushdns this command flushes/erases the cache of DNS entries that you had... this comes in handy if a website that you want to access changed IP addresses and was unreachable. 
Now, when you make a request with your browser, it will pull the results from scratch. 


7) Nameserver lookup (DNS search)

nslookup example.com (Name Server Lookup)

This is a good way to check if your DNS record is working and if a website exists or not. 

This is a good way to check if your DNS record is working and if a website exists or not.

8) See hops via tracert 

Trace route is a cool command which lets you see how many hops and what servers your request passes through till it reaches it's destination. 

Trace route is a cool command which lets you see how many hops and what servers your request passes through till it reaches it's destination.

type tracert example.com (and you can add optional flags too!), now hit enter and wait for the command to begin. Depending on your local internet connection it could take a while to reach the destination server. 




9) Change your Windows DNS Servers and set a static IP


If you use your ISP's DNS they can easily track and control which websites you can visit... 

I like to use cloudflare as primary and google as backup... yes, you can mix and match your primary DNS server and secondary

If the request to primary fails, it will go to secondary... and by having 2 different and not connected sources, the chance of both of them failing decrease by a big factor

My Primary DNS: 1.1.1.2 (cloudflare with malware blocking)

My Secondary/Alternative DNS 8.8.8.8 (google's dns resolver)


Hot DNS 213.57.22.5 and 213.57.2.5 (My local ISP's DNS servers)

Win + R  -> ncpa.cpl -> now find your wifi or ethernet network -> right click on it -> properties -> enter admin credentials -> Internet Protocol Version 4 -> properties -> now you can change to a static IP address, change your gateway, and subnet mask. In addition to picking new DNS servers! 


change your gateway, and subnet mask. In addition to picking new DNS servers!

DNS Server menu



For more advanced users, you can have more than 2 DNS servers and you can also set additional configurations... If you are not familiar with this, it is best not mess around with these settings. 

Add more DNS Servers



Tuesday, July 26, 2022

Right to Repair for Appliances - Samsung Fridge

We bought a Samsung fridge model: RF060BEAESP and the ice maker has had several issues in addition to the cheap quality plastic shelfs that go on the door... Additionally, every 6 months we need to replace the filter for the ice machine... Which easily costs $30.

Samsung has a site called samsungparts.com which sells replacement parts for their appliances. Unfortunately, some of their prices are absurd. 

Download the manual and quick start guide too!

They have pages full of warnings about operating the fridge... there are certainly parts which require an expert such as the compressor and the power converter... but with that being said there are plenty of simple fixes and repairs that a layman can do. 

They have pages full of warnings about operating the fridge... there are certainly parts which require an expert such as the compressor and the power converter... but with that being said there are plenty of simple fixes and repairs that a layman can do.


In their official manual they recommend that buyers go to their affiliate's site samsungparts.com for replacements or to their local home. While it has a lot of parts and the ones we need... the prices are quite high. 

Water Filter:  DA29-00019A/DA29-00020B for example.

https://www.samsungparts.com/Products/Parts_and_Accessories/PID-DA29-00020B.aspx?oldpart=DA29-00019A&model=RF260BEAESP

Water Filter:  DA29-00019A

Officially this costs $45, there are 3rd party companies which sell similar filters under the same model name but Samsung of course says do not use a competitors product! 
Officially this costs $45, there are 3rd party companies which sell similar filters under the same model name but Samsung of course says do not use a competitors product!

Doing a quick search on walmart.com, I found that you can get a set 3 or even 4 filters for well under the price for a single official one. Now imagine that a 3rd party can supply you with 3/4 compatible filters for around $35.95 that would last you 18 months (assuming you only switch it twice a year) vs the OEM filter for $137.95 for the same 18 month period. Savings of $102 dollars! 


Doing a quick search on walmart.com, I found that you can get a set 3 or even 4 filters for well under the price for a single official one.

Ever wanted to know how to reset the ice maker? Samsung doesn't mention this in the 80 page manual, but after sleuthing online, I was able to find that it is quite simple... Just seems like they hid it from us so we would be forced to call an expensive technician... 
While it isn't in the manual... by doing a google search it came up here

It's a little reset button right under the ice maker, press and hold for up to 10 seconds or until you hear a chime... and the motors turning... if you press it more than once, it will confuse the ice maker and you will end up with an overfull ice bin the next morning. 

It's a little reset button right under the ice maker, press and hold for up to 10 seconds or until you hear a chime... and the motors turning... if you press it more than once, it will confuse the ice maker and you will end up with an overfull ice bin the next morning.

Door Bins: 

DA97-12650A for the right unit model

DA97-12657A for the left unit model

https://www.samsungparts.com/partslist.aspx?Catalog=Parts_and_Accessories&Category=RF260BEAESP


Door Bins:   DA97-12650A for the right unit model  DA97-12657A for the left unit model

The cost for replacing is around $100 per unit, and a fridge normally has 3 on each side... that's a lot of money for a piece of plastic! What they don't warn you about is that you can barely put anything in the drawer without it sliding around and/or cracking the plastic... 

Basically, make sure to not put heavier items in each bin. 

Obviously, I'm not as concerned with replacing this plastic piece with one from another manufacturer as a would be with a water filter. 

Door Bins:   DA97-12650A for the right unit model  DA97-12657A for the left unit model

and don't even ask for a diagram or more detailed information... this is as in depth as the instruction manual goes (80 pages) 

Diagram of a samsung fridge


and if you try clicking "Find Diagram" here, it will result in a page not found error.

and if you try clicking "Find Diagram" here, it will result in a page not found error.

Overall, the fridge isn't Right to Repair friendly and I wouldn't recommend it. If you already own the fridge and live in Israel or outside the US, use this tool to look up replacement parts instead! 






Thank you for reading, please share the article and follow me on twitter for more resources and guides!

What are Template Functions and Classes in C++ and how can I use them?

C++ Project

C++ gave us a new superpower which is generic programming! We an make a class and/or function which can handle any data type a user throws at it. 

Template Classes: 

Note that there are some restrictions to this: you need to always write template <typename  T> before each function (in addition to the top of the file), or template <class T> also works instead. T is an arbitrary type, feel free to rename it with something else but keep it consistent. In addition, C++ handles template classes during the pre-processing stage. This means that we need to put the template class in a header file (.h) in order for it to be recognized and dealt with by the compiler. 

Here is a sample I built which uses the Stack Data Structure implemented via a Linked List. You can also implement a stack in another way such as via an array, for example. 

https://github.com/avipars/CS-Resources/blob/main/cpp_workshop/Stack_Linked_list.h

It is up to the compiler to convert the template to the data type the user/developer wants. 

For example, Vector is an STL container that does in fact use templates! When we call vector<int> data (14,5); , under the hood the vector template class is used, the data type becomes int from T in all the functions and data members. 

Note that if you have vector<int> and vector<float> in the same main.cpp file, it will work perfectly fine. For every different data type used, the template generates a new class to handle it. This also means that if we modify the vector<int> array, it doesn't change the vector<float> array. In addition, all the data members are kept separate to each respective type. 

In the following example, you can see that we can make a less-generic template given a specific type. This can come in handy if we have a generic template function or class but want to handle a given data type differently. In this case, the compiler will try to first go to the specific implementation (if it exists) before defaulting to the generic one. 

#include<iostream>

using namespace std;

template<class Type>

class A{

Type a;

public:

A(Type a);

};

template<>A<float>::A(float a){

    a=12.5;

    cout<<a<<endl;

}

//template for int type specific

template<>A<int>::A(int a){

    a=8;

    cout<<a<<endl;

}

template<class Type>A<Type>::A(Type a1){

this->a=a1;

cout<<a<<endl;

}

int main(){

int a=2;

float b=3.5;

double c=7.5;

A<int>ob1(a);

A<float>ob2(b);

A<double>ob3(c);

    return 0;

}

//output: 8

//12.5

//7.5

In this case, we provided a specific template for int and float values, but not double. So the compiler correctly used our specific functions for int and float... but the generic function for double. 

Template Functions:

In your main.cpp file, you can also have template functions! In addition, they can have multiple parameters. It comes in handy if you want to save on writing code to handle all the different possible types that would need a swap function. They operate similarly to template classes...

template <typename A> //swap should occur between two variables of the same type

void swap(A &a, A &b) //by reference so that we actually modify the variables

{

    A temp = a;

    a = b;

    b = temp;

}

template <class A,class B> //in this case we can accept two different types

double test(A x,B y){ //i decided to return a double to have the most accurate result, but you can return type A or B as well

    return (x+y)/2;

}

int main(){ //main function to test the actual template implementation

    int a = 1;

    int b = 2;

    swap(a, b); //now we call it with 2 ints

    cout << a << " " << b << endl;

    cout << "test" << endl;

    double d1 = 1.0;

    int d2 = 2.0;

    cout << test<double,int>(d1,d2) << endl;

    return 0; }


Thank you for reading, please share the article and follow me on twitter for more resources and guides!