Advertisements

How to check whether a Raspberry Pi is 32 bit or 64 bit ?

The latest version of Raspberry Pi comes with 64 bit CPU, but prior to that it was with 32 bit CPU. Some softwares and applications are dependent on CPU and OS architecture.

There are various options to check the architecture.

Method 1:

type the following command and check the response

uname -m

You will get a response something like armv7l or armv8.

ARMv7 and below are 32-bit. AMRv8 introduces the 64-bit instruction set.

Method 2:

Install lshw using the command

apt-get install lshw

Then type the command lshw.  You will be able to find the architecture from the response of the command.

Advertisements

How to enable docker-compose to always rebuild containers from fresh images?

docker-compose by default may pull images from the cache. If you don’t want this to happen and want to rebuild all the containers from the scratch, the following command will help you.

docker-compose up --force-recreate

 

How to clear/delete the cached Kerberos ticket ?

In Linux

kdestroy

 

In Windows

klist purge

How to develop a background function in Python ?

This is an example of executing a function in the background. I was searching for an option to run a function in background along with the normal execution flow.


The main execution will continue in the same flow without waiting for the background function to complete and the function set for background execution will continue its execution in the background.


You can modify this code based on your requirement. Just replace the logic inside function under the @background annotation. Hope this tip helps 🙂


Configure Network in CentOS / RHEL from command line

How many of you are aware of a text user interface for network configuration ?. A tool called NMTUI (Network Manager Text User Interface) is available in CentOS and Redhat systems. You can simply open this by typing nmtui in the command line.

If this command is not available, you have to install the NetworkManager-tui package.

yum install NetworkManager-tui

If you type nmtui command in command line, the following console will open up. You can configure the network configurations in the opened console. You can

nmtui

nmtui

Disable Sleep mode in CentOS7/RHEL7 laptop on lid close

The following tip will help you to disable the powersaving or sleep mode behavior of your CentOS or RHEL laptop or desktop. If GUI is present, the following steps will help.

Applications => Utilities => Tweak Tool => Shell => Don't suspend on lid close => ON

But if GUI is not installed, then the only option is to disable this from the commandline. It is very easy, don’t worry. Who cares about the GUI in Linux. ? 🙂 (I love the black screen)

Open /etc/systemd/logind.conf, then make edit in the following configuration. By default, the value of this config will be suspend

HandleLidSwitch=ignore

man logind.conf will provide the complete details about this configuration file. Hope this tip helps.

 

Disable auto restart policy of docker container

If a docker container is started with –restart=always, then the container will not allow you to stop it.  We can change this behavior by modifying the restart policy. Refer the docker  official documentation for more info

For example

docker run -d --restart=always -p 80:80 -it nginx

To modify this behavior, try the following command.

docker update --restart=no your-container

Another option that allows us to stop the container manually is

docker update --restart=unless-stopped your-container