Skip to content

Instantly share code, notes, and snippets.

View rostamizadeh's full-sized avatar

Robert Rostamizadeh rostamizadeh

View GitHub Profile
@rostamizadeh
rostamizadeh / vimeo-downloader.js
Created January 24, 2022 05:31 — forked from aik099/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// (done automatically now) 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
const { exec } = require('child_process');
@rostamizadeh
rostamizadeh / Monit_Capistrano_Recipe.rb
Created July 12, 2012 22:19
My Monit-Capistrano configuration for watching over Unicorn master and worker processes
namespace :monit do
desc "Monit unicorn configuration"
task :unicorn_service_tests, roles: :web do
run "mkdir -p #{shared_path}/config"
template "monit_unicorn.rb.erb", "/tmp/monit_unicorn"
run "#{sudo} mv /tmp/monit_unicorn /etc/monit/conf.d/unicorn_#{application}_#{rails_env}.conf"
unicorn_worker_pids.each do |val|
worker_template "monit_unicorn_worker.rb.erb", "/tmp/monit_unicorn_#{application}_#{rails_env}_#{val}_worker", val
@rostamizadeh
rostamizadeh / unicorn_init.erb
Created July 11, 2012 06:11
Unicorn Upgrade Scripts
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
### END INIT INFO