This file contains 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
su - postgres | |
pg_dump -f /tmp/dump_name.sql -U postgres current_database_name | |
psql -f /tmp/dump_name.sql new_database_name |
This file contains 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
[nginx] | |
name=nginx repo | |
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ | |
gpgcheck=0 | |
enabled=1 |
This file contains 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
# -u <username> : defines with what user id arpwatch should run | |
# -e <email> : the <email> where to send the reports | |
# -s <from> : the <from>-address | |
# -i <interface> : override the default network interface | |
OPTIONS="-u arpwatch -e wsilva -s 'root (Arpwatch)' -i wlp3s0" |
This file contains 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
# Create an alias for the command (an abbreviation) | |
alias cls='echo -en "\ec"' | |
# Usage: | |
cls |
This file contains 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
# TODO: Use variables for the versions | |
# TODO: Accept command-line arguments and install everything | |
# Install Ruby | |
cd /tmp | |
wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz | |
tar xvzf ruby-2.1.2.tar.gz | |
cd ruby-2.1.2 | |
./configure --prefix=/usr |
This file contains 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
# Sets the timezone to Europe/Lisbon | |
sudo mv /etc/localtime /etc/localtime.bak | |
sudo ln -s /usr/share/zoneinfo/Europe/Lisbon /etc/localtime |
This file contains 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
http://www.lbc.co.uk/ | |
both - beuth | |
talking - toukin | |
naughty - nouty | |
no - neu | |
so - seu | |
you - yeu | |
cant - cânt | |
daughter - douter |
This file contains 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
while read oldrev newrev ref | |
do | |
branch=`echo $ref | cut -d/ -f3` | |
if [ "production" == "$branch" -o "master" == "$branch" ]; then | |
git --work-tree=/var/www/tracker/production/ checkout -f $branch | |
cd /var/www/tracker/production/ | |
# Install any packages, if needed | |
npm install | |
# Restart the application. Note: the application uid should be 'app' |
This file contains 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
bundle exec rails g migration AddUserRefToProducts user:references | |
# Generates | |
class AddUserRefToProducts < ActiveRecord::Migration | |
def change | |
add_reference :products, :user, index: true | |
end | |
end |
This file contains 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
sudo tail -f /proc/<pid>/fd/1 | |
example: sudo tail -f /proc/2394/fd/1 |
OlderNewer