Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby Scripts To Make Life Easier
Search
Paulo Ancheta
December 06, 2016
Programming
1
130
Ruby Scripts To Make Life Easier
Introduction to subprocesses and how to use them for everyday use.
Paulo Ancheta
December 06, 2016
Tweet
Share
More Decks by Paulo Ancheta
See All by Paulo Ancheta
Demystifying Git
pauloancheta
0
39
A PR Has Been Submitted
pauloancheta
0
50
Other Decks in Programming
See All in Programming
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
430
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
630
VS Code Update for GitHub Copilot
74th
1
490
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
4
1k
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
330
Discover Metal 4
rei315
2
110
Goで作る、開発・CI環境
sin392
0
180
Is Xcode slowly dying out in 2025?
uetyo
1
240
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
110
NPOでのDevinの活用
codeforeveryone
0
480
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
380
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
220
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
Become a Pro
speakerdeck
PRO
28
5.4k
Into the Great Unknown - MozCon
thekraken
39
1.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
What's in a price? How to price your products and services
michaelherold
246
12k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
24k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
124
52k
4 Signs Your Business is Dying
shpigford
184
22k
Transcript
Ruby Scripts to Make Life Easier #MakeRubyGreatAgain
@PauloAncheta
We make alias-es all the time. We should make something
more useful.
# talk.rb system “echo hello world” $ ruby talk.rb hello
world
# talk* #! bin/env ruby `echo hello world` $ mv
talk.rb talk $ chmod u+x talk $ ./talk hello world
# talk* #! bin/env ruby string = “hello world” `echo
#{string}` $ ./talk hello world
# talk* #! bin/env ruby string = “hello world” `echo
#{string.gsub(/world/, “VanRuby”) } | grep file.txt` $ ./talk | more file.txt hello VanRuby
$ irb irb(main):001:0> files = `ls` => “Applications\nDesktop\nDocuments\nDow nloads\nLibrary\nMovies\nMusic\nPictur es\nPublic\ntalk\n”
irb(main):002:0> files.class => String
irb(main):003:0> system `ls` => true
All of that is great. How can I be productive
doe?
# clean-pg* #! bin/env ruby pg = `ps aux |
grep postgres | grep waiting` pg = pg.split(/\n/) pg.each do |waiting| # ... some process to get the pid `kill #{pid}` end
# split-branch* #! bin/env ruby # commits => 1z2y3 TICKET-number
msg specific_commits = `git log - -pretty - -oneline | grep #{ARGV}` `git checkout master && git pull origin master && git checkout -b test-branch` specific_commits.each do |commit| sha = commit[0..6] # => [123asdf, qwer456, … ] `git cherry-pick #{sha}` end
#MakeRubyGreatAgain