Reset MySQL Password

I setup a LAMP server for a developer a while back and he changed the passwords for root and the root mysql user to something besides my defaults. So when he asked me to give him the password for the database, I could not really help him out. Or could I?

Stop the mysql services:
/etc/init.d/mysql stop

Start mysql without the passwords:
mysqld_safe --skip-grant-tables &

Connect to the safe mysql:
mysql -u root

Set a new root password:
use mysql;
update user set password=PASSWORD("your_New_Password_here") where User='root';
flush privileges;
quit

Stop the safe mysql database:
/etc/init.d/mysql stop

Start mysql and test:
/etc/init.d/mysql start
mysql -u root -pYOURNEWPASSWORDHERE

*note – there is no space between -p and your password.

AND, in case you’re just wanting to change the password of a known user:
mysqladmin -u root -pOLDPASSWORD password NEWPASSWORD

Mount NFS on Ubuntu

Basic LAMP Ubuntu 10.04.2 LTS trying to mount NFS share from a FreeNAS 0.7.2 system. I was running the following command:

mount -t nfs 10.10.0.99:/mnt/hotswap/NFS/ /mnt/freenas/

and receiving the following error

mount: wrong fs type, bad option, bad superblock on 10.10.0.99:/mnt/hotswap/NFS/,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount. helper program)
In some cases useful info is found in syslog – try
dmesg | tail or so

Awesome. So I tried with the -o ‘vers=3’ command just in case. Same issues persist.

It looks like the common NFS files are missing in the vanilla ubuntu server installation:
apt-get install nfs-common
Rerun the mount command is successful

And, since I like to create NFS on ubuntu as well:
apt-get install nfs-kernel-server
nano /etc/exports
Add:
/path/to/share Hostname(rw,sync,no_root_squash)
or in my case
/NFS *(rw,sync,no_root_squash)
Then restart nfs
/etc/init.d/nfs-kernel-server restart

iFolder

I was tasked with removing access to dropbox, but also with creating an internally-hosted dropbox-like solution. This is about as creative as I could get as most of the users were on Windows, with another handful of developers using their Macs:
iFolder 3.8.x

Installed Ubuntu 10.04.2 LTS x32
LAMP, MySQL, Mail Server

Change the password for the root user
sudo passwd root

Log in as root
su

Add the PPA repositories to your system
nano /etc/apt/sources.list
Add the following lines at the bottom of the file:

deb http://ppa.launchpad.net/marceloshima/ifolder/ubuntu lucid main
deb-src http://ppa.launchpad.net/marceloshima/ifolder/ubuntu lucid main

Save and Close
Add the signing of the packages
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ED649F97DE6BFD99
Test configuration
apt-get update

Install ifolder3-enterprise
apache2ctl stop
apt-get install ifolder3-enterprise

Create the self-signed cert/Allow Apache features
make-ssl-cert generate-default-snakeoil
a2enmod ssl
a2enmod rewrite

Link the conf files
ln -sf /etc/ifolder-server/apache/ifolder_apache.conf /etc/apache2/conf.d/
a2ensite default-ssl

Install .net files
apt-get install liblog4net1.2-cil
apache2ctl restart

Test by navigating to http://IPADDRESS/admin
You must create a user before you can use http://IPADDRESS/ifolder or the locally installed applications.

To change any configuration, just run either of these commands:
ifolder-admin-setup
ifolder-web-setup

Molly-Guard

After having someone reboot the wrong linux machine (again), we decided to take some action:

apt-get install molly-guard

This works on Debian/Ubuntu systems. After install, try running reboot or shutdown commands – the molly-guard will force you to type in the name of the system you’re trying to reboot/power off before it will actually allow the command to continue.

Cannot Mount New Database Exchange 2010

I had created a new Exchange infrastructure for a customer:
2x Mailbox Role servers, each will have 4x 40GB databases
1x CAS and Hub role server
OK, so it sounded more impressive before I typed it out, but I digress…

I created a new database and attempted to mount it and received some cryptic MAPI error. Googled it:
http://support.microsoft.com/kb/977960

Basically AD isn’t replicating fast enough when you have multiple domains in the same forest.
Fix:
Open Exchange PowerShell
Set-ADServerSettings -PreferredServer FQDN.of.your.primary.global.catalog

Console Performance Windows VMWare

I had been installing plenty of Windows Server 2008/R2 servers on the VMWare infrastructure as of late. The only issue I could find was after installation – the console connection would drag. It seemed like the server was very slow at responding. RDP into the server and blamo, everything slow about the console went away. I didn’t really think much of it until a fellow IT worker (Bib) brought it up after his first time using ESXi. Apparently it all comes down to a driver that doesn’t get installed by default.

ESXi 4.1 patched through April 2011 (two outstanding updates slated for install next month)
Windows Server 2008 R2 as a test
VM Tools fully up to date
Windows Updates fully patched

Here’s the fix:
Open Device Manager
Expand Display adapters – you should see Standard VGA Graphics Adapter
Right-click on this and choose Update Driver
Select Browse my computer for driver software
Browse to C:\Program Files\Common Files\VMware\Drivers\wddm_video
Finish the wizard, then reboot the guest

Next time you’re in the console you should see VMware SVGA 3D driver listed for the display adapter. And you’ll notice the system seems a lot more peppy.

Software I Use – May 2011 Edition

I was trying to come up with a list of software that I “must have” on a new system (links to come hopefully later):

Dual boot Windows 7 x64 Pro/Ent/Ultimate with Ubuntu 11.04 x32
Inssider – Great for finding SSIDs, models of access points, security information, and channels of wireless networks
Angry IP Scanner – My favorite IP scanning utility is great for finding open web servers, DNS servers, or anything with RDP open
Putty – Terminal emulation software
FireFox – I still enjoy this more than Chrome, but they both have their place. Include Adblock Plus, Web Developer, NoScript, and GreaseMonkey with Youtube Auto Buffer and experts-Exchange
Terminals – My favorite RDP saving utility
CDBurnerXP – Burns ISOs, music, data
ISORecorder – Creates ISOs from folders or drives
CPUID’s CPU-Z and HWMonitor – Monitoring hardware in your system
NMAP-Zenmap GUI – NMAP for windows
WinSCP – SCP client for windows
Notepad++
NetIQ ADCheck
Filerfrog
TheDude
TightVNC
ThreatFire
Secunia PSI
Nod32
Filezilla

Ramblings Of An IT Person