-
Recent Posts
Archives
- July 2020
- April 2020
- February 2020
- January 2020
- December 2019
- November 2019
- August 2019
- July 2019
- June 2019
- May 2019
- February 2019
- January 2019
- November 2018
- October 2018
- September 2018
- August 2018
- June 2018
- May 2018
- April 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- August 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- September 2016
- August 2016
- March 2016
- December 2015
- November 2015
- October 2015
- September 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- November 2014
- October 2014
- September 2014
- August 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
Categories
Monthly Archives: December 2017
linux del and undel exercise
del script #!/usr/bin/bash TRASH=/trash DB=/trash/db touch /trash/db mkdir ${TRASH} 2> /dev/null if (($# == 0)) then echo “usage: del ” fi FILE=`basename $1` DIR=`dirname $1` DIR=`echo $DIR|sed ‘s/\//_/g’` SUFFIX=`date +%Y_%m_%d_%H_%M_%S` FILE=${FILE}_${SUFFIX}_$DIR ID=`wc -l ${DB}|awk ‘{print $1}’` echo $ID ((ID+=1)) echo … Continue reading
Posted in Uncategorized
Leave a comment
Linux exercises
NFS client and server LVM ip binding systemd SElinux nfs autofs working in the shell firewalld date and ntp scripts splitfile Cron
Posted in Uncategorized
Leave a comment
linux systemd_ex
create a service file. cp /lib/systemd/system/crond.service \ /lib/systemd/system/sleep.service edit the service file. vi /lib/systemd/system/sleep.service [Unit] Description=sleep service [Service] ExecStart=/usr/sbin/sleep.sh KillMode=process [Install] WantedBy=multi-user.target create a script to be executed. vi /usr/sbin/sleep.sh #!/usr/bin/bash sleep 1000 make the script executable chmod +x /usr/sbin/sleep.sh … Continue reading
Posted in Uncategorized
Leave a comment
linux apache virtual hosts example
Create the directory structure mkdir -p /var/www/html/www.vhost1.com mkdir -p /var/www/html/www.vhost2.com Create test web pages for each virtual host echo “vhost1” > /var/www/html/www.vhost1.com/index.html echo “vhost1” > /var/www/html/www.vhost1.com/index.html echo “vhost2” > /var/www/html/www.vhost2.com/index.html Set up ownership and permissions chown -R apache:apache /var/www/html/www.vhost1.com chown … Continue reading
Posted in Uncategorized
Leave a comment