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
Composer doesn't work with GitHub Two Factor Authentication. | |
You have to generate a token (with "repo" scope at least) at https://github.com/settings/applications | |
Copy the token and keep it somewhere safe. | |
Run: composer config -g github-oauth.github.com paste-your-token-here |
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 config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit" |
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
# app/config/config.yml | |
fos_user: | |
db_driver: ~ # Required | |
firewall_name: ~ # Required | |
user_class: ~ # Required | |
use_listener: true | |
use_username_form_type: true | |
model_manager_name: null # change it to the name of your entity/document manager | |
if you don't want to use the default one. | |
from_email: |
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
brew install postgresql | |
initdb /usr/local/var/postgres -E utf8 | |
gem install lunchy | |
mkdir -p ~/Library/LaunchAgents | |
cp /usr/local/Cellar/postgresql/9.3.1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents | |
lunchy start postgres | |
lunchy stop postgres | |
# TIPS PostgreSQL | |
# initdb /usr/local/var/postgres -E utf8 # create a database cluster |
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
# Install homebrew first... | |
# Then: | |
brew install dnsmasq | |
cp /usr/local/Cellar/dnsmasq/X.XX/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf | |
sudo cp /usr/local/Cellar/dnsmasq/X.XX/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons | |
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist | |
# Edit /usr/local/etc/dnsmasq.conf to add custom TLD (here: *.dev): | |
echo "address=/dev/127.0.0.1" >> /usr/local/etc/dnsmasq.conf |
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
# Stop | |
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist | |
# Start | |
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist |
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
# (Need a 8 GB USB drive should be called Untitled and formatted as Mac OS Extended (Journaled). The installer should be called Install OS X Mavericks.app and should be in the Applications folder.) | |
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction |
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
<?php | |
namespace Eko\MiscBundle\Command; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Filesystem\Filesystem; | |
use Symfony\Component\Finder\Finder; |
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
<?php | |
class AppKernel extends Kernel | |
{ | |
// ... | |
public function getCacheDir() | |
{ | |
if (in_array($this->environment, array('dev', 'test'))) { | |
return '/dev/shm/appname/cache/' . $this->environment; |
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
# /etc/fail2ban/jail.local | |
# [...] | |
[nginx-dos] | |
# Based on apache-badbots but a simple IP check (any IP requesting more than | |
# 240 pages in 60 seconds, or 4p/s average, is suspicious) | |
# Block for two full days. | |
# @author Yannick Warnier | |
enabled = true |