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
Refinery CMS: | |
Caching images generated by Dragonfly with Nginx cache_proxy instead of Rack:Cache | |
Before: | |
Static image served by Nginx: 4409.40 req/sec (mean) | |
Dragonfly generated images from Rack:Cache: 286.66 req/sec (mean) | |
After: | |
Dragonfly generated images from Nginx proxy_cache: 4099 req/sec (mean) |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
server { | |
listen 80; | |
server_name almirmendes.com www.almirmendes.com; | |
# Este é o path onde está hospedada sua aplicação Rails, ele pode ficar onde você quiser, entretanto | |
# é comum coloca-los em uma pasta na home de algum usuário ou mesmo em /var/www/. Independente disto | |
# o que é necessário aqui é que você adicione o path da pasta public de sua aplicação Rails. | |
# Importantíssimo, se você utiliza o Capistrano para fazer deploy de sua aplicação, lembre-se de adicionar | |
# o current antes do public | |
root /home/m3nd3s/almirmendes.com/public; |
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
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 512; | |
multi_accept on; | |
} | |
http { |
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
# Cria, ou trunca, o arquivo LISTA.TXT com o conteúdo do path ~/ | |
ls -la ~/ > LISTA.TXT | |
# Inicializa o ambiente gráfico e apenda os erros para o arquivo ERROS-XORG | |
startx 2> ERROS-XORG | |
# Lista os arquivos em /dev redirecionando para a | |
# entrada do comando grep, que filtra o conteúdo passado | |
ls -la /dev/ | grep “^b” |
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
#!/bin/sh | |
# | |
# Script that demos, command line args | |
# | |
echo "Total number of command line argument are $#" | |
echo "$0 is script name" | |
echo "$1 is first argument" | |
echo "$2 is second argument" | |
echo "All of them are :- $* or $@" |
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
$cat > nt1 | |
#!/bin/sh | |
# | |
#Script to test while statement | |
# | |
# | |
if [ $# -eq 0 ] | |
then | |
echo "Error - Number missing form command line argument" | |
echo "Syntax : $0 number" |
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 [ condition ] | |
do | |
command1 | |
command2 | |
command3 | |
done |
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
for FILE in *; do mv $FILE $FILE.old; done | |
for FILE in *.wav; do play $FILE; done | |
LISTA=“1 banana carlos 4 0011” | |
for N in $LISTA; do echo “>$N<”; done | |
>1< | |
>banana< | |
>carlos< | |
>4< |
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
for { variable name } in { list } | |
do | |
#comandos | |
done |