Skip to content

Instantly share code, notes, and snippets.

View petethepig's full-sized avatar
🔥
Building Pyroscope

Dmitry Filimonov petethepig

🔥
Building Pyroscope
View GitHub Profile
@josby
josby / concat_mp4.sh
Created May 12, 2017 18:38
Concat GoPro Videos with ffmpeg
ffmpeg -f concat -safe 0 -i <(for f in ./*.MP4; do echo "file '$PWD/$f'"; done) -c copy output.MP4
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@petethepig
petethepig / mfa-delete.rb
Created January 29, 2013 08:08 — forked from anonymous/mfa-delete.rb
A simple tool that will help you enable MFA Delete feature on your S3 bucket
#!/usr/bin/env ruby
require 'aws'
if ARGV.length < 5
print <<-EOF
Usage: mfa-delete.rb <bucket_name> <aws_id> <aws_secret> <mfa_serial> <mfa_token> <s3_endpoint>
<s3_endpoint> is optional
EOF
exit
end
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@petethepig
petethepig / space_check.rb
Created September 15, 2012 13:33
Sending SMS every time the available disk space is less than 25%
#!/usr/local/bin/ruby
require 'net/http'
require 'sys/filesystem' # gem install sys-filesystem
api_id="api_id from sms.ru" # get one on sms.ru
phone_number="79111234567" # your phone number
stat = Sys::Filesystem.stat("/")
space = (stat.blocks_available.to_f / stat.blocks * 100).round
@twonjosh
twonjosh / Create iOS Icons.jsx
Last active April 25, 2023 08:41 — forked from ma11hew28/Create Icons.jsx
Photoshop Script to Create iOS Icons from a source image
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
@funami
funami / gist:2407027
Created April 17, 2012 15:50
Upload file to S3 with AFNetworking
#import "AFNetworking.h"
- (IBAction)uploadTest:(id)sender {
NSURL *url = [NSURL URLWithString:@"https://xxx.s3-ap-northeast-1.amazonaws.com/"];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
NSData *imageData = UIImagePNGRepresentation([UIImage imageNamed:@"194-note-2.png"]);
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
@"xxxxx/videos/XXXXW",@"key",
@"XXXXXXXX",@"AWSAccessKeyId",
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".