Skip to content

Instantly share code, notes, and snippets.

View andreibosco's full-sized avatar

Andrei Bosco B. Torres andreibosco

View GitHub Profile
@andreibosco
andreibosco / gist:8701532
Created January 30, 2014 02:28
Raspberry boot info
#!/bin/bash
IP_LOCAL=`hostname -i`
IP_EXTERNAL=`curl -s icanhazip.com`
HD_FREE=`df -Ph . | tail -1 | awk '{print $4}'`
OUTPUT=/tmp/rpi-info
rm /tmp/rpi-info
echo -e `date`'\n' >> $OUTPUT
echo -e "IP Local: $IP_LOCAL" >> $OUTPUT
echo -e "IP Externo: $IP_EXTERNAL\n" >> $OUTPUT
echo -e "Espaco disponivel: $HD_FREE" >> $OUTPUT
@andreibosco
andreibosco / gist:9745431
Last active August 29, 2015 13:57
Find all files containg text string - Linux

Fonte: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx

  • Convert the .iso file to .img using the convert option of hdiutil: hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso
  • Run diskutil list to get the current list of devices.
  • Insert your flash media.
  • Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2).
  • Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2).
  • Execute sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.imgor ./ubuntu.dmg).
    • Using /dev/rdisk instead of /dev/disk may be faster
  • Run diskutil eject /dev/diskN and remove your flash media when the command completes
@andreibosco
andreibosco / gist:11214628
Last active August 29, 2015 14:00
EDX: instalação e configuração no Ubuntu 14.04

Configurando sistema

Atualizar pacotes

sudo apt-get update -y
sudo apt-get upgrade -y
reboot

Instalar dependências

@andreibosco
andreibosco / edx.conf
Last active August 29, 2015 14:00
EDX - Supervisor: edx.conf
; EDX (lms e cms)
[program:lms]
command = /home/azureuser/apps/edx/bin/gunicorn_lms.sh
user = azureuser
stdout_logfile = /home/azureuser/apps/edx/log/gunicorn_lms_supervisor.log
redirect_stderr = true
[program:cms]
@andreibosco
andreibosco / gunicorn_cms.sh
Last active August 29, 2015 14:00
EDX - Supervisor: gunicorn_cms.sh
#!/bin/bash
NAME="EDX-CMS" # Name of the application
USER=azureuser # the user to run as
GROUP=azureuser # the group to run as
DJANGODIR=/home/${USER}/apps/edx/edx-platform # Django project directory
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=cms.envs.dev # which settings file should Django use
DJANGO_WSGI_MODULE=cms.wsgi # WSGI module name
@andreibosco
andreibosco / gunicorn_lms.sh
Created April 28, 2014 16:27
EDX - Supervisor: gunicorn_lms.sh
#!/bin/bash
NAME="EDX-LMS" # Name of the application
USER=azureuser # the user to run as
GROUP=azureuser # the group to run as
DJANGODIR=/home/${USER}/apps/edx/edx-platform # Django project directory
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=lms.envs.dev # which settings file should Django use
DJANGO_WSGI_MODULE=lms.wsgi # WSGI module name
@andreibosco
andreibosco / edx.conf
Last active August 29, 2015 14:00
EDX - nginx
# EDX LMS
server {
listen 80;
server_name edx-api.cloudapp.net;
#autoindex on;
#autoindex_exact_size off;
gzip on;
@andreibosco
andreibosco / private.py
Created May 2, 2014 16:48
EDX - configurações CMS: cms/envs/private.py
from .dev import *
DEBUG = False
USE_I18N = True
LANGUAGES = (('pt_BR', 'Portuguese'), )
LANGUAGE_CODE = 'pt_BR'
TIME_ZONE = 'UTC'
@andreibosco
andreibosco / private.py
Created May 2, 2014 16:50
EDX - configurações LMS: lms/envs/private.py
from .dev import *
DEBUG = False
USE_I18N = True
LANGUAGES = (('pt_BR', 'Portuguese'), )
LANGUAGE_CODE = 'pt_BR'
TIME_ZONE = 'UTC'