0x6a SYMFONY NOTIFICATION - FLASHBAG

Create notification in controller:

$this->addFlash(
    'notice',
    'Your changes were saved!'
);

$this->addFlash is equivalent to $this->get('session')->getFlashBag()->add

Twig template to show notification:

{% for flash_message in app.session.flashbag.get('notice') %}
<div class="alert alert-success">
    {{ flash_message }}
</div>
{% endfor %}
symfony

 

0x6b XEN - BRIDGE SETUP

So, for the VM we set a bridge. To do that we need to have bridge-utils package installed (yum install bridge-utils) and set-up the br0 bridge. There’s no need to set an IP address on the bridge as we only need to set a static route on it.

/etc/sysconfig/network-scripts/ifcfg-br0 would look like this:

Continue reading →

linux admin

 

0x6c GIT - ADD REMOTE

So, firstly setup the remote repository:

ssh git@example.com
mkdir my_project.git
cd my_project.git
git init --bare
git update-server-info # If planning to serve via HTTP

On local machine:

cd my_project
git init
git add *
git commit -m "My initial commit message"
git remote add origin git@example.com:my_project.git
git push -u origin master
admin

 

0x69 MAC OS - CLEAR DNS CACHE

OS X Yosemite and later

Use the following Terminal command to reset the DNS cache in OS X v10.10.4 or later:

sudo killall -HUP mDNSResponder

Use the following Terminal command to reset the DNS cache in OS X v10.10 through v10.10.3:

sudo discoveryutil mdnsflushcache

OS X Mavericks, Mountain Lion, and Lion

Use the following Terminal command to reset the DNS cache in OS X v10.9.5 and earlier:

sudo killall -HUP mDNSResponder

Mac OS X Snow Leopard

Use the following Terminal command to reset the DNS cache in OS X v10.6 through v10.6.8:

sudo dscacheutil -flushcache
macosx

 

0x66 ORACLE - MASS UPDATE IP NET C/B

update net C

UPDATE IPWC_TEST SET
IP='_NEW.NET.C_.'||TO_NUMBER(REGEXP_SUBSTR(IP, '[0-9]+', 1, 4))
WHERE
TO_NUMBER(REGEXP_SUBSTR(IP, '[0-9]+', 1, 1))||'.'||TO_NUMBER(REGEXP_SUBSTR(IP, '[0-9]+', 1, 2))||'.'||TO_NUMBER(REGEXP_SUBSTR(IP, '[0-9]+', 1, 3))='_OLD.NET.C_'

update net B

UPDATE ipwarmer_config SET
IP='_NEW.NET_B_.'||TO_NUMBER(REGEXP_SUBSTR(IP, '[0-9]+', 1, 3))||'.'||TO_NUMBER(REGEXP_SUBSTR(IP, '[0-9]+', 1, 4))
WHERE
TO_NUMBER(REGEXP_SUBSTR(IP, '[0-9]+', 1, 1))||'.'||TO_NUMBER(REGEXP_SUBSTR(IP, '[0-9]+', 1, 2))='_OLD.NET_B_'
oracle

 

0x68 SYMFONY2 - CREATE BUNDLE

bin/console generate:bundle 

It will ask some questions and creates all minimal needed files.

symfony

 

0x84 FRANCE - PARIS, ÎLE-DE-FRANCE, 2-4 AUG 2015

Аэропорт CDG огромен. Нет, ОГРОМЕН! Хорошо, что терминал, на который мы припарковались как раз рядом со станцией RER (типа электричек, тока офигенские)

Continue reading →

travel france