How to search for specific text in config/text files in Linux

You can use this command

grep -rnw '/my/path/to/somewhere/' -e 'pattern'
Advertisements

How to install ASP.NET state session on Windows 2016

Go to Add Remove/Feature then Install ASP.NET 4.6 from .Net Framework 4.6 Features.

Once installed configure remote access

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection to 1.

Then set a service to autostart in services.msc

Once completed restart the service to enable remote connections.

Reboot is not required if you don’t change the Windows Registry settings.

How to disable specific repo from using apt proxy service

if you see the following error then you may need to exclude it from apt proxy

W: Failed to fetch https://packages.microsoft.com/debian/8/prod/dists/jessie/main/binary-amd64/Packages  Received HTTP code 403 from proxy after CONNECT

The easiest way to fix it is removing that repo from using proxy

Directly on the affected machine navigate to

vim /etc/apt/apt.conf.d/02proxy

then added affected repos to be direct

Acquire::https { Proxy "packages.microsoft.com DIRECT";}

You can now run apt-get update and it should be fine

How to recover password from 3CX IP PBX phone system

  1. Fist you need to have a root access to the server where 3CX is hosted.

Once logged it issue the following command to do a manually backup. The administrator password is in the .xml file in root of backup. So basically open up .zip files and there will only be 1 .xml file in it.

Run backup command ‘phonesystem” user otherwise it will not work.

sudo -u phonesystem 3CXBackupCmd –file=backuptest.zip –options=ALL

Then navigate to

/var/lib/3cxpbx/Instance1/Data/Backups

Once you open the file use serach to find “The admin ID” and the The admin pass

the value will be inside

<Value>youpassoword</Value> above the “The admin pass”

List of Linux command and most cases

This is work in progress.

Modules:

apt-get install package_name – debian based package manager
cat _file_ – display file content
dmesg – print or control the kernel ring buffer
ifconfig – tool for configure network cardĀ 
ls – list current directory
lsmod – list modules inserted into the kernel
pwd – display current path
yum – package manager for RedHat based system
vi _file_ – Vim editorĀ