This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for user in `cat ~/.my-users-to-add | grep -v "#"`; do | |
echo "Adding user [$user] ..." | |
if id -u "$user" >/dev/null 2>&1; then | |
echo "User $user exists" | |
else | |
useradd --shell /bin/bash -m $user | |
echo $user:$user | chpasswd | |
chmod ugo-rwx,ug+rwX /home/$user | |
chmod g+s /home/$user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" [db-name]` ; do | |
psql -c "alter table $tbl owner to \"[db-user]\"" [db-name] ; | |
done | |
for tbl in `psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" [db-name]` ; do | |
psql -c "alter table \"$tbl\" owner to \"[db-user]\"" [db-name] ; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
for project in `ls -d */`; do | |
cd ./$project | |
if git s &>/dev/null; then | |
pwd | |
git s 2>/dev/null | |
git f 2>/dev/null | |
fi | |
cd .. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
set -x | |
for package in $(sudo npm -g outdated --parseable --depth=0 | cut -d: -f4) | |
do | |
sudo npm -g install "$package" | |
done |