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
set height 0 | |
catch syscall close | |
catch syscall read | |
catch syscall lseek | |
disable 1 2 | |
commands 2 | |
disable 1 2 | |
continue |
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
command: | |
- /bin/sh | |
- -c | |
- | | |
cat << EOF > blackbox.yml && /bin/blackbox_exporter --config.file=blackbox.yml | |
modules: | |
http_2xx: | |
prober: http | |
http: | |
tls_config: |
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
#!/bin/sh | |
# cat /etc/os-release | |
# NAME="Amazon Linux" | |
# ... | |
sudo yum -y install git docker htop tree golang ruby | |
sudo systemctl enable 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
#!/bin/sh | |
# cat /etc/os-release | |
# NAME="Amazon Linux" | |
# ... | |
sudo yum -y install git docker htop tree golang ruby | |
sudo systemctl enable 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
#!/bin/sh | |
for arg in "job1" "job2"; do | |
( | |
echo $arg | |
) & pids+=($!) | |
done | |
wait "${pids[@]}" |
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
/** | |
* const typeDefs: ITypeDefinitions = ` | |
* scalar StringOrInt | |
* ... | |
* height: StringOrInt | |
* ` | |
*/ | |
const resolvers: IResolvers = { | |
StringOrInt: { |
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
// graph hosts by source over time. | |
_sourceCategory=<source> | |
| timeslice 1m | |
| count_distinct(_sourceHost) group by _timeslice, _sourceCategory | |
| transpose row _timeslice column _sourceCategory | |
// nginx requests per second. | |
_sourceCategory=<source> |
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
ffmpeg -r 60 -pattern_type glob -i '*.JPG' -s hd720 -vcodec libx264 -crf 18 -preset slow timelapse.mp4 | |
# Filters | |
# | |
# https://ffmpeg.org/ffmpeg-filters.html#eq | |
# | |
# ffplay -vf eq=contrast=1.3:saturation=0.25 timelapse.mp4 |
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
const crypto = require('crypto'); | |
const sha256 = s => crypto.createHash('sha256').update(s, 'utf8').digest('hex'); | |
// sha256("test") => '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' | |
// sha256("abc") => 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad' |
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
namespace :deploy do | |
namespace :sidekiq do | |
desc 'Replace upstart config for sidekiq-workers' | |
task :upstart_config do | |
data = %Q{ | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
exec su - #{user} -c 'cd #{release_path}; export RAILS_ENV=#{stage}; bundle exec sidekiq -q default,1 -c 4 -pid #{release_path}/tmp/pids/sidekiq.pid >> #{release_path}/log/sidekiq.log 2>&1' |