Technology

By donmc, 27 June, 2014

I was excited to find this, so I am saving it here.

To change an smb passwd in a bash script:

echo -e "newpasswd\nnewpasswd" | (smbpasswd -s username)

And note the "\n" in there to push a newline between the two passwords...

For the unix (Linux) username:

echo -e "newpass\nnewpass" | (passwd --stdin username)

By admin, 8 January, 2013

By default, the bash history does not keep tabs on the time of day that a given command was run. But it is really as simple as defining ONE environment variable: "HISTTIMEFORMAT"

This from "Linux by Example": HISTTIMEFORMAT takes format string of strftime. Check out the strftime manual to choose and construct the timestamp that suit your taste. My favorite is "%F %T ".

export HISTTIMEFORMAT="%F %T "

By donmc, 28 April, 2012

I have just spent a few hours getting familiar with this cool tool. Drush allows most housekeeping for Drupal sites to be done from a command line - it's a wonderful thing. Just take a look at how much I got done executing this single command:

By donmc, 14 April, 2012
Topic

I finally sat the Security+ Cert exam from CompTIA last month. Passed it, but it is definitely not an easy exam - they require memorization of lots of niggly little things that really do nothing to ensure that you really know about Securty. it's more about knowing the names of certain exploits, viruses, etc.

By donmc, 20 March, 2012

Found here:
\\domain.local\sysvol\domain.local\Policies\foldername\USER\Scripts\Logon

Login Script example:

Dim WSHELL, SETNETTIME
CONST DOMAINNAME = "myDomain"

Set WSHELL = Wscript.CreateObject("Wscript.Shell")

SETNETTIME = "net time /DOMAIN:" & DOMAINNAME & "/set /y"
'wscript.echo("Syncing workstation time with server time!")

WSHELL.run(SETNETTIME)
wscript.echo("Time has been Set." & vbCrLf & "Other Scripts disabled.")