Enabling the Global Status Monitor – Data Synchronizer.

In Synchronizer Web admin, click Global Status Monitor to display the instructions for enabling the Global Status Monitor. Initially, the current section of the documentation displays in your browser so that you can enable the Global Status Monitor.

As root in a terminal window, enter the following command:

root#: /opt/novell/datasync/previewfeature.sh --monitor --action enable

Restart the Synchronizer services. Refresh the Synchronizer Web Admin browser window to replace the link to the documentation with the link to the Global Status Monitor.

Recover root password.

1. Boot the LiveCD or rescue CD/USB, and mount your root (/) partition. For example:

mkdir /mnt/root
mount /dev/sdaX /mnt/root

and then edit the password file with your editor:

vim /mnt/root/etc/shadow

and then delete the second field on the root line:

root:$1$KmZw.u7l$JI6aYJRrSU7ZcUivaNQpZ1:15833:0:99999:7:::

2. Boot the LiveCD or rescue CD/USB, and mount your root (/) partition. For example:

mount -o remount,rw /dev/sdaX /mnt/root
chroot /mnt/root
passwd root

3. INIT or /bin/bash mode

Another trick is to add “init=/bin/bash” (LILO “linux init=/bin/bash” or add it to the Grub “kernel” line). This will dump you to a bash prompt much earlier than single user mode, and a lot less has been initialised, mounted, etc. You’ll definitely need the “-o remount,rw” here. Also note that other filesystems aren’t mounted at all, so you may need to mount them manually if you need them. Look in /etc/fstab for the device names.

passwd root

🙂

How to install and set up VPN (PPTP) server on Debian Linux.

PoPToP Point to Point Tunneling Server, this implements a Virtual Private Networking Server (VPN) that is compatible with Microsoft VPN clients. It allows windows users to connect to an internal firewalled network using their dialup.

Install pptpd:

root:# apt-get install pptpd

and then edit the configuration file:

root:# vim /etc/pptpd.conf

and add the following lines to:

localip 192.168.1.144
remoteip 192.168.1.200-225, 192.168.1.230

# Specifies the local and remote IP address ranges.
#
# Any addresses work as long as the local machine takes care of the
# routing. But if you want to use MS-Windows networking, you should
# use IP addresses out of the LAN address space and use the proxyarp
# option in the pppd options file, or run bcrelay.

then edit the configuration file:

root:# vim /etc/ppp/pptpd-options

and add the following lines to:

ms-dns 192.168.1.44 # my DNS server
nobsdcom
noipx
mtu 1490
mru 1490

edit another one configuration file:

root:# vim /etc/ppp/chap-secrets

and add the following lines to:

username * password *

then restart the pptpd service:

root@server: service pptpd restart

and don’t forget to enable 1723 on a firewall.

Disable the system beep during the shutdown -h +time.

To disable the system beep during the shutdown -h +time, sysfinit has to be downloaded into your machine.

apt-get source sysvinit
vim sysvinit-2.88dsf/src/shutdown.c

then find a “void warn(int mins)” function and there change

wall(buf, 0); to /*wall(buf, 0);*/

then run ./configure make etc. or make a package. Also you can use this:

rmmod pcspeaker

Surely there is another way to off the beep which I do not know 😉

SNMP installation and configuration.

This describe howto install and configure the SNMP on a RedHat or CentOS and Suse.

1. Installation
Run command yum for RH and Centos, for Suse use zypper and install net-snmp-utils

for RH/Centos use yum
root# yum install net-snmp-utils

for Suse use zypper:

root# zypper install net-snmp-utils

2. Configuration
Add the following lines to /etc/snmp/snmpd.conf

rocommunity public
syslocation "IT Department"
syscontact admin@somedomain.com

and then start the snmpd service

root# /etc/init.d/snmpd start

Do snmpwalk to make sure it is working

root# snmpwalk -v 1 -c public -O e 127.0.0.1

sample output:
SNMPv2-MIB::sysDescr.0 = STRING: Linux centos.somedomian.ie 2.6.18-274.el5 #1 SMP Fri Jul 22 04:49:12 EDT 2011 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (719265) 1:59:52.65

And finally, make sure snmpd starts next time you restart your machine.

root# chkconfig snmpd on

Tarballs benchmark – gz, bz2 and xz.

Directory used for this benchmark: test_tarball 189M in size. The directory contains /var/log files.

OS: Ubuntu 12.04LTS
CPU: Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
RAM: 2 x 4096MB DDR3 1333MHz
HDD: Hitachi HTS72323

.gz
tar cvzf tarball.tar.gz test_tarball/
Size of tar.gz tarball: 22M
Compression time: 0m3.926s

.bz2
tar cvjf tarball.tar.bz2 test_tarball/
Size of tar.bz2 tarball: 19M
Compression time: 0m38.924s

.xz
tar cvJf tarball.tar.xz test_tarball/
Size of tar.xz tarball: 18M
Compression time: 0m57.988s

It seems that it does not make sense for use .xz tarball for small size files.

Generating random password.

Handy way of generating random passwords is this:

root# echo `< /dev/urandom tr -dc A-Za-z0-9 | head -c8` here is an output: XjArHZxb

or

root# date | md5sum and here is an output: 711325e73eceea2a9899f2a6233ca045 -

also you can use the makepassword for generate a random password but before you do that you should install it onto your system, for example:

root# apt-get install makepasswd

Generating random password with makepasswd:

root# makepasswd and here is an output: 1of1CQRa

NTPQ command.

The ntpq utility program is used to monitor NTP daemon ntpd operations and determine performance. The program can be run either in interactive mode or controlled using command line arguments. Type the following command:

$ ntpq -pn ntp.4network.eu
ntp.4network.eu
remote refid st t when poll reach delay offset jitter
==============================================================================
#204.2.134.164 204.2.134.162 3 u 238 1024 377 185.977 0.415 7.099
-138.236.128.112 18.26.4.105 2 u 42 1024 377 123.400 1.895 1.691
-38.229.71.1 204.123.2.72 2 u 589 1024 377 124.355 5.031 1.320
*134.226.81.3 .GPS. 1 u 163 1024 377 12.422 0.175 3.552
-193.0.71.133 212.244.36.228 2 u 286 1024 377 73.360 4.239 2.494
-198.123.30.132 .GPS. 1 u 824 1024 377 179.881 9.097 4.242
+80.50.231.226 .ATOM. 1 u 917 1024 377 51.067 0.670 4.920
+217.96.29.26 .ATOM. 1 u 312 1024 377 53.215 0.389 0.814
-91.189.94.4 193.79.237.14 2 u 296 1024 377 30.870 5.167 2.027
+131.188.3.221 .DCFp. 1 u 390 1024 377 66.069 2.353 2.582
-193.1.219.116 .PPS. 1 u 923 1024 377 11.893 2.986 4.136
#216.239.32.15 149.48.60.162 2 u 484 1024 377 40.224 -6.111 3.703
#216.239.34.15 21.68.183.109 2 u 926 1024 377 35.171 -3.976 3.364