Category Archives: Technology

Execute MySql script from the command line

This tip is very similar to how to “Execute a SQL file via the MySQL command line in one line” only this time specifying the DB you want to execute the script against and being prompted for your password…

mysql -u user -p -h localhost MyDb < ~/SQL/script.sql
Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

Using sed to view and replace text on a specific file in Linux

Ever need to replace very specific text on a particular line in a very large file on Linux? Enter the sed command.

To view the line (let’s say line 864 in this case) in the specific file, issue this command…

$ sed -n '864'p myfile.txt

And let’s say you get back the string ” I hate cheese”. Since we all know that’s not true, you can use a different variation of the sed command to replace “hate” with “love” like so…

$ sed -i '864s/hate/love/' myfile.txt

And if you’re really curious on how this even came about, it was due to an error in the phpMyAdmin export.php script when you had to change “break 2” to “break” on line 846 as identified here: https://askubuntu.com/questions/928883/500-error-on-phpmyadmin-export-on-phpmyadmin-export-php/930975

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

Scary Chip Flaws Raise Spectre of Meltdown — Krebs on Security

Please be sure to update/patch every device you have. On most Windows machines, you should be able to do a manual reboot (Start -> Power -> Restart) and have the updates applied. On iOS you want to go to Settings -> General -> Software Update

Scary Chip Flaws Raise Spectre of Meltdown — Krebs on Security

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

The Most Dangerous Thing You Can Do While “Multitasking”

So true. Please enable “DND while driving” on your phone! Both the iPhone and Android have the feature. I’ve been using it since I updated to iOS 11, and it works well. Just getting the notifications I found was a distraction, and since I can still get calls from my “favorites” it’s been a huge help.

OPTIMIZE with Brian Johnson | More Wisdom in Less Time: +1 #52: The Most Dangerous Thing You Can Do While “Multitasking”

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

Billionaire ex-Facebook president Sean Parker unloads on Mark Zuckerberg and admits he helped build a monster

Yes, I realize the irony of posting this to FB, but it will also be on my blog which is where I’d like to see a lot of what goes on SM now distributed to.
Billionaire ex-Facebook president Sean Parker unloads on Mark Zuckerberg and admits he helped build a monster

You can find all my shares on my Facebook Page

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

This Week in Tech 639 Anywhere but Albany

Good discussion on Facebook and Twitter in This Week in Tech (TWiT 639: Anywhere but Albany):
This Week in Tech 639 Anywhere but Albany | TWiT.TV

You can find all my shares on my Facebook Page

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

What intelligent machines can learn from a school of fish

Wow!

What intelligent machines can learn from a school of fish

You can find all my shares on my Facebook Page

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

10 Unusual Things I Learned From Mr. X – Altucher Confidential

Ep. 265 – 10 Unusual Things I Learned From Mr. X – Altucher Confidential

You can find all my shares on my Facebook Page

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

Linux Startup Email

Want to receive an email any time your linux server reboots? Just create this script…

sudo nano /usr/local/sbin/startupemail.sh

Here’s the code for the script…

#!/bin/sh

# Lets things startup
sleep 60

# Get info
IP="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
HOSTNAME=`hostname`

#Send email
echo "IP: $IP, Host: $HOSTNAME" | mail -s "Server Started" [email protected]

Make sure to make it executable…

sudo chmod u+x /usr/local/sbin/startupemail.sh

Then add it to your /etc/rc.local file

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...

Find the Members of an Active Directory Group

The simplest way to get the list of users in an Active Directory group is to use the following command right from the command line:

NET GROUP "my_group" /DOMAIN

And yes, that is the work “DOMAIN”, not the domain you are in. The only value to change in the command is my_group

Ref: Is there a way to view the members of an Active Directory group if you aren’t a domain admin and can’t log into a domain controller?

Please remember to subscribe to the newsletter to stay up to date!

You or someone you know looking to buy or sell?
Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I don't link to anything I don't use myself. You would think this should be self evident these days, but apparently not...