Categories
Openbsd

wget through proxy tutorial

Ok so I had an issue using wget from the cmd line on my linux box, so here is how to get a proxy to work with wget:

First off export a variable called "http_proxy":

export http_proxy=192.168.1.2

This will try to get to your proxy via port 80, you could also specify like this(if you are on another port):

export http_proxy=192.168.1.2:8080

Then connect specifying your auth creds if you need to pass any:

wget –proxy-user=myusername –proxy-password=mypassword http://www.myserver.com/download/strace-4.5.15-1.el5.x86_64.rpm

 

And you should be good to go!

Categories
Windows

Convert accountExpires attribute in AD to date

If you’ve ever exported the accountExpires attribute from AD you’ll notice that it’s an 64-bit number. It represents the number of 100-nanosecond intervals since 12:00 AM January 1, 1601 in UTC. What this means is that it’s practically impossible to read unless your a math genius. 😉

Here is a quick VBS script that will take that number and convert it to a real date:

Dim WshShell, oExec, objArgs, exe, work
Set WshShell = CreateObject("WScript.Shell")
Set objArgs = Wscript.Arguments
if objArgs.count = 0 Then
Wscript.Echo "FileTime argument required"
Wscript.Quit
end If
exe = "w32tm.exe /ntte " & objArgs(0)
set oExec = WshShell.Exec(exe)
Do While oExec.Status = 0
WScript.Sleep 100
Loop
work = Split(oExec.StdOut.Read(60))
Wscript.Echo work(3) & " " & work(4)

Just copy and paste this into notepad and save as finddate.vbs. Then just run "finddate.vbs <accountExpires value>"

Finddate.vbs 128674944000000000

Would result in this pop up:

date.jpg