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
<?php | |
namespace Linkofy\CommonBundle\Menu; | |
use Knp\Menu\FactoryInterface; | |
use Symfony\Component\DependencyInjection\ContainerAware; | |
class Builder extends ContainerAware | |
{ | |
public function mainMenu(FactoryInterface $factory, array $options) |
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
<?php | |
namespace Ormigo\Bundle\BackofficeBundle\Menu; | |
use Knp\Menu\FactoryInterface; | |
use Symfony\Component\DependencyInjection\ContainerAware; | |
use Ormigo\Bundle\UserBundle\Model\User\UserQuery; | |
use Symfony\Component\Security\Core\Role\SwitchUserRole; |
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
#http://kbyanc.blogspot.com/2007/07/python-aggregating-function-arguments.html | |
def arguments(): | |
"""Returns tuple containing dictionary of calling function's | |
named arguments and a list of calling function's unnamed | |
positional arguments. | |
""" | |
from inspect import getargvalues, stack | |
posname, kwname, args = getargvalues(stack()[1][0])[-3:] | |
posargs = args.pop(posname, []) |
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
import paraminko | |
paramiko.util.log_to_file('ssh.log') # sets up logging | |
client = paramiko.SSHClient() | |
client.load_system_host_keys() | |
client.connect('127.0.0.1', username=username, password=password) | |
stdin, stdout, stderr = client.exec_command('ls -l') |
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
import paramiko | |
client = paramiko.SSHClient() | |
client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
client.connect('127.0.0.1', username=username, password=password) | |
stdin, stdout, stderr = client.exec_command('ls -l') |
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
import sys | |
import time | |
import select | |
import paramiko | |
host = 'test.example.com' | |
i = 1 | |
# | |
# Try to connect to the host. |
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
Assume we are in directory named "demo" and we have php: >=5.3.3 installed | |
Download phpdoc from http://phpdoc.org/phpDocumentor.phar | |
1) Simple example of the source generation workflow | |
Go to the packagist to the page of some package. For example https://packagist.org/packages/monolog/monolog | |
Look of the package source code location at the top of the page. It will say "Source: https://github.com/Seldaek/monolog/tree/master" (99% it will be github) | |
Go to this page and download source code archive. In our example it will be https://github.com/Seldaek/monolog/archive/master.zip | |
Extract this archive to the some directory, for example in "source" |
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 | |
# /etc/init.d/mjpg_streamer.sh | |
# v0.2 phillips321.co.uk | |
### BEGIN INIT INFO | |
# Provides: mjpg_streamer.sh | |
# Required-Start: $network | |
# Required-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: mjpg_streamer for webcam |
OlderNewer