yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel
736
Points
Questions
153
Answers
90
- Asked on September 7, 2021 in MySQL.
TRUNCATE TABLE table_name; --the TABLE keyword is actually optional: TRUNCATE table_name;
- 1140 views
- 1 answers
- 0 votes
- Asked on September 7, 2021 in info.
ALTER TABLE old_table_name RENAME new_table_name;
- 889 views
- 1 answers
- 0 votes
- Asked on September 6, 2021 in MySQL.
MySQL offers two ways to rename tables. The first one uses the
ALTER TABLE
syntax:ALTER TABLE old_table_name RENAME new_table_name;
The second way is to use
RENAME TABLE
RENAME TABLE old_table_name TO new_table_name;
RENAME TABLE
offers more flexibility. It allows renaming multiple tables in one statement. This can be useful when replacing a table with a new pre-populated version:RENAME TABLE products TO products_old, products_new TO products;
The above statement is executed left to right, so there’s no conflict naming
products_new
toproducts
since the existing table has already been renamed toproducts_old
.- 1030 views
- 1 answers
- 0 votes
- Asked on September 6, 2021 in info.
Dropping a table in MySQL is simple:
DROP TABLE empinfo;
- 882 views
- 1 answers
- 0 votes
- Asked on September 6, 2021 in MySQL.
How to Create a Table in MySQL
Here’s an example of creating a
users
table in MySQL:CREATE TABLE users ( id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, -- Auto incrementing IDs name VARCHAR(100), -- String column of up to 100 characters preferences JSON, -- JSON columns are great for storing unstructured data and are supported starting MySQL version 5.7.8 created_at TIMESTAMP -- Always store time in UTC );
Within the parentheses are called column definitions separated by commas. The minimum required fields for a column definition are column name and data type, which is what is shown above for columns
name
,preferences
, andcreated_at
. The id column has extra fields to identify it as the primary key column and use an auto-incrementing feature to assign it values.This is also a chance to specify not null constraints, default values, and an optional
ENGINE
keyword:CREATE TABLE users ( id INTEGER AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) not null, active boolean default true ) ENGINE=INNODB;
Storage engines are MySQL components that handle the SQL operations for different table types. This allows developers to extend capabilities of MySQL. When not specified, the default engine used is INNODB.
- 906 views
- 1 answers
- 0 votes
- Asked on September 2, 2021 in MySQL.
To
update rows that match a certain condition.–For Example, This will update only one row that matches product_id=1
UPDATE products SET stocks=100, available=true WHERE product_id=1; --For Example, This will update multiple rows that match Category='Electronics' UPDATE products SET stocks=50, available=true WHERE category='Electronics';
To update all rows in a MySQL table, just use the
UPDATE
statement without aWHERE
clause:UPDATE products SET stocks=100;
- 974 views
- 1 answers
- 0 votes
- Asked on September 1, 2021 in info.
Check Enabled Apache Modules
Therefore, in order to check which modules are enabled on your Apache web server, run the applicable command below for your distribution, where
-t -D DUMP_MODULES
is a Apache-argument to show all enabled/loaded modules:--------------- On Debian based systems --------------- $ apache2ctl -t -D DUMP_MODULES OR $ apache2ctl -M
--------------- On RHEL based systems --------------- $ apachectl -t -D DUMP_MODULES OR $ httpd -M $ apache2ctl -M
List Apache Enabled Loaded Modules[root@tecmint httpd]# apachectl -M Loaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) auth_basic_module (shared) auth_digest_module (shared) authn_file_module (shared) authn_alias_module (shared) authn_anon_module (shared) authn_dbm_module (shared) authn_default_module (shared) authz_host_module (shared) authz_user_module (shared) authz_owner_module (shared) authz_groupfile_module (shared) authz_dbm_module (shared) authz_default_module (shared) ldap_module (shared) authnz_ldap_module (shared) include_module (shared) ....
- 900 views
- 1 answers
- 0 votes
- Asked on September 1, 2021 in info.
Install RPM File Using RPM Command
To install a .rpm package in CentOS Linux, enter the following:
sudo rpm -i sample_file.rpm
The
-i
switch tells the package manager you want to install the file.More information on the RPM installer can be found in the RPM documentation.
Install RPM File with Yum
Alternately, you can use the yum package manager to install .rpm files.
Enter the following:
sudo yum localinstall sample_file.rpm
The
localinstall
option instructionsyum
to look at your current working directory for the installation file.Install RPM on Fedora
To install an .rpm package on Fedora Linux, enter the following:
sudo rpm -i sample_file.rpm
Just as in CentOS, the -i switch tells RPM to install the software.
Another method is to use the dnf utility to install the package:
sudo dnf localinstall sample_file.rpm
Unlike many Linux tools, DNF is not a set of initials. It is merely the next evolution of the yum package manager.
- 745 views
- 1 answers
- 0 votes
- Asked on September 1, 2021 in info.
Install/Uninstall .deb files
The package files associated with Kubuntu have the .deb suffix because of Kubuntu’s close relation to the Debian GNU/Linux distribution. You can download and install individual .deb files. You will need administrative privileges to do this (see the section called “Root And Sudo”).
- To install a .deb file, simply Right-click on the .deb file, and choose ->.
- Alternatively, you can also install a .deb file by opening a terminal and typing:
sudo dpkg -i package_file.deb
- To uninstall a .deb file, remove it using Adept, or type:
sudo apt-get remove package_name
- 709 views
- 1 answers
- 0 votes
- Asked on September 1, 2021 in MySQL.
-- Assuming the users table has only three columns: first_name, last_name, and email, and in that order INSERT INTO users VALUES ('John', 'Doe', 'john@doe.com');
INSERT INTO users (first_name, last_name, email, birth_date, city, state) VALUES ('John', 'Doe', 'john@doe.com','2000-01-01','Los Angeles','CA');
Inserting Multiple Rows
You can insert multiple rows in one
INSERT
statement by having multiple sets of values enclosed in parentheses:INSERT INTO users (first_name, last_name) VALUES ('John','Lennon'), ('Paul','McCartney'), ('George','Harrison'), ('Ringo','Starr');
- 775 views
- 1 answers
- 0 votes
- Asked on August 24, 2021 in Asterisk.
Enable PowerTools Repository on CentOS 8 / RHEL 8:
sudo dnf config-manager --set-enabled PowerTools
Confirm it is enabled:
sudo dnf repolist
Then you can try to download it automatically:
yum -y install libedit-devel
- 419 views
- 2 answers
- 0 votes
- Asked on August 24, 2021 in Asterisk.
Install the libedit-devel lib manually.
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libedit-devel-3.0-12.20121213cvs.el7.x86_64.rpm sudo rpm -i libedit-devel-3.0-12.20121213cvs.el7.x86_64.rpm
- 419 views
- 2 answers
- 0 votes
- Asked on August 24, 2021 in Asterisk.
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz tar -zxvf asterisk-16-current.tar.gz
yum install rdate unzip make patch gcc gcc-c++ subversion php php-devel php-gd gd-devel php-mbstring php-mcrypt php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel httpd libpcap libpcap-devel libnet ncurses ncurses-devel screen mysql-server mysql-devel ntp kernel* mutt glibc.i686 conntrack-tools telnet glibc-devel openssl-devel zlib-devel libedit.i686 libedit-devel.i686 libedit-devel uuid-dev epel-release dmidecode gcc-c++ ncurses-devel wget openssl-devel newt-devel kernel-devel sqlite-devel libuuid-devel gtk2-devel jansson-devel binutils-devel -y
./configure --libdir=/usr/lib64 --with-pjproject-bundled --with-jansson-bundled && make menuselect && make && make install
# make samples # make config
# ldconfig # chkconfig asterisk on- 401 views
- 1 answers
- 0 votes
- Asked on August 24, 2021 in Asterisk.
Install Asterisk 16 on CentOS 7
Before you start executing Asterisk install commands on your CentOS 7 server, make sure all the package son the system are up to date.
sudo yum -y update
Set Hostname:
sudo hostnamectl set-hostname pbx.example.com
Add EPEL repository
sudo yum -y install epel-release
Set SELinux in Permissive Mode by running the commands below:
sudo setenforce 0 sudo sed -i 's/\(^SELINUX=\).*/\SELINUX=permissive/' /etc/selinux/config
Then follow the steps below to install and configure Asterisk 16 on your CentOS 7 / Fedora server.
Step 1: Install Asterisk 16 PBX dependencies
The initial step when setting up Asterisk is to install all required dependencies.
sudo yum -y install wget vim net-tools
You also need to install Development Tools group packages.
sudo yum -y groupinstall "Development Tools"
The other packages that you need to install are:
sudo yum -y install libedit-devel sqlite-devel psmisc gmime-devel ncurses-devel libtermcap-devel sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel uuid-devel libtool libuuid-devel subversion kernel-devel kernel-devel-$(uname -r) git subversion kernel-devel crontabs cronie cronie-anacron wget vim
Step 2: Download and Install Jansson
Jansson is a C library for encoding, decoding and manipulating JSON data. Download and install it on CentOS 7 server by running the commands below:
cd /usr/src/ git clone https://github.com/akheron/jansson.git cd jansson autoreconf -i ./configure --prefix=/usr/ make && make install
Step 3: Download and Install PJSIP
PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE. Clone the project from Github, then compile and install.
cd /usr/src/ export VER="2.10" wget https://github.com/pjsip/pjproject/archive/${VER}.tar.gz tar -xvf ${VER}.tar.gz cd pjproject-${VER} ./configure CFLAGS="-DNDEBUG -DPJ_HAS_IPV6=1" --prefix=/usr --libdir=/usr/lib64 --enable-shared --disable-video --disable-sound --disable-opencore-amr make dep make make install ldconfig
Step 4: Download and Install Asterisk
Now that we have all dependency packages installed, we should be ready to download and install Asterisk 16 on CentOS 7
cd /usr/src/
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
tar xvfz asterisk-16-current.tar.gz
cd asterisk-*
./configure –libdir=/usr/lib64
make menuselect
sudo contrib/scripts/get_mp3_source.sh
make
make install
make samples
make config
ldconfig
- 514 views
- 1 answers
- 0 votes
- Asked on August 23, 2021 in Asterisk.
dnf --enablerepo=powertools install libedit-devel
Here is the example:[root@localhost asterisk-16.20.0]# dnf –enablerepo=powertools install libedit-devel
CentOS Linux 8 – PowerTools 3.5 MB/s | 2.3 MB 00:00
Last metadata expiration check: 0:00:01 ago on Mon 23 Aug 2021 10:39:54 PM IST.
Dependencies resolved.
========================================================================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================================================================
Installing:
libedit-devel x86_64 3.1-23.20170329cvs.el8 powertools 44 kTransaction Summary
========================================================================================================================================================================
Install 1 PackageTotal download size: 44 k
Installed size: 55 k
Is this ok [y/N]: y
Downloading Packages:
libedit-devel-3.1-23.20170329cvs.el8.x86_64.rpm 293 kB/s | 44 kB 00:00
————————————————————————————————————————————————————————
Total 71 kB/s | 44 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libedit-devel-3.1-23.20170329cvs.el8.x86_64 1/1
Running scriptlet: libedit-devel-3.1-23.20170329cvs.el8.x86_64 1/1
Verifying : libedit-devel-3.1-23.20170329cvs.el8.x86_64 1/1Installed:
libedit-devel-3.1-23.20170329cvs.el8.x86_64Complete!
- 1180 views
- 1 answers
- 0 votes
- Asked on August 23, 2021 in info.
upower -i /org/freedesktop/UPower/devices/battery_BAT0 Example: [root@localhost ~]# upower -i /org/freedesktop/UPower/devices/battery_BAT0 native-path: BAT0 vendor: Hewlett-Packard model: Primary serial: 02288 2020/03/06 power supply: yes updated: Mon 23 Aug 2021 12:16:47 AM EDT (1 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: charging warning-level: none energy: 0 Wh energy-empty: 0 Wh energy-full: 43.2 Wh energy-full-design: 43.2 Wh energy-rate: 0 W voltage: 7.132 V percentage: 0% capacity: 100% technology: lithium-ion icon-name: 'battery-caution-charging-symbolic'
- 322 views
- 1 answers
- 0 votes
- Asked on August 22, 2021 in info.
Here is the Generic method to add persistent static routing on Linux
Edit /etc/rc.d/rc.local or /etc/rc.local, enter
# vi /etc/rc.local
Append the following line:/sbin/ip route add 192.168.1.0/24 dev eth0
OR
/sbin/ip route add 192.168.1.0/24 dev eth0
Save and close the file in vim text editor.
- 371 views
- 2 answers
- 0 votes
- Asked on August 22, 2021 in info.
To make route entry persistent in the Linux kernel routing table, you need to modify config file as per your Linux distributions.
RHEL/CentOS/Fedora/Scientific Linux persistent routing configuration
Edit /etc/sysconfig/network and set default gateway IP address:
# vi /etc/sysconfig/network
Sample outputs:## setup default gateway ## GATEWAY=192.168.1.254
You can add additional static route for eth0 by editing /etc/sysconfig/network-scripts/route-eth0 file as follows:
10.0.0.0/8 via 10.10.29.65
The above config sets static routing for network 10.0.0.0/8 via 10.9.38.65 router.
Debian / Ubuntu Linux persistence static routing configuration
Edit /etc/network/interfaces file, enter:
# vi /etc/network/interfaces
Append the following in eth0 section:up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254 down route del -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254
Save and close the file.
- 371 views
- 2 answers
- 0 votes
- Asked on August 20, 2021 in info.
# yum install tcpdump For more details regarding tcpdum https://blog.eduguru.in/linux-2/tcpdump-linux-network-sniffer-tool
- 382 views
- 1 answers
- 0 votes
- Asked on August 5, 2021 in info.
Open a shell prompt and type the following command as root user:
$ sudo dmidecode --type 17
OR
$ sudo dmidecode --type 17 | more
Sample output:# dmidecode 2.9 SMBIOS 2.4 present. Handle 0x0018, DMI type 17, 27 bytes Memory Device Array Handle: 0x0017 Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 2048 MB Form Factor: DIMM Set: None Locator: J6H1 Bank Locator: CHAN A DIMM 0 Type: DDR2 Type Detail: Synchronous Speed: 800 MHz (1.2 ns) Manufacturer: 0x2CFFFFFFFFFFFFFF Serial Number: 0x00000000 Asset Tag: Unknown Part Number: 0x5A494F4E203830302D3247422D413131382D Handle 0x001A, DMI type 17, 27 bytes Memory Device Array Handle: 0x0017 Error Information Handle: Not Provided Total Width: Unknown Data Width: Unknown Size: No Module Installed Form Factor: DIMM Set: None Locator: J6H2 Bank Locator: CHAN A DIMM 1 Type: DDR2 Type Detail: None Speed: Unknown Manufacturer: NO DIMM Serial Number: NO DIMM Asset Tag: NO DIMM Part Number: NO DIMM
- 406 views
- 2 answers
- 1 votes