Skip to content

Instantly share code, notes, and snippets.

¯\_(ツ)_/¯

Dmitry Filimonov petethepig

¯\_(ツ)_/¯
View GitHub Profile
View mal-cloc.txt
# I ran cloc (https://github.com/AlDanial/cloc) on each directory of mal (https://github.com/kanaka/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.
github.com/AlDanial/cloc 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
petethepig / 0-screenshot.md
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 http://www.appsbynight.com
@petethepig
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
EOF
exit
end
View backup.sh
#!/bin/bash
USER=root #mysql credentials
PASSWORD=***
BACKUP=/root/backups #temporary storage
CLOUD=/mnt/yandex.disk/backups
OLD=10
PREFIX=dfilimonov.com
DATE=`date '+%Y-%m-%d'`
@petethepig
petethepig / space_check.rb
Created Sep 15, 2012
Sending SMS every time the available disk space is less than 25%
View space_check.rb
#!/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
You can’t perform that action at this time.