This file contains hidden or 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
| --iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT | |
| --iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT | |
| --iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 |
This file contains hidden or 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
| ### Nginx upstart script | |
| ### source: http://serverfault.com/a/391737/70451 | |
| ### /etc/init/nginx.conf | |
| description "nginx http daemon" | |
| start on (filesystem and net-device-up IFACE=lo) | |
| stop on runlevel [!2345] | |
| env DAEMON=/opt/nginx/sbin/nginx |
This file contains hidden or 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
| dscacheutil -flushcache |
This file contains hidden or 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
| #validates :email, :presence => true, :email => true | |
| require 'mail' | |
| class EmailValidator < ActiveModel::EachValidator | |
| def validate_each(record,attribute,value) | |
| begin | |
| m = Mail::Address.new(value) | |
| # We must check that value contains a domain and that value is an email address | |
| r = m.domain && m.address == value | |
| t = m.__send__(:tree) |
This file contains hidden or 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
| @response = ActiveSupport::JSON.decode(@data.body) |
This file contains hidden or 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
| # Get file mime type using command line | |
| file --mime-type -b Transcodez-license.transcodez |
This file contains hidden or 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
| git rm $(git ls-files --deleted) |
This file contains hidden or 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
| skatr_development=# \d spots | |
| Table "public.spots" | |
| Column | Type | Modifiers | |
| -------------+-----------------------------+---------------------------------------------------- | |
| id | integer | not null default nextval('spots_id_seq'::regclass) | |
| ALTER SEQUENCE spots_id_seq RESTART WITH 1; |
This file contains hidden or 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
| fernyb@fernyb-SD30V10:~/sources$ wodim --devices | |
| wodim: Overview of accessible drives (1 found) : | |
| ------------------------------------------------------------------------- | |
| 0 dev='/dev/sg0' rwrw-- : 'TSSTcorp' 'CDDVDW SH-S203B' | |
| ------------------------------------------------------------------------- | |
| wodim dev=/dev/sg0 -v -data ~/the-dictator.iso |
This file contains hidden or 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
| # Current path should have VIDEO_TS directory | |
| # | |
| mkisofs -dvd-video -o ~/Desktop/back-to-the-future.iso . |