Skip to content

Instantly share code, notes, and snippets.

View luisfmelo's full-sized avatar
🇵🇹

Luís Melo luisfmelo

🇵🇹
View GitHub Profile
######################################################################################################################
## IMPORTANT NOTES: ##
## * Every time we want to read/write some file, we should do (example): ##
## - os.path.join(BASE_DIR, 'async/schemas/schema_for_post.json' ##
######################################################################################################################
# Create new AWS server and log through SSH :D
# Update the system
sudo apt-get update
>> globally install uwsgi and nginx
sudo pip3 install uwsgi
sudo apt-get install nginx
>> move to django project dir and create config files
cd django_project
sudo nano uwsgi_params
>> file contents
uwsgi_param QUERY_STRING $query_string;
uwsgi_param REQUEST_METHOD $request_method;
uwsgi_param CONTENT_TYPE $content_type;
@luisfmelo
luisfmelo / script.sh
Last active June 7, 2018 08:51
What to do after installing Ubuntu 18.04
# 1. Install basic apps
# - Google Chrome
# - Spotify
# - Skype
# - Slack
# 2. Add more software sources
# - Go to Software Updater
# - Enable all except source code
# - Change server to main server
  • Implement CI/CD pipelines
    • Gitlab CI
      • Use Runners
    • Github
      • Use TravisCI or others
    • Necessary stages
      • Build Code
      • Run Tests
        • Code quality
  • Unit testing
alias ctrlc='xclip -selection clipboard -i'
alias ctrlv='xclip -selection clipboard -o'
import boto
from datetime import datetime
s3 = boto.connect_s3()
def aws_read_file(bucket_name, file_path):
bucket = s3.get_bucket(bucket_name)
file = bucket.get_key(file_path)
if file is None:
cd my/favorite/folder/for/storing/projects
git clone https://github.com/scotch-io/scotch-box my-new-laravel-project
cd my-new-laravel-project
vagrant up
vagrant ssh
cd /var/www
laravel new project # Patience, let it download and do its thing...
rm -rf README.md .gitignore public/ # Removing conflicting files
mv project/* project/.[^.]* . # Put Laravel files in right spot
rm -rf project # All done
# In order to add some repo that not exist at Bower... to Bower
bower register custom-name git://github.com/gitowner/custom-name.git
bower install custom-name
# Example:
bower register weather-icons git://github.com/erikflowers/weather-icons.git`
bower install weather-icons