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
#!/usr/bin/env python | |
# Try to determine how much RAM is currently being used per program. | |
# Note per _program_, not per process. So for example this script | |
# will report RAM used by all httpd process together. In detail it reports: | |
# sum(private RAM for program processes) + sum(Shared RAM for program processes) | |
# The shared RAM is problematic to calculate, and this script automatically | |
# selects the most accurate method available for your kernel. | |
# Licence: LGPLv2 |
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 | |
### BEGIN INIT INFO | |
# Provides: puma app runner | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the puma web server | |
# Description: starts the puma web server |
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
1. Make sure you have guest addons installed. | |
for example : "c:\www\dev" | |
2. On host, select the share you want to share and remember what it's called. Its real path does not matter! So let's say your share is called dev. | |
3. Launch virtual machine guest. In terminal, type: | |
$ cd /mnt | |
$ sudo mkdir shares | |
$ sudo mount -t vboxsf dev shares | |
And that's it. Don't worry about the absolute paths. You don't need them. For all practical purposes, VB will take care of the real path behind the share name, in this case Dedoimedo. |
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
$ backup generate:model --trigger backup_name\ | |
--databases="mysql" --storages="dropbox" \ | |
--compressor="gzip" --notifiers="mail" |
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
sudo apt-get install php5-cli php5-fpm php5-mcrypt | |
sudo php5enmod mcrypt | |
sudo service php5-fpm restart |
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
#! /usr/bin/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'cgi' | |
mode = 'prod' | |
id = '000000' | |
new = 'true' |
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
:: Make --no-ri --no-rdoc default gem install options (without documentation) | |
:: Possible variations: | |
:: For every user: | |
:: echo gem: --no-ri --no-rdoc > "%PROGRAMDATA%\gemrc" | |
:: Only for you | |
:: echo gem: --no-ri --no-rdoc >> "%USERPROFILE%\.gemrc" | |
:: | |
:: Note: In Windows, %PROGRAMDATA% is /etc on Linux | |
:: | |
:: But finally, the best way to do it. See: http://stackoverflow.com/a/7662245/1579985 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
module Serializer | |
def serializables | |
self.class.instance_variable_get('@serializables') | |
end | |
def attr_accessors | |
self.class.instance_variable_get('@attr_accessors') | |
end | |
def self.included(klass) |
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 10 -f image2 -s 1920x1080 -i %04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p test.mp4 | |
# -r is the framerate (fps) | |
# -i %04d.png (example 0001.png, 0002.png) | |
# -crf is the quality, lower means better quality, 15-25 is usually good | |
# -s is the resolution | |
# -pix_fmt yuv420p specifies the pixel format, change this as needed |
OlderNewer