Automatyczna aktualizacja ip w freedns.42.pl

Wysłanie powiadomienia na maila

    1. instalacja mailx
      sudo apt-get install heirloom-mailx
    2. zapisanie plikunano ~/.mailrco zawartości:
      account gmail {
          set smtp-use-starttls
          set ssl-verify=ignore
          set smtp-auth=login
          set smtp=smtp://smtp.gmail.com:587
          set from="noreply@yourdomain.com(Your Real Name)"
          set smtp-auth-user=noreply@yourdomain.com
          set smtp-auth-password=your_less_secure_apps_password
          set ssl-verify=ignore
      }

Bacula – odzyskiwanie z LTO

Bacula odzyskiwanie z taśm- brak nr jobu w baculi (bazie), Przedawnienie

Aby nie odzyskiwać wszystkiego – brak miejsca na serwerze, wczytujemy pliki z taśmy do bazy:

Niestety trzeba zmieniać taśmy i zatrzymać baculę, aby był dostęp do streamera

  1. Włożyć taśmy do napędu i pamiętać które sloty (od 1 do 4)
    zamontować 1 volumen (slot 1 – BP0306L4)
    W bconsole wydać: mount slot=1 # montowanie voluminu BP0306L4
    po zamontowaniu zatrzymać bacula dir i sd:
    service bacula-director stop
    service bacula-sd stop
  2. W nowej sesji wydać polecenie: bscan -V BP0306L4\|LL2357L4\|BP0317L4\|LL2350L4 -v -s -m -h localhost -t 3306 -n bacula -u bacula -P Password -c /etc/bacula/bacula-sd.conf /dev/nst0
    Gdy poprosi o kolejny Vol to w starej sesji:
    service bacula-director start
    service bacula-sd start
    zamontować 2 volumen (slot 2 – LL2357L4)
    W bconsole wydać: mount slot=2 # montowanie voluminu LL2357L4
    po zamontowaniu zatrzymać bacula dir i sd
    service bacula-director stop
    service bacula-sd stop
    w pierwszej sesji gdzie wydaliśmy polecenie bscan wcisnąć ENTER

Dla kolejnych analogicznie, bscan wyświetli które joby zostały zapisane na taśmie co pozwoli odzyskać pliki wydając restore numer jobu.

LTE Band

LTE
/interface lte set network-mode=lte lte1
/interface lte at-chat lte1 input="AT*Cell=1,3,3,1798,21"
/interface lte at-chat lte1 input="AT*Cell=1,3,7,3175,483"

3G
/interface lte set network-mode=3g lte1
/interface lte at-chat lte1 input="AT*Cell=1,2,1,10639,"

/interface lte set network-mode=3g lte1
/interface lte at-chat lte1 input=”AT*Cell=1,2,1,10663,”

/interface lte set network-mode=3g lte1
/interface lte at-chat lte1 input=”AT*Cell=1,2,1,,”

/interface lte disable lte1
/interface lte enable lte1

https://wiki.mikrotik.com/wiki/Manual:Interface/LTE

Kasowanie, Listowanie, wyłączenie kont PC w AD

#ustawienie max wieku komputerów:
$then = (Get-Date).AddDays(-90)

#Wylistowanie tych komputerów, które nie logowały się ostatnio:
Get-ADComputer -Property Name,lastLogonDate -Filter {lastLogonDate -lt $then} | FT Name,lastLogonDate

#Wyłączenie kont nieaktywnych komputerów:
Get-ADComputer -Property Name,lastLogonDate -Filter {lastLogonDate -lt $then} | Set-ADComputer -Enabled $false

#Usunięcie nieaktywnych komputerów:
Get-ADComputer -Property Name,lastLogonDate -Filter {lastLogonDate -lt $then} | Remove-ADComputer

Powershell: directory name must be less than 248 characters

Może się przyda

Udało mi się obejść, prymitywnie, ale udało się, ograniczenie powershella

Mianowicie to: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters

Zamiast: Remove-Item na końcu robię Move-Item do innego folderu i nie wywala błędu długich nazw

A poleceniem dosowe rmdir nie ma problemu z kasowaniem długich ścieżek, plików

[sourcecode language=”powershell”]
Cmd /C "mkdir R:\DO_SKASOWANIA"
Get-ChildItem -Path "R:\BACKUP" | Where-Object { $_.CreationTime -lt (Get-Date).AddDays(-5)} | Move-Item -Destination "R:\DO_SKASOWANIA"
Cmd /C "rmdir /S /Q R:\DO_SKASOWANIA"[/sourcecode]

Outlook – potencjalnie niebezpieczny załącznik

Outlook – potencjalnie niebezpieczny załącznik: mdb; bat; reg lub inne rozszerzenia.

Microsoft Office Outlook 2010:
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security

Microsoft Office Outlook 2007:
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security

Microsoft Office Outlook 2003:
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security

Microsoft Outlook 2002:
HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Security

Microsoft Outlook 2000:
HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Security

level1removeWpis dla Outlook 2013:

Windows Registry Editor Version 5.00[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Security]
„OutlookSecureTempFolder”=”C:\\Users\\admin\\AppData\\Local\\Microsoft\\Windows\\Temporary Internet Files\\Content.Outlook\\F1425PCN\\”
„level1remove”=”mdb; bat; reg; vbs;”

Skrypt

Routing Windows 7

Dodanie routingu na interfejs w Windows 7:

route print
=======================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 10 a4 8b 4b 8e ...... Intel(R) PRO/100+ MiniPCI - Packet Scheduler Miniport
0x4 ...44 45 53 54 42 00 ...... Nortel IPSECSHM Adapter - Packet Scheduler Miniport
0x20003 ...00 04 5a 0c 96 db ...... Instant Wireless - Network PC CARD #2 - Packet Scheduler Miniport
=======================================================================
route -p add 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 1 if 0x20003

Źródło: http://windowsitpro.com/networking/q-when-i-add-static-ip-route-what-value-do-i-use-interface