Pandan tail -f komande za WIN10

Ima mali pogramčić koj to radi : “Snake tail“, ali može i drugačije :

PowerShell
Otići na lokaciju gde je logfajl.log i dati komandu :
Get-Content logfajl.log –Wait
Ovo će izlistati ceo log odjednom, i onda izbacivati liniju po liniju kako se upisuju.
Dobar link.

Kako videti SAMO poslednje 3 linije upisane u log fajl :
Get-Content D:\log.txt -Tail 3

Kako sačuvati off-line ceo sajt

Moj kompjuter na koji hoću da sačuvam sajt : WIN10/64
Sajt je interni u unutrašnjoj mreži, ali sa njim ima dva problema :
1. Redirektuje, jer traži user+pass za logovanje
2. Ima sertifikat koji nije root

Evo koje sam free alate probala :

1) Cyotek Web Copy
Na prvi pogled deluje super, ali javlja silne greške, i ne uspevam da mu “poturim” user i pass za sajt.
Postavila sam pitanje na njihovo forumu, pa ćemo videti.

Kako se isključuje provera sertifikata :
If the SSL certificate associated with a website is invalid or untrusted, WebCopy will refuse to copy the site. You can force such sites to be copied by ignoring certificate errors.
From the Project Properties dialogue, expand the Advanced category and select Security
Check the “Ignore certificate errors” option
Napomena : zbunjuje me pošto i dalje javlja da je nesiguran sertifikat kada probam da uradim “Capture form”?

Using a web browser to log in
Select Forms and Passwords from the Project menu and select the Passwords category
Check the Log in using a web browser option

Napomena : radi kada sajt nije zaštićen sa user+pass kombinacijom. Uzdah.

2) HTTrack
Malo mator (iz 2017)
Pamti projekat kao *.whtt
Koristi to da sebe treba privremeno staviti kao proxy u IE, ali kao svoju IP adresu daje SAMO IPv6!!!!!
Pošto je u pitanju interna mreža IPv6 nije uopšte omogućen. Jedino rešenje koje sam našla je da se uradi ovo : [IPv6]
, tj da se IPv6 adresa stavi u uglaste zagrade.
Ovde je dobro objašnjenje kako bi to trebalo da radi (ali ne radi).

Napomena : WinHttrack does not have a stop and resume. It only has a Pause/resume and a Cancel/continue. If you Pause you then Resume right where it left off. You can not close httrack.

Dobar link sa nekim osnovnim uputstvom za rad.

Don’t shutdown. Pause httrack and hibernate.

Rešenje :
a) Koristiti Google Chrome
b) Ići na More tools/Developer Tools

c) U Chrome-u otvoriti željeni sajt i ulogovati se
d) U Developer Tools delu Chrome prozora, ići na stavku “Cookies”, “Ime vašeg sajta”

e) Kopirati vrednost pod stavkom “_vaš sajt_session_” (to je jedna OGROMNA kobasica alfanumerika)

f) U HTTRack, kada se dodaje URL, prvo dodati URL sajta koji želite da sačuvate, onda URL za login stranu i onda na kraju dodati “kobasicu” iz predhodne tačke
Dobar link
OBAVEZNO uz URL sajta i login strane dodati i user i pass, u obliku : http://user:pass@www.someweb.com/private/mybox.html
Ovo uraditi za sve delove sajta koje HTTRack inače neće da skine!!!!!
Nema veze što su u pitanju delovi ISTOG sajta, imaju različite kolačiće!
g) Na kraju treba da se dobije :

Kako je gore opisano, HTTRack spušta sajt, i spusti oko 70%, i ne spusti sve. Pošto se sajt MNOGO grana, pokušala sam da stavim neka ograničenja :


Ako se ova podešavanja koriste količina podataka je MNOGO manja (bez je 8,45G sa je 333MB), ali se čini da su isti fajlovi pokupljeni.

Greške koje se mogu javiti u logu HTTrack-a :
a) Warning: File seems complete (same size), but there was a cache read error
b) Error: “Not Found” (404) at link https://…..
Pokušaj rešenja sa (tj slika dole) :
options -> Links -> Attempt to detect all links
options -> Links -> Get non-HTML

Na žalost ovo ne uklanja sve ovakve greške…..
Ali pošto je uzrok : Not found = bad links on the site i ne može 🙂
c) Warning: HTML file (9876 bytes) retransferred due to lack of cache
Ovo se izgubi ako se “otčekuje” opcija “Get HTML files first”
d) Error: Unexpected robots.txt error – ovo se izbegne tako što se isključi poštovanje robot.txt fajla (taj fajl se nalazi na sajtu i služi za određivanje načina pretrage sajta, i HTTrack ga po default-u poštuje) :

e) Error : “Error when decompressing”
f) Error : Unable to get server’s address
Ubaciti podatke o proxy serveru i njegovom portu, iako je (bar u mom slučaju) sajt potpuno lokalan (u unutrašnjoj mreži), čime se broj ovih grešaka dosta smanjuje.
g) Error “Forbidden” (403)
Ovo se može ukloniti ako se izmeni browser u “Set options”/Browser ID” (link) :

Ako se browser stavi na “None” “403” grešaka maltene više nema!!!!!
Druga mogućnost : changing “Browser ‘Identity'” from the default of “Mozilla/4.5 (compatible: HTTrack 3.0x; Windows 98)” to “Java1.1.4”. I chose the Java identity because it didn’t contain the substring “HTTrack”, which may have been the reason I was being blocked.
h) Error “Service unavailable (503)”
You are probably crashing the site.
Set it to one connection, one connections/sec, 5kb/s (smanjuje zagušenje pri download-u)
i) Warning: Unexpected 412/416 error (Requested Range Not Satisfiable)
Ovo je prouzrokovano izmenom/pomeranjem sajta.

Problem
Problem je to da i pored raznih podešavanja ostaje isti : HTTrack NE skida ceo sajt (proveravala sam i bez obzira na postavku isti delovi sajta su spušteni odnosno nisu spušteni).

3) Getleft
Vrlo malo opcija, javlja grešku “Unsupported protocol”
Odustajem od njega.

4) BimeSoft Surf Offline
Trebalo bi da radi sa sajtovima koji imaju user+pass.
Plaća se, pa sam odustala.

5) wget
Download wget for WIN10/64
Koristi se iz komandne linije (otvoriti cmd “As Administrator”).
Spušta se fajl sa imenom wgetforwin10.exe, i pod tim imenom se i poziva (bez ekstenzije, naravno).
Dobijanje help-a : wgetforwin10 -h
Ovo će izlistati sve opcije.
Ako se spušta spoljašnji sajt, prosleđuju se i podaci o proxy serveru (ako on postoji) :
wget -e http_proxy=http://proxy:port –recursive ime.sajta

Ovo je odlično skinulo sajt van lokalne mreže :
wgetforwin10.exe –recursive –mirror -e http_proxy=http://10.10.10.10:80 linuxkitchen.com

Za sajt u unutrašnjoj mreži, koji ima ne-root sertifikat i traži username+pass :
wgetforwin10.exe –no-parent –save-cookies=folder.za.download/kolacici.txt –keep-session-cookies –auth-no-challenge –user=velda –ask-password –convert-links -e robots=off –level=2 –output-file=folder.za.download/wget.txt -e http_proxy=http://10.10.10.10:80 –trust-server-names -p -U mozilla –no-check-certificate –recursive –mirror https://sajt.koji.skidam/projects/blabla/wiki
Ne prosleđujem direktno lozinku zbog bezbednosti, a i zato što je komanda ne prihvata zbog verzije HTTP-a.
Kolačići : zato što mi inače ne pravi index.html stranu nego login stranu, iako sam dala user+pass
Namerno sam usmerila stdout na log fajl, da mogu posle sve na miru da pogledam, a log fajl pratim iz PowerShell-a sa komadom :
Get-Content logfajl.log –Wait

Recursive Download – This means that Wget first downloads the requested document, then the documents linked from that document, then the documents linked by them, and so on. In other words, Wget first downloads the documents at depth 1, then those at depth 2, and so on until the specified maximum depth.

Šta znače svičevi :
–no-parent means don’t search parent directories
–random-wait to make sure you don’t get blacklisted from a site
-r recursively downloads
-e robots=off ignores robot.txt files
-U Mozilla makes the user look like its Mozilla I think
-E ili –adjust-extension
If a file of type application/xhtml+xml or text/html is downloaded
and the URL does not end with the regexp \.[Hh][Tt][Mm][Ll]?, this option
will cause the suffix .html to be appended to the local filename.
-k ili –convert-links
After the download is complete, convert the links in the document to
make them suitable for local viewing. This affects not only the visible
hyperlinks, but any part of the document that links to external content,
such as embedded images, links to style sheets, hyperlinks to non-
HTML content, etc.

*****

Dve zanimljive definicije :
Mirroring refers to downloading the entire contents of a website, or some prominent section(s) of it (including HTML, images, scripts, CSS stylesheets, etc). This is often done to preserve and expand access to a valuable (and often limited) internet resource, or to add additional fail-over redundancy.
Scraping refers to copying and extracting some interesting data from a website. Unlike mirroring, scraping targets a particular dataset rather than the entire contents of the site.

WIN 10 automatsko kopiranje fajla

Potrebno mi je da postavim automatsko kopiranje fajla koji se nalazi na NAS-u na moju lokalnu mašinu (kao vrsta backup-a).

Skripta
Prvo je potrebno napisati skriptu koja radi posao kopiranja, a onda koristimo WIN 10 scheduler da tu skriptu pozivamo kad nam zatreba.
Treba mi skripta za kopiranje fajla sa source lokacije A na destination lokaciju B, uz prepisivanje stare verzije fajla na lokaciji B.
Skript se može pisati u Power Shell-u (*.ps1) ili kao batch fajl (*.bat).
Ja ću ga napisati kao batch fajl.

Koristiti notapad ili notepad++ i sačuvati fajl sa nastavkom *.bat
Testirati fajl iz komandne linije : C:\PATH\TO\FOLDER\BATCH-NAME.bat

Evo moje skripte :
@echo off
robocopy “\\nas\folder1\folder2\folder3” “D:\Moja Dokumenta\folder1\folder2” “Test fajl A.txt”
exit /b

Evo kako izgleda kad se skripta pokreće testno iz komandne linije :

Paziti :
a) Ako u nazivima foldera ili fajla postiji blanko/razmak OBAVEZNO staviti dvostruke navodnike pre i posle (kako je i kod mene urađeno).
b) Takođe ovaj primer PREPISUJE destinacioni fajl sa source fajlom.
c) Posle poslednjeg foldera u source ili destination NE stavljati backslash

Postavljanje Task Sheduler-a
Using the “Windows Key“ + “R” to open run and type “taskschd.msc“. This will open Task Scheduler.

Napomena : OBAVEZNO kreirajte neki svoj folder u kom ćete držati svoje skripte!!!!!!
Under the actions panel, you can choose to create a back task or create a task. Click “Create Task“.

The “Create Task” screen will appear. Select the “General” tab
In the “Name” field, give the task a name. Example: “Outlook Task“.
In the “Description” field, here you can describe what the task is for and what it will do.
The last section is the “Security options“, here you can set who can run this task and if the task has admin right.

Select the “Actions” tab, then select “New“.
The “New Action” window will open.
In the “Action” drop down, “Start a program” is set by default. Change it if desired.
Select “Browse…” next to the “Program/script” field
Browse to the program you are wanting to schedule a task for.

Select “OK“.
Go to the “Conditions” tab.
You can change these if you’d like, but I recommend leaving these settings default.
Select the “Settings” tab. You can change these if you’d like, but I recommend leaving these alone.
Select “OK“.

Provera rada
Provera se vrši kroz logove (što je kod WIN 10 malo hmmmmm).
History za task postoji u samom Task Sheduler-u :

Dobar link1 za WIN 10 task sheduler.
Dobar link2 za batch fajl copy/paste.
Dobar link3 za robocopy opcije i primere

Excel problem – prikazuje formulu, ne rezultat

Kod mene je to da prikazuje pointer ka ćeliji u kojoj je vrednost koju treba da prikaže, a umesto toga u ćeliji piše “=AJ33”.
Napominjem da se ovo dešava samo za NEKE ćelije, ne za sve.

Šta može da se uradi :
1. Proveriti da u ćeliji nije slučajno neki blanko ” ” ili apostrof “‘”. U oba slučaja Excel sadržaj ćelije automatski prikazuje kao tekst.
2. Iako nema blanka ispred znaka jednakosti Excel formule, staviti kursor ISPRED “=” i lupiti jedan backspace (kao da je blanko tu). Ume da pomogne
3. Proveriti da nije ćelija stavljena na “Text”. Postaviti tip ćelije na “General”, ući sa F2 u ćeliju (OBAVEZNO!) i pritisnuti “Enter”

Dobar link

Podaci o članovima domena

Kompjuter sa kog se ovo radi MORA biti u domenu, a korisnik koji je logovan mora imati makar READ prava nad domenom.

1. U polje “Start a search” ukucati “Admistrative tools”

2. Kliknemo na to i dobijamo :

3. Nas interesuje stavka “Active Directory Users and Computers” :

4. Za pretragu se uradi desni klik nad imenom domena, i odabere opcija “Find”

WIN prava nad folderima

Kako videti prava nad folderima, osim klasičnim metodom : desni klik na folder/Properties/Security?
Ovo nije baš uvek zgodno, jer je prozor mali i ne vidi se sve niti lepo niti sve odjednom.

Mnogo je lakše to gledati kroz komandnu liniju :
C:\Users\velda>icacls \\folder1\folder2\folder3
\\folder1\folder2\folder3 domen1\korisnik1:(OI)(CI)(RX)
domen1\korisnik2:(OI)(CI)(F)
domen1\korisnik3:(OI)(CI)(RX)
domen1\grupa1:(OI)(CI)(RX)
domen1\grupa2:(OI)(CI)(F)
Successfully processed 1 files; Failed processing 0 files

Evo značenja gornjih oznaka :
iCACLS inheritance settings :
(OI) — object inherit, this ACE will be inherited by objects placed in this container.
(CI) — container inherit, this ACE will be inherited by subcontainers placed in this container
(IO)  —  inherit only;
(NP)  —  don’t propagate inherit, this ACE will be inherited by objects and subcontainers one level deep – it will not apply to things inside subcontainers.
(I)  — permission inherited from the parent container, this ACE was inherited from the parent container.
ACE – access control entries

List of basic access permissions :
D  —  delete access;
F  —  full access;
N  —  no access;
M  —  modify access, user has the right to write and modify file system objects in this directory
RX  —  read and eXecute access;
R  —  read-only access;
W  —  write-only access

Detailed permissions :
DE  —  delete;
RC  —  read control;
WDAC  —  write DAC;
WO  — write owner;
S  —  synchronize;
AS  —  access system security;
MA  —  the maximum allowed permissions;
GR  —  generic read;
GW  —  generic write;
GE  —  generic execute;
GA  —  generic all;
RD  —  read data/list directory;
WD  —  write data/add file;
AD  — append data/add subdirectory;
REA  —  read extended attributes;
WEA  —  write extended attributes;
X  —  execute/traverse;
DC  —  delete child;
RA  —  read attributes;
WA  —  write attributes.

Dobri sajtovi : link1, link2

NTFS fajl sistem i WIN 10
Ili ono što se vidi kad se na folder klikne desni klik/Properties/Security :

Full control: Allows users to read, write, change, and delete files and subfolders. In addition, users can change permissions settings for all files and subdirectories.
Modify: Allows users to read and write of files and subfolders; also allows deletion of the folder.
Read & execute: Allows users to view and run executable files, including scripts.
List folder contents: Permits viewing and listing of files and subfolders as well as executing of files; inherited by folders only.
Read: Allows users to view the folder and subfolder contents.
Write: Allows users to add files and subfolders, allows you to write to a file.

WORD problem pri otvaranju fajla : “word file is corrupted and cannot be opened”

Evo šta se može probati :

Method 1 Try another app
Try to open your text file in Notepad or Wordpad.
You can also open the file in alternative programs : OpenOffice, LibreOffice or something else.

Metod 2 : probati da se dokument otvori uz opciju “Open and Repair”

Method 3: Changing the ‘Trust Center’ setting: The enabled protected view setting under ‘Trust Center’ prevents the Word file from opening. Follow the below mentioned steps:

Open your MS Word application -> Click on File and Option -> Select the ‘Trust Center’ and hit button under ‘Trust Center Settings’ -> Click on Protected View and uncheck all options available under this option and press ‘OK’ to confirm -> Restart MS Word and try to open your corrupt Word file.

Method 4: Manual Setting of ‘Component Security’: To change these setting to default setting, following steps are used:

Go to ‘Start’ and in search box, type as ‘dcomcnfg’. Then select ‘dcomcnfg’ from the program list
Go to navigation pane and expand the ‘Component Services’
Now right click on ‘My Computer’ and then click ‘Properties’
Open ‘Default Properties’ tab and set the following values, Default Authentication Level: Connect, Default Impersonation Level: Identify
Then, hit ‘OK’

Ako ništa od ovoga ne pomogne (a meni nije), probati : Yodot DOC Repair tool
Ovaj alat se NARAVNO plaća, ali ako vam treba za 1 doc fajl onda može da posluži i trial verzija.
Ovako izgleda kad javlja da je popravljen fajl :

Na žalost meni ni to nije pomoglo 🙁

DiskInternals Word recovery opet može samo trial verzija, ali on skenira ceo disk!!! Umesto da ga uperimo na jedan fajl 🙁

Kernel for Word Repair opet koristimo trial verziju. Dobro je to što se odabira željeni fajl, i sređenu verziju stavlja na odabrano mesto. Loše je to što mi nije spasao podatke.

Odličan link1 i još jedan link2