Asides

Install memcache in CentOS 7

Memcached is a configurable memory object caching daemon that stores objects in memory to reduce database load in dynamic web applications.
It’s built on top of libevent to grow to any size, and it’s specially designed to minimise swapping and utilise non-blocking I/O wherever possible.

Memcached is high performance in memory cache system that is useful to speed up websites  which used heavy database. Memcached support many programming languages like PHP,Ruby,Python,Perl.


 

Install Memcached :

  • Clean up yum

         [root@linuxsysad ~]# yum clean all

  • Update yum packages

         [root@linuxsysad ~]# yum update

  • Install Memcached Package.

         [root@linuxsysad ~]# yum -y install memcached

  • Start Memcached service:

        [root@linuxsysad ~]# systemctl start memcached

  • configure to start memcached service at boot time.

         [root@linuxsysad ~]# systemctl enable memcached

 


 

Configure memcached :

The default configuration file can be found at:

/etc/sysconfig/memcached

When started, Memcached will start on port 11211 by default as per the default configuration file:

PORT=”11211″
USER=”memcached”
MAXCONN=”1024″
CACHESIZE=”64″
OPTIONS=””

CACHESIZE is default set in MB. For example we set CACHESIZE=”64″ means it is 64 MB.


Install Brave Browser in Ubuntu16+ & Mint 18+

 

[root@linuxsysad ~]#sudo apt install apt-transport-https curl

[root@linuxsysad ~]# curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | sudo apt-key –keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add –

[root@linuxsysad ~]#source /etc/os-release

[root@linuxsysad ~]#echo “deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ $UBUNTU_CODENAME main” | sudo tee /etc/apt/sources.list.d/brave-browser-release-${UBUNTU_CODENAME}.list

[root@linuxsysad ~]#sudo apt update

[root@linuxsysad ~]#sudo apt install brave-browser

Find Command: Find 0 KB files & Directory | name or extension.

Run Below Command in the current directory to find 0 kb files.

We add ‘f’ option for files.

[root@linuxsysad ~]#  find ./ -type f -empty

__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __

Run Below Command in the current directory to find 0 kb Directories.

We add ‘d’ option for Directory.

[root@linuxsysad ~]#  find ./ -type d -empty


Find file by name or extension.

We use . option to find all mp4  files in current directory.

[root@linuxsysad ~]# find . -name “*.mp4”

__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __

We use /home/linuxsysad/  directory path to find all mp4  files in /home/linuxsysad.

[root@linuxsysad ~]# find /home/linuxsysad -name “*.mp4”


 

 

SSH login without password

[root@linuxsysad ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): PRESS ENTER KEY FOR BLANK PASSWORD
Enter same passphrase again: PRESS ENTER KEY FOR BLANK PASSWORD
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:l0G3/GrujoduLPWr7a/k7vjNcwhuF2ONI/oalNMtYVk root@linuxsysad
The key’s randomart image is:
+—[RSA 2048]—-+
| . . E |
| . o + |
| . * |
| * + |
| S * o oo |
| o..oo* .|
| o.=++ = |
| . =X=o+ .|
| +*&#=+o |
+—-[SHA256]—–+ Continue reading SSH login without password

Firefox dbus-send: command not found

Error:

/usr/bin/firefox: line 255: dbus-send: command not found
Starting a11y dbus service…
Failed to launch bus: Failed to connect to session busprocess 6879: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open “/var/lib/dbus/machine-id”: No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Redirecting call to abort() to mozalloc_abort


 

Solutions:

  1. Make sure dbuspackage installed or not.

#yum install dbus

Then Run follwoing Command in terminal.

# dbus-uuidgen > /var/lib/dbus/machine-id

 


 

Compile & Install Python 2.7

Compile & Install Python 2.7

# wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz

# tar xf Python-2.7.6.tar.xz

# cd Python-2.7.6

# ./configure –prefix=/opt

# make && make altinstall

————————————————————————————————————–

To Make default python 2.7 Environment 
Edit /etc/bashrc and at the end of the file past below line.

# alias python=python2.7

————————————————————————————————————–

To update changes run below command in terminal.

# source /etc/bashrc

————————————————————————————————————–