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
package main | |
import "fmt" | |
import "encoding/base64" | |
import "bytes" | |
var suspiciousBase64 = []byte(`OSEeu8fWTcq+AliFG3PlZ0eYR8zFWWAdkCwb3XbPE96wvAsiF1W6v2Udg5KoDe7M2d0oQMmpoNeC | |
ZQWRMBHarz5vHzfTSXXCjvoLfZJVA1FLiJ9RYk8ulFyEJF19nxd2GLArnWjiqsP9RslhFB3BvYnZ | |
O9IsuyRqWKpa1nl5B68=`) |
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
apt-get update | |
apt-get upgrade -y | |
apt-get install -y aptitude vim git libssl-dev build-essential | |
mkdir ~/rust-temp-dir | |
cd ~/rust-temp-dir | |
# Rust 1.1.0 | |
# export CARGO_URL="https://www.dropbox.com/sh/qfbt03ys2qkhsxs/AAACKdu99RNndY8AjA15pZlIa/1.1.0/cargo-2015-05-14-a483581-arm-unknown-linux-gnueabihf-65bc529734a332b57b4bcf3d7c32e7f6aa4d449f.tar.gz?dl=0" | |
# export RUST_URL="https://www.dropbox.com/sh/qfbt03ys2qkhsxs/AAANQ7TuyVUtA09TfFyR-s7aa/1.1.0/rust-2015-06-19-35ceea3-arm-unknown-linux-gnueabihf-1d459e0987537a1f2ecc1c5bd594d2e776f88927.tar.gz?dl=0" |
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
require 'string' | |
function split(inputstr, sep) | |
if sep == nil then | |
sep = "%s" | |
end | |
local t={} ; i=1 | |
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do | |
t[i] = str | |
i = i + 1 |
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
user = "xavierlange" | |
heka_dir = "#{Chef::Config[:file_cache_path]}/heka" | |
%w(cmake mercurial fakeroot debhelper libgeoip-dev).each do |pkg| | |
package pkg | |
end | |
directory heka_dir do | |
owner user | |
group user |
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
error: type `std::io::buffered::BufWriter<&mut [u8]>` does not implement any method in scope named `write_be_u32` | |
writer.write_be_u32::<BigEndian>(interval_ceiling).unwrap(); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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
def lookup(type) | |
case type | |
when "string" then "string" | |
when "text" then "string" | |
when "boolean" then "boolean" | |
when "integer" then "number" | |
when "datetime" then "utc" | |
else raise "don't know corresponding type for ActiveRecord #{type}" | |
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
# You need to point apt at old-releases.ubuntu.com | |
sudo sed -i 's/us.archive.ubuntu.com/old-releases.archive.ubuntu.com/g' /etc/apt/sources.list |
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
class LogLine(object): | |
def __init__(self,raw_line): | |
self.pid = pid(raw_line) | |
self.ip = ip(raw_line) | |
self.timestamp = timestamp(raw_line) | |
def pid(self,line): | |
pass | |
def ip(self,line): |
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
/* Put your CSS here */ | |
html, body { | |
margin: 20px; | |
} |
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
class AdsSerializer < ActiveModel::Serializer | |
attributes :target_url, | |
:image_url, | |
:thumb_url | |
def image_url | |
image.url | |
end | |
def thumb_url | |
thumb.url | |
end |