Technology

Start/Stop VPN connection automated in a .CMD file

I am pretty proud of this script, as it does what is otherwise a bit fiddly -- and it took some fairly in depth research to come up with a solution that uses only what is provided out of the box with Windows 10. My only issue that remains with it is that I had to include the username & password - I would like to find a way to have it use the existing credentials in the VPN configuration. (Let me know if you have any bright ideas!!)

I used clues from a lot of places to do this, but the clever logic that allows me to do the conditional code step that you see here:

PhpMyAdmin error message when the script has not been run during install...

I see this fairly often when I have done fast installs of ubuntu:
"Connection for controluser as defined in your configuration failed."

What happens is I ignore the install script that needs to run for PhpMyAdmin to establish its database etc.
Happily the fix is fairly easy - just run the script again now:
sudo dpkg-reconfigure phpmyadmin

Google I/O 2014 releases...

Polymer looks like it may be very cool -
https://www.youtube.com/watch?v=yRbOSdAe_JU

scripted (bash) password changes for Samba users...

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)

bash history date/time stamps

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 "

Extract IP Addresses from a text file...

This is a cool little grep search to pull any IPs from a text file:
grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' file_with_ips_in_it.txt | sort | uniq

Drupal's magical "DRUSH" CLI

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:

sudo drush @veo up

And here's what it did for me:


donmc@jbt:/var/www/VEOffice$ sudo drush @veo up
Update information last refreshed: Sat, 04/28/2012 - 16:25

Update status information on all installed and enabled Drupal projects:

Security+ Certified !

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.

Topic: 

Windows Server Login Script example

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.")

Great Visio Resource

Greg Ferro has great ideas for representation of complex VLAN & routing layouts in Visio:
http://etherealmind.com/category/network-diagrams/

Pages

Subscribe to RSS - Technology