Skip to content

Instantly share code, notes, and snippets.

View craigpalermo's full-sized avatar

Craig Palermo craigpalermo

View GitHub Profile
@craigpalermo
craigpalermo / create_users.sh
Last active August 29, 2015 14:01
Create an account for each user listed in the external file
#!/bin/sh
# Example:
# sh create_users.sh file_with_usernames.txt
if [ -z "$1"] # check if filename is given
then
echo "No input filename given, exiting."
else
while read NAME; do
@craigpalermo
craigpalermo / create_home_folders.sh
Created April 24, 2014 18:51
Create home folders for existing Linux users
#grab regular users with user id above 500 from /etc/passwd
awk -F: '$3 > 499' /etc/passwd > uid500+.txt
#extract username, create home directory, and apply home directory to user
for users in `awk -F: '{print $1}' uid500+.txt`
do
mkdir /home/$users
usermod -d /home/$users $users
chown $users:$users /home/$users
done
@craigpalermo
craigpalermo / ssl_upgrade.sh
Last active August 29, 2015 13:58
Upgrade OpenSSL to 1.0.1g
cd /usr/src
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
tar -zxf openssl-1.0.1g.tar.gz
cd openssl-1.0.1g
./config
make
make test
make install
cd /usr/src
rm -rf openssl-1.0.1g.tar.gz