$ sudo apt install xfce4
Tag: linux
Schedule Restart in Ubuntu
Use crontab which OSX is also using.
sudo crontab -e
0 4 * * * /sbin/shutdown -r +5
m h dom mon dow command
minute hour dayOfMonth Month dayOfWeek commandToRun
this would reboot your system every day at 4:05am. (4:00am + 5 minutes)
Squid Access Log with human readable Time
To see the access log with human readable time in terminal:
tail -f /var/log/squid/access.log | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'
Reference here
Removing #comment lines from Conf file
Everyone knows that squid.conf have millions of #comment lines.
here is a one liner to remove it:
grep -v '^#' squid.conf | uniq | sort >squid.nocomment
this could apply to any files in Linux which has the # at the front.
Reference here
NetXMS on Ubuntu Server 16.04.1
Install Ubuntu Server as usual
Don't forget to install Openssh Server during the process
After it finished, if you want to install lightweight desktop: (this is optional, because most of the works are done in terminal via ssh)
For ex: (lxde)
#sudo apt-get install --no-install-recommends lubuntu-desktop
Now to install NetXMS (current: 2.0.6)
#apt-get update
#apt-get install mysql-server
#apt-get install tomcat7
#apt-get install libmysqlclient-dev
#apt-get install libssl-dev
#apt-get install g++
#apt-get install c++
Create a database:
#sudo mysql -u root
mysql> CREATE DATABASE netxms;
mysql> GRANT ALL ON netxms.* TO netxms@localhost IDENTIFIED BY 'password';
mysql> quit
Download the NetXMS server package:
#wget http://www.netxms.org/download/netxms-2.0.6.tar.gz
#tar -xvf netxms-2.0.6.tar.gz
Configure the package:
#cd netxms.x.x.x
#sudo sh ./configure --with-server --with-mysql --with-agent (it will show some results)
#sudo make
#sudo make install
#sudo cp contrib/netxmsd.conf-dist /etc/netxmsd.conf
#sudo cp contrib/nxagentd.conf-dist /etc/nxagentd.conf
#sudo nano /etc/netxmsd.conf
sample output:
DBDriver = mysql.ddr DBServer = localhost DBName = netxms DBLogin = netxms DBPassword = password LogFile = /var/log/netxmsd LogFailedSQLQueries = yes
#sudo nano /etc/nxagentd.conf
MasterServers = 127.0.0.1, 192.168.1.1
Initiaze agent and server services:
#sudo cat /etc/ld.so.conf.d/libc.conf (check it contain /usr/local/lib, if not add it)
#sudo ldconfig
#sudo ldconfig -p|grep libnetxms (it shows some output)
#/usr/local/bin/nxdbmgr init /usr/local/share/netxms/sql/dbinit_mysql.sql
#/usr/local/bin/nxagentd -d
#/usr/local/bin/netxmsd -d
Download the web based management:
#wget http://www.netxms.org/download/webui/nxmc-2.0.6.war
#sudo rename nxmc-2.0.6.war nxmc.war
#sudo cp nxmc.war /var/lib/tomcat7/webapps/
#sudo netxmsd
(this is to start netXMS server properly, otherwise you will get connection refused when you login)
Open browser:
http://ip_address:8080/nxmc/nxmc
(default username: admin, password: netxms)
NetXMS website: http://www.netxms.org/
My installation was based on this reference, though there was some hiccups along the way!