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
RewriteCond %{HTTP_HOST} ^example\.com$ [NC] # Here goes the regex to match the domain that will be redirected | |
RewriteCond %{HTTP_HOST} ^(www\.)?example\.net$ [NC] # Create a new condition for every domain, if possible | |
RewriteRule ^(.*)$ http://www.example.it/$1 [R=301,NC,L] | |
# Force redirect to www | |
RewriteCond %{HTTP_HOST} ^example\.com$ | |
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,NC,L] | |
</IfModule> |
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
<IfModule mod_rewrite.c> | |
# Redirect to another domain | |
RewriteCond %{HTTP_HOST} ^example\.com$ [NC] # Here goes the regex to match the domain that will be redirected | |
RewriteCond %{HTTP_HOST} ^(www\.)?example\.net$ [NC] # Create a new condition for every domain, if possible | |
RewriteRule ^(.*)$ http://www.example.it/$1 [R=301,NC,L] | |
# Force redirect to www | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\. |
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
@mixin test-img-alt { | |
img { | |
border: 2px dotted red; | |
} | |
img[alt] { | |
border: none; | |
} | |
} | |
@mixin test-link-title { |
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
<% favicons.each do |favicon| %> | |
<% unless favicon[:rel].nil? %> | |
<link rel="<%= favicon[:rel]%>" sizes="<%= favicon[:size]%>" href="<%= data.informacoes_do_site.hostname + "/" + favicon[:icon]%>"> | |
<% end -%> | |
<% end -%> |
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
defmodule Palindromes do | |
def run do | |
["amor", "roma", "phoenix", "mora", "elixir"] | |
|> Enum.group_by(&canonicalize/1) | |
|> IO.inspect | |
end | |
defp canonicalize(word) do | |
word | |
|> String.graphemes |
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
defmodule R do | |
def reload! do | |
Mix.Task.reenable "compile.elixir" | |
Application.stop(Mix.Project.config[:app]) | |
Mix.Task.run "compile.elixir" | |
Application.start(Mix.Project.config[:app], :permanent) | |
end | |
end |
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
du -sh dir/ | sort -hr | head -n10 |
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
function varpost($endpoint, $data){ | |
$ch = curl_init($endpoint); | |
curl_setopt_array($ch, array( | |
CURLOPT_POST => TRUE, | |
CURLOPT_RETURNTRANSFER => TRUE, | |
CURLOPT_HTTPHEADER => array( | |
'Content-Type: application/json' | |
), | |
CURLOPT_POSTFIELDS => json_encode($data) | |
)); |
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
~// WARNING: The command DOES NOT WORK if you don't have root access to yout network device. Prepend sudo if you are not root. \\~ | |
Use TCPDUMP to Monitor HTTP Traffic | |
1. To monitor HTTP traffic including request and response headers and message body: | |
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | |
2. To monitor HTTP traffic including request and response headers and message body from a particular source: | |
tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' |
OlderNewer