Linux - Force User To Change Password

It's useful to be able to force users to change their passwords the next time they log in. To do so, simply enter the following command:

sudo chage -d 0 [user-name]
For example
sudo chage -d 0 programster
The change command is for changing the user password expiry information with -d 0 specifying the number of days since January 1st, 1970 when the password was last changed.

Set Password To Expire in X days

If want to password to expire in x days instead (and force the user to change the password every x days afterwards) simply run the following command:

sudo chage -M [number of days] [username]
e.g.
sudo chage -M 30 programster

Disabling Password Expirey

If people complain about having to change their passwords, one can disable this feature with the following command

sudo chage -m 0 -M 99999 -I -1 -E -1 [username]
  • -m 0 will set the minimum number of days between password change to 0
  • -M 99999 will set the maximum number of days between password change to 99999
  • -I -1 (number minus one) will set the “Password inactive” to never
  • -E -1 (number minus one) will set “Account expires” to never.

References

Ubuntu - No Wifi Fix

Today I moved my desktop computer's SSD into a laptop. This resulted in ubuntu booting up normally, but I didn't have any wifi access. My desktop computer does not have a wifi device, so it was never configured to do so. Also, I know that I manually set a lot of network configurations for static IPs and bridges, that were no longer applicable and were probably interfering. Here are the steps I took to resolve the issue.

Wifi Blocking/Disabled

Most laptops have the ability to disable/enable your Wifi through a keyboard shortcut or a physical switch. Run the command below to check whether your wifi device has been disabled in such a way.

rfkill list

If everything is fine, you should see output similar to below

0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no

Network Configuration

Update your

/etc/network/interfaces
file so that the only lines that are not commented out are as follows:
auto lo
iface lo inet loopback

Managed Network Manager

In

/etc/NetworkManager/nm-system-settings.conf
, change
managed=false
to
managed=true
.

Restart

After running all the previous steps, restart the computer and your wifi should start working with the network manager appearing in the system tray.

References

Install MySQL 5.6 On Debian 7.7

MySQL 5.6 promises some performance increases over version 5.5, but in my experience, requires at least 1GB of RAM to run comfortably, unlike 5.5 which would run well on a 512MB RAM VPS. Execute the following script to install the server.

You may want to check here to see if 0.3.2-1 is the latest version of the mysql-apt-config
#!/bin/bash
cd /tmp

# Confirm the version at http://dev.mysql.com/downloads/repo/apt/
wget -O mysql-apt-config.deb http://dev.mysql.com/get/mysql-apt-config_0.3.2-1debian7_all.deb

sudo dpkg -i mysql-apt-config.deb

# At the popup-page, select "Apply"

# Install mysql-server package
sudo apt-get update
sudo apt-get install mysql-server-5.6 -y

References