Wednesday, November 15, 2017

[SOLVED]: error 1355 - Warning: DcGetDcName(TIME_SERVER) call failed, error 1355

Warning: DcGetDcName(TIME_SERVER) call failed, error 1355
         A Time Server could not be located.
         The server holding the PDC role is down.
         Warning: DcGetDcName(GOOD_TIME_SERVER_PREFERRED) call failed, error 1355
         A Good Time Server could not be located.

It turned out that actually there were no problems with the time server in my case.
All these messages were misleading!! It cost me a whole day! So I hope this solution will be helpful for other people.

The actual reasons were:
1. Unavailable SYSVOL share
2. Unavailable NETLOGON share

How to restore it?
1. To recreate SYSVOL
net stop ntfrs
REG ADD "HKLM\System\CurrentControlSet\Services\NtFrs\Parameters\Backup/Restore\Process at Startup" /v BurFlags /t REG_DWORD /d 212 /f 
net start ntfrs
Origin https://support.microsoft.com/en-us/help/316790/the-sysvol-and-netlogon-shares-are-missing-after-you-restore-a-domain
2. To recreate NETLOGON - just type in these two commands:
net stop netlogon
net start netlogon
3.  Test it:
dsquery server
netdom query fsmo
dcdiag /test:fsmocheck

Wednesday, August 9, 2017

SOLVED: "TLS init def ctx failed" -1 (Ubuntu)

# Disable AppArmor temporarily! - this helped me!
/etc/init.d/apparmor teardown

# Assuming you've already set appropriate rights on the file TLSCertificateKeyFile and others as mentioned http://blog.rot13.org/2016/01/debian-openldap-with-gnutls-and-openssl-certificates.html

# Start OpenLDAP again
service slapd start

# Or debug it with (for those who prefer storing config in the plain text file, rather than in LDAP)
/usr/sbin/slapd -g openldap -u openldap -f /etc/ldap/slapd.conf -d -1


Wednesday, August 31, 2016

Useful vimrc.local (remember last position of editing for vim)

vim /etc/vim/vimrc.local

" Jump to the last position
if has("autocmd")
autocmd BufReadPost * if line("'\"") > 0 && line ("'\"") <= line("$") | exe "normal! g`\"" | endif
endif

" Enable syntax hightlighting
syntax on

Debug systemd (show errors only) with journalctl

To see what failed on system startup:

root@vm-host1:~# journalctl -b -p 3
-- Logs begin at Wed 2016-08-31 12:28:11 MSK, end at Wed 2016-08-31 12:34:17 MSK. --
Aug 31 12:28:11 vm-host1 kernel: i8042: Can't read CTR while initializing i8042
Aug 31 12:28:11 vm-host1 kernel: sd 6:0:0:0: [sdd] No Caching mode page found
Aug 31 12:28:11 vm-host1 kernel: sd 6:0:0:0: [sdd] Assuming drive cache: write through
Aug 31 12:28:11 vm-host1 systemd-sysv-generator[306]: Ignoring creation of an alias umountiscsi.service for itself
Aug 31 12:28:12 vm-host1 kernel: Error: Driver 'pcspkr' is already registered, aborting...
Aug 31 12:28:24 vm-host1 iscsid[994]: iSCSI daemon with pid=995 started!


Wednesday, May 18, 2016

lsblk - best tool for auditing LVM (make graph of VG/PV)

# lsblk

NAME                            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                               8:0    1 819,7G  0 disk
|-sda1                            8:1    1   243M  0 part /boot
|-sda2                            8:2    1     1K  0 part
`-sda5                            8:5    1 819,5G  0 part
  |-server--vg-root             252:0    0   8,4G  0 lvm  /
  |-server--vg-swap_1           252:1    0    10G  0 lvm
  |-server--vg-var              252:2    0   2,8G  0 lvm  /var

Command to make sudo not to ask for password (bash one-liner)

By default Ubuntu users forced to type password every time when they perform root operations.
You can use this snippet to avoid it:

sed -i "/^%admin/ {/NOPASSWD/! s/ALL$/NOPASSWD:ALL/}" /etc/sudoers
sed -i "/^%sudo/ {/NOPASSWD/! s/ALL$/NOPASSWD:ALL/}" /etc/sudoers


Here is how to read it:
* find only strings that start with %admin
* skip them if they already contain NOPASSWD
(so you can safely run this script many times)
* substitute last(on the line) matching of word "ALL" with NOPASSWD:ALL


Monday, February 8, 2016

SOLVED :error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown

You should specify which secure protocol you would like to use, e.g. :

openssl s_client -showcerts -connect 10.100.1.17:443 -tls1

(I used Google Chrome to determine which protocol is definitely working, it's shown in the Connection information tab)