Etiquetes » Bash

How to determine if a bash variable is empty?

A variable in bash (and any POSIX-compatible shell) can be in one of three states:

  • unset
  • set to the empty string
  • set to a non-empty string…
  • 146 more words

List goals/targets in GNU make that contain variables in their definition - Stack Overflow

*nix systems tools often are have write-only maintenance tricks:

alias make-list-target='make -qp | awk -F":" "/^[^$#\/\t=]*:([^=]|$)/ {split(\$1,A,/ /);for(i in A)print A[i]}"'

Like usual, I have only a vague idea what the regex expressions do.

18 more words
Development

How to Generalize a Linux VM Template

When building out an environment of any kind, you need to have a good starting base, a strong foundation and the same holds true for many things. 183 more words

Technology

Introduction to shell scripting

Shell scripting basically means writing commands that can be read my shell program for execution on a unix system . There are a number of shell programs like… 158 more words

How to install LAMP in Ubuntu 16.04

apt-get -y install mariadb-server mariadb-client #Install mysql server,client
mysql_secure_installation #Set password for Mariadb
mysql -u root -p #Connect to mysql
apt-get -y install apache2 #Install apache2
apt-get -y install php7.0 libapache2-mod-php7.0 #Instal php
systemctl restart apache2 #Restart apache2
nano /var/www/html/info.php
<?php
phpinfo();
?>
ctr-o
y
chown www-data:www-data /var/www/html/info.php #Change the owner of info.php
apt-get -y install php7.0-mysql
apt-get -y install php-apcu #Php cache to speed up php
systemctl restart apache2
a2enmod ssl #Enable ssl
a2ensite default-ssl
systemctl restart apache2
apt-get -y install phpmyadmin
//echo "update user set plugin='' where User='root'; flush privileges;" | mysql -u root -p mysql
Linux

how to fix a 'file in use' problem



Sometimes when you try to eject a disk, unmount a volume or empty the Trash, you get caught out by some app or process that’s using the file and won’t release it. 287 more words

Terminal