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
git log --author="Christian Doyle" --after="2015-1-1" --before="2015-12-31" --date=short --no-merges --pretty=format:'%h was %an, %ad, message: %s' | tail -r > commits.txt |
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
(0..255).each do |i| | |
ip = "192.168.1.#{i}" | |
result = `ping -c 1 -W 5 #{ip}` | |
if result.match(/1 packets received/) | |
puts "something on #{ip}" | |
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
curl -X PUT -T test_s3.txt -L "https://your-bucket.s3.amazonaws.com/url-stuff" |
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
find . -type f -exec sed -i '' -e 's/foo/bar/g' {} \; |
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
library(GGally) | |
csv = read.csv(file="path", head=TRUE,sep=",") | |
ggpairs(csv, columns = c(3, 7)) |
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
times = [1,2,4,5,10,12,14,20,22,23,24] | |
@group = 0 | |
@delta = 3 | |
def group(times) | |
times.group_by do |item| | |
index = times.index(item) | |
if index <= times.size - 2 | |
a = index + 1 |
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
require 'csv' | |
file = ARGV[0] | |
rows = CSV.read(file, :encoding => 'windows-1251:utf-8') | |
out = CSV.open("#{file.split('.')[0]}_fixed.csv", 'wb') | |
rows.each{|row| out << row} | |
out.close |
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
rsync -avzhet ssh user@server:remote_path . |
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
gzcat foo.gz | mysql -u root database |
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
vim -c "set nobomb" -c wq! foo.txt |