Skip to content

Instantly share code, notes, and snippets.


Dmitry Filimonov petethepig

Block or report user

Report or block petethepig

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mal-cloc.txt
# I ran cloc ( on each directory of mal (
# These are the results:
dir-name top-language files blank comment code
objpascal Pascal 19 706 951 6275
ada Ada 28 1984 380 5892
elm Elm 19 1625 226 5682
swift Swift 20 980 1519 5636
View mal-cloc.txt
$ cloc .
1821 text files.
1765 unique files.
470 files ignored. v 1.74 T=15.81 s (85.8 files/s, 12774.4 lines/s)
Language files blank comment code
Visual Basic 38 1573 132 8103
petethepig /
Last active May 30, 2019
Send AWS EC2 maintenance notification to Slack
View Create iOS Icons.jsx
// 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
petethepig / mfa-delete.rb
Created Jan 29, 2013 — forked from anonymous/mfa-delete.rb
A simple tool that will help you enable MFA Delete feature on your S3 bucket
View mfa-delete.rb
#!/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
USER=root #mysql credentials
BACKUP=/root/backups #temporary storage
DATE=`date '+%Y-%m-%d'`
petethepig / space_check.rb
Created Sep 15, 2012
Sending SMS every time the available disk space is less than 25%
View space_check.rb
require 'net/http'
require 'sys/filesystem' # gem install sys-filesystem
api_id="api_id from" # get one on
phone_number="79111234567" # your phone number
stat = Sys::Filesystem.stat("/")
space = (stat.blocks_available.to_f / stat.blocks * 100).round
You can’t perform that action at this time.