This is a basic guide on hardening your Debian VPS. And Ubuntu users may also find this guide useful, since Ubuntu is based on Debian.
Don't panic!
| # Video of it in action: http://cl.ly/VSIF | |
| class MyScene < SKScene | |
| def scroll_action(x, duration) | |
| width = (x * 2) | |
| move = SKAction.moveByX(-width, y: 0, duration: duration * width) | |
| reset = SKAction.moveByX(width, y: 0, duration: 0) | |
| SKAction.repeatActionForever(SKAction.sequence([move, reset])) | |
| end |
| # There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
| # iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
| # iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
| # What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
| $ cd /tmp/ | |
| $ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
| $ plutil -convert xml1 com.googlecode.iterm2.plist | |
| $ vi com.googlecode.iterm2.plist |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| from django.forms import ModelForm | |
| from django.forms.models import inlineformset_factory | |
| from models import Sponsor, Sponsorship | |
| class SponsorForm(ModelForm): | |
| class Meta: | |
| model = Sponsor |
| #!/usr/bin/env ruby | |
| if `git diff --cached spec` =~ /,\s?(:focus|focus:\s?true|:focus\s?=>\s?true)/ | |
| puts "\e[31mPlease focus and remove your :focus tags before committing :)" | |
| exit 1 | |
| end |
| # -*- coding: utf-8 -*- | |
| $:.unshift("/Library/RubyMotion/lib") | |
| require 'motion/project' | |
| require 'motion-cocoapods' | |
| require 'bundler' | |
| Bundler.require | |
| Dir.glob('lib/tasks/*.rake').each { |r| import r } | |
| VERSION = "1.0.2" |
| require "coffee-script" | |
| module Jekyll | |
| # Automatically force coffeescript files to be compiled, even if they don't | |
| # have the YAML front-matter. | |
| class CoffeeConvertor < Generator | |
| def generate(site) | |
| converted = [] | |
| site.static_files.each do |sf| |
| #!/bin/sh | |
| # | |
| # Lives in .git/hooks. | |
| # To enable this hook, rename this file to "pre-commit". | |
| # Redirect output to stderr. | |
| exec 1>&2 | |
| # works, but is slow. try with ack! | |
| # LANG=C find . -name '*_spec.rb' | xargs egrep -q '^\s*(describe|it|context)\b.*focus' |
| ARCHFLAGS="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config |